Game Development Community

GuiBitmapButtonCtrl

by Jacob · in Game Design and Creative Issues · 01/18/2005 (6:48 pm) · 6 replies

Here is another one...:)

I am trying to use a bitmap as my button and it works fine as long as I point to a bitmap in my game/client/ui dir. For organizational reasons, I put the bitmap I want to use in "game/gui" and pointing to it there, doesn't work anymore. This path limitation seems to only occur with GuiBitmapButtonCtrl for I have successfully used bitmaps from my "game/gui" in a GuiBitmapCtrl...I noticed that the GuiBitmapButtonCtrl is defined in code - what can I do to have it recognize my other directories?

#1
01/18/2005 (7:06 pm)
I just love answering my own questions these days :)

....I didn't use filename_n etc... now it works.
#2
02/09/2005 (4:15 pm)
Actually I can't get a bitmap to work on a button, period. I've got a bitmap called "winbutton.bmp" that I want to use. I added a GuiBitmapButtonCtrl to the UI, put my bitmap into game/client/ui an then in the Bitmap: field of the inspector, I've tried: winbutton, winbutton.bmp, ./winbutton.bmp, winbutton_n, and none of them work. I click apply and my button is still the same old boring brown default button. How do I make this work?
#3
02/09/2005 (4:32 pm)
Ok a follow-up.

I created 4 .png files:

blue_n.png
blue_d.png
blue_i.png
blue_h.png

I put them all into starter.fps/client/ui and then set the "bitmap" field to "blue" in the GUI editor. I set the extents to be the size of the pngs, and then hit apply. Nothing. Brown button. I tried saving the UI and re-starting it, still just getting the brown button. How the heck does this work?
#4
02/09/2005 (4:44 pm)
There are three ways you can reference files from scripts.
If you put "./blue" in the bitmap field, the engine will look for blue in the same directory as the .gui file. If you put "starter.fps/client/ui/blue" in the bitmap field, the engine will look for blue in starter.fps/client/ui. If you put "~/client/ui/blue" in the bitmap field, the engine will look for blue in [.gui file's mod directory]/client/ui.

Since I don't know where your .gui file is, the only one of these I can guarantee will work is "starter.fps/client/ui/blue"
#5
03/04/2005 (5:12 am)
1. Make sure your have 4 pngs with appropriate extensions (_n, _d, _h, _i)
2. Make sure your *.png is exported "interlaced".
3. Put them in a folder (guiImages)in the same direcrtory as the ui files (starter.fps/client/ui/guiImages/)
4. Open Torque, make button and use Adam's guaranteed pathfinder (starter.fps/client/ui/guiImages/) to the png file minus extention(*_n.png)

I put my images in a folder called to keep them all together. Easy to find and edit.

I got my working last night with transparency and everything - Woo Hoo!

")
#6
04/08/2006 (11:08 am)
I too have been struggling with this (though, admittedly, it was only on about my fifth read through this thread that I realised I had to delete all of _n.png, not just the _n bit!)

I've managed to get my background displaying on the button at last, but it is not what I was expecting - rather than being placed behind the writing, it is in front of it - the text cannot be seen. I do not have transparency in these buttons, but then I did not think I would need to in this case - is this the problem?

I have tried quite a few different profiles, but none seem to place the text over the image.

(Okay, I also tried GuiBitmapButtonTextCtrl, which seems to just be invisible... could it be that I have to add one of these over each button? Surely not...)

Above all, if there is any actual documentation - e.g. a list of what each type of ctrl is capable of - then I'd really appreciate it if somebody could point me in the right direction. I mean no offence, but the tutorials I have seen so far do not exactly teach me much... More 'copy this file, copy this text, you're done!'

Such documentation wouldn't happen to be in the source code itself, would it?