Game Development Community

GUI help please...

by Josiah Wang · in Torque Game Engine · 11/08/2003 (7:48 am) · 10 replies

Ok, I'm a newbie starting out. I think I know the basics of the GUI editor...but I have a question (obviously): how do I change the button picture of the buttons I make? Like, instead of the boring gray normal image, can I change it into something else (like load an external bitmap or something)...any help?

Thanks in Advance =)

#1
11/08/2003 (7:56 am)
There is a guiBitmapButton that does this - I'm not sure if it is in the latest Torque or not. Search the resources for it if not.
#2
11/08/2003 (12:18 pm)
There's a control that does what you want... they use it in the demo app, which is included in the Torque CVS.
#3
11/09/2003 (7:26 pm)
Joe use the guiBitmapButton

in the properties enter the name of the image file WITHOUT the file extension.
ie.
demo/client/ui/background
and not
demo/client/ui/background.bmp (which i found out the hard way

also for the actual file names you must place _n , _d, _h, _i trailing each name.
so for background it would be
background_n.bmp
background_d.bmp
background_h.bmp
background_i.bmp

h = highlighted
n = normal
d = down
i = inactive
#5
11/10/2003 (3:33 pm)
So how do i specify it to use different file types? (since you don't specify extensions...)

many thanks!
#6
11/10/2003 (3:42 pm)
The program will automatically pic the image in your folder no matter what ext it has. (i.e. bmp, png, jpg) Just only have 1 buttone ext for that name of button.

As for the _n, _h, _d parts it will set the button "style" automatically also.

Make sure your buttons are all in common/ui folder and when you enter the bitmap location in the editor enter it like this:

common/ui/yourbutton

With no extension at all. The rest will happen automatically ;)

Make sure you have at least the 3 types:
yourbutton_n.png
yourbutton_h.png
yourbutton_d.png

The .png is the format I use. You can have the same exact button for all 3 if you want but they must have the _n, _h, and _d in their name.
#7
11/11/2003 (11:24 pm)
Hehe good one Eric. See Eric its good to ask questions cause maybe someone else can find it useful ;)
#8
11/11/2003 (11:55 pm)
Lmao, guess I should read the links before I answer, I was just excited because I could actually share something I knew.
#9
03/18/2005 (10:15 pm)
I am unable to findguibitmapbutton state(pressed,release).please suggest me how can i do that.
#10
03/19/2005 (6:41 am)
To get the pressed, released state just use this:
%foo = object.getValue();

If %foo = 0, the button is released and 1 is pressed.

Also, to know if the button is in the active state or not:
%foo = object.isActive();