Game Development Community

Custom GUI Buttons

by Howard Dortch · in Torque Game Engine · 05/18/2004 (4:47 am) · 6 replies

I looked at the Devgame and liked how they used a custom bitmap(png) for all the buttons. In the mainMenuGui there is a GBbitmapButtonCtrl that I assume allows me to use a graphic instead of the stock gui button. In my program when I edit the gui I dont see this as an option.
In short I want to use my graphics for the buttons, any info on how to do this? I already got the guicontrols.zip and a couple others and they all seem to do it a different way. Is this a hack or is there a "right" way ?

#1
05/18/2004 (5:21 am)
GuiBitmapButtonCtrl is part of the stock Torque. It should be ther ein your list. Check again.
#2
05/18/2004 (5:24 am)
GBbitmapButtonCtrl not GuiBitmapButtonCtrl

GBbitmapButtonCtrl is defined in the devgame and I can see it when I try to create a new item but I dont see any reference to it in any other example.

I use the GuiBitmapButtonCtrl but can't get it to load a graphic. I can get GuiBitmapCtrl to load a graphic but it wont act as a button.
#3
05/18/2004 (8:10 am)
You want to use GuiBitmapButtonControl.

You need to create a series of images for each button state.

For example button_quit:
button_quit_n.jpg
button_quit_h.jpg
button_quit_d.jpg

In the bitmap field for the control you simply put the base name: "button_quit" with no extension.
#4
05/18/2004 (10:21 am)
As if by magic! Thank you!
#5
05/18/2004 (11:01 am)
FYI:
_n = normal
_h = hover
_d = depressed
_i = inactive
#6
07/16/2004 (10:43 am)
Nice info.. but where do i have to copy my images for that to work?..