Game Development Community

Button shape question

by Ronald J Nelson · in Torque Game Engine · 12/07/2005 (6:52 am) · 7 replies

Is there anyway to change the shape of the standard rectangle shaped button? I don't mean using a bitmap button, but actually changing the shape of the regualr button?

or....

Is there any way to have a button that uses the same text variable as a regular button and that text is visible, but on a bitmap style button?

Thanks in advance.

#1
12/07/2005 (7:26 am)
I don't believe there's any way of changing the current "hit rectangle" of a button (without modifying the engine). But you can visually change what it looks like by using .png bitmap buttons with alpha maps (as you've stated above).

The 2nd question I'm having a little difficultly understanding.
Do you mean you can display regular text over a bitmap button? I believe a GuitBitmapButtonTextCtrl will do the trick for you.

- Eric
#2
12/07/2005 (8:23 am)
Indeed GuitBitmapButtonTextCtrl would be a solution where an image can be used to represent the button and allow the text and all of the various button states normal/hover/down/disabled to be maintained.
#3
12/07/2005 (3:14 pm)
Well that is almost exactly what I want. There is just one small problem, how can you make a GuitBitmapButtonTextCtrl change font color when mouse over, depressed, or inactive?
#4
12/07/2005 (4:03 pm)
By using a BitmapButtonCtrl with image files that have different colors of text on them.
#5
12/07/2005 (4:15 pm)
Yeah you just make a few different versions of your button image, you save them with similair file names, like buttonc buttonu ... im not exactly sure what the naming convention is since I havent made a bmp button for a long time, but just search here for guibitmapbutton
#6
12/07/2005 (5:54 pm)
The names are (from some I use):

btnOccupy_n.png
btnOccupy_h.png
btnOccupy_i.png
btnOccupy_d.png

n = Normal
h = Hit
i = Inactive
d = Down

Then, set the image name to be "btnOccupy".
#7
12/07/2005 (5:57 pm)
Well that sounds like a standard GuiBitmapButtonCtrl, not a GuiBitmapButtonTextCtrl. The Text shows on the GuiBitmapButtonTextCtrl but remains its default color even if it is mouse overed or depressed. That is what I am looking to change.