Hello!
As you can see I am new, just as I am new to DBPro. I am attempting to create a dynamic console screen on a 3D mesh. The idea is the console does not have a simple animated or static texture, but actually has a texture that updates according to player interaction. In other words I would like to have some buttons on it, as well as it changing when needed.
So far I have been able to create a bitmap, draw to it, and then copy it to an image, and texture a cube with it. My code is very inefficient but it works for the moment. I would now like to be able to bring in my .x mesh of my console and texture the screen surface of it.
Afterwards I will change the random text that is currently being drawn to the bitmap buffer, into something more elaborate like rectangular buttons. I would like to be able to know when I click on the surface whether or not I am clicking inside the pixel range of the buttons. Or would it be the U V range? I will need a indepth explanation of how this works and how to accomplish it.
So, here is what I have so far. Any suggestions of optimization or criticism is welcomed.
REM ====TEST CODE====
REM -MAKE OUR BITMAP
CREATE BITMAP 1,512,512,0
REM -START DRAWING PROCEDURES
SET CURRENT BITMAP 1
CLS RGB(127,127,127)
SET CURRENT BITMAP 1
CLS RGB(127,127,127)
FOR P=10 TO 500 STEP 10
INK RGB(RND(255),RND(255),RND(255)),RGB(0,0,0)
Text 10,P,"TESTING: 1,2,3,4,5,6,7,8,9,10"
NEXT
REM MAKE INK WHITE AGAIN
INK RGB(255,255,255),RGB(255,255,255)
GET IMAGE 1,1,1,512,512,3
SET CURRENT BITMAP 0
REM CHANGE BUFFER?
SET CURRENT BITMAP 0
MAKE CAMERA 1
POSITION CAMERA 1, 0,0,-2
COLOR BACKDROP 1,RGB(15,15,15)
MAKE OBJECT CUBE 1,1
ROTATE OBJECT 1, 45.0,45.0,0.0
WHILE ESCAPEKEY() = 0
START:
TEXTURE OBJECT 1,1
GOTO MySub
MySub:
SET CURRENT BITMAP 1
CLS RGB(127,127,127)
FOR P=10 TO 500 STEP 10
INK RGB(RND(255),RND(255),RND(255)),RGB(0,0,0)
Text 10,P,"TESTING: 1,2,3,4,5,6,7,8,9,10"
NEXT
GET IMAGE 1,1,1,512,512,3
SET CURRENT BITMAP 0
GOTO START
ENDWHILE
DELETE BITMAP 1
DELETE IMAGE 1
DELETE OBJECT 1
DELETE CAMERA 1
DELETE LIGHT 0
CLS RGB(0,0,0)
WAIT KEY
END
Thank you for your time. I hope to hear from you soon.