Blitz3D and Fontext

Blitz3D Forums/Blitz3D Programming/Blitz3D and Fontext

carpman(Posted 2005) [#1]
I'm trying to set up a small GUI for my railway sim using FONTEXT.
I'm not sure how to get Blitz to react to the mouseclick, and I 'm struggling a bit, am I supposed to do something like this....

If HUDevent() = LayerID And MouseHit(1)
Do Whatever.......
EndIf

I've looked at the code in the FONTEX HudCode folder but it dosen't seem to cover this...maybe I'm missing something.
I've checked through the code archieves and forums but can't seem to find anything on this subject.
If anyone could supply any code on setting up a GUI with FONTEXT I would be very greatful. Anything that would point me in the right direction.

Thanks


Beaker(Posted 2005) [#2]
Take a look at "HUD test 5 clicks.bb" in your "HUD code" folder.

It should be something like this:
If (HUDevent() = LayerID) And MouseDown(1)
;Do Whatever....... 
EndIf


I don't think MouseHit() is quite responsive enough. You can emulate it by checking for "Not MouseDown(1)" inside the If..Endif shown above.

You might find the FONText forum useful:
http://playerfactory.proboards25.com

Hope this helps.


carpman(Posted 2005) [#3]
Many thanks Beaker...I'll give it a try, but I'm just going to work so it will have to wait for another 7 hours(weep).
I forgot about the FONText forum,thanks...expect some basic question there soon.!!!!


Beaker(Posted 2005) [#4]
You will need to define the buttons outside your mainloop like this:
logoID = MakeImageButton (logo)
or..
textID = MakeTextButton(myLayer)