buttons

Blitz3D Forums/Blitz3D Beginners Area/buttons

jigga619(Posted 2003) [#1]
I am making a modeler in blitz3d and I would like to know
how do you make button like rectangles in your programs that the user can press with the mouse? I used the rect command to make a rectangle, but you cannot press these rectangles in . How do you make the true Windows style buttons?


CS_TBL(Posted 2003) [#2]
uh ... if it's 1 button you can go mr.lame way:

asuming that mx and my are the mouse coords, and asuming that you leftclicked your mouse:


if mx>=rectx1 and mx <=rectx2 and my>=recty1 and my<= recty2
; 'button' pressed
endif

however.. I assume you've more objects on your screen that can be pressed or dragged (scrollbars), so you could put all these objects in an array.

Another way is that you take one of the 2d/3d GUI libraries available. However. it's less fun to do, and reading/understanding the source of someone else is -imo- a nightmare.


Warren(Posted 2003) [#3]
The short answer is, by hand. Or use a UI library (there are a few available). Blitz3D has no built in UI capabilities.