GUI Buttons... A couple questions.
by Kevin Ostrowski · in Torque Game Engine · 04/14/2003 (3:37 pm) · 2 replies
I've been working in TGE for a while, but I am finally getting deep into to the GUI's and I have a few, hopefully, simple questions. I've done my best to search around the forums before posting...
1) Is there any sort of tool tip feature for the default buttons (or in general)? Or would this be something I'd need to add.
2) I've checked out all the different resources floating around for bitmap buttons but they all seem to be lacking the "Button Type" option that is available for the default buttons. Has anyone added this feature to a graphical button? Basically I want to have checkbox be an image instead of the generic checkbox. Or is this also something I need to look in to adding in?
1) Is there any sort of tool tip feature for the default buttons (or in general)? Or would this be something I'd need to add.
2) I've checked out all the different resources floating around for bitmap buttons but they all seem to be lacking the "Button Type" option that is available for the default buttons. Has anyone added this feature to a graphical button? Basically I want to have checkbox be an image instead of the generic checkbox. Or is this also something I need to look in to adding in?
Torque Owner Jared Schnelle
1) Look at the onMouseEnter function which is part of GuiControl. You'd simply grab the location of the mouse (GuiEvent.mousePoint.x GuiEvent.mousePoint.y), and then create a rectangle that starts there, and moves out to your predefined amount.
2) This should be easy to do as well, just create a new gui type that has a "bool mIsChecked", and when the onMouseDown(GuiEvent &evt) function is called, just toggle them. Then in the onRender function, it'll check mIsChecked to figure out which image to print to the screen.