Game Development Community

Rollover button

by Nir Ziso · in Torque Game Builder · 08/23/2006 (12:31 pm) · 9 replies

How can i make Rollover button with 2 pictures and put on then the onmousemove event

#1
08/23/2006 (12:38 pm)
You could use a Bitmap button control.
if the normal button image is fred_n.png
the mouse over image would be fred_h.png
depressed image is fred_d.png
inactive fred_i.png
#2
08/23/2006 (12:48 pm)
How can i do it i do not know where should i put the other image so when i am rollover it will appere
#3
08/23/2006 (12:51 pm)
I want it to be in the gui option
#4
08/23/2006 (8:39 pm)
In Anthony's example, fred_n can be a completely different image (though not a different size) than fred_h or fred_d. You simply create the different images and refer to them in the Gui as "fred". The engine will automatically look for fred_n, fred_h, fred_d & fred_i.
#5
08/30/2006 (11:53 am)
Quote:Could not locate texture: RolloveButtons/data/images/ExitButton.png_h
#6
08/30/2006 (4:01 pm)
I believe in the example above, your naming scheme would be: ExitButton_h.png not ExitButton.png_h
#7
09/01/2006 (1:54 pm)
I name it ExitButton_h i think there is abug in t2d
#8
09/02/2006 (3:23 am)
I think I know what your problem may be. When you use the GuiBitmapButtonCtrl you should not specify the extension in the file (i.e .png) for example:

This will work
bitmap = "~/data/images/mb1";

This will not work
bitmap = "~/data/images/mb1.png"; //the main button will show but not the other button


You have to go into the gui file and remove the .png extension and it should work.
#9
09/12/2006 (3:46 am)
Thanks alot its work