Game Development Community

Gui Questions

by Bryan "Over_burN" Lovely · in Torque Game Engine · 01/05/2003 (2:56 pm) · 7 replies

Hey all ...another gui question here.

I been diving into the gui editor and its coming along great but i got so much GUI on my brains its all starting to look the same.

My main question is What GUI options are used to create custom GUIs..basicly Eye candy is what im looking for. Custom buttons and backgrounds. I just want something other then the default windows look. For instance the default buttons look windows like..are they just a bitmap that i could change?

I know its probably a combination of alot of things and i know there are resources for GUI but there are alot of them and i was wondering what gui option would allow me to use custom pictures and buttons, if there is a resourse for this can someone light the way.

Also im trying to rename the "Quit mission" gui when you hit ESC ingame(i want it to have option and other info other then quit game). I type the name "Options" under the text field and click apply and it changes it then save it, but when i load a mission and hit ESC it still says "Quit Mission" What am i missing. I have added buttons to the quit mission gui and they have saved and work great ingame. But i cant rename the window....GUI woes for sure.

Anyway enough babling..thx for any Help.

Over_burN

#1
01/05/2003 (4:15 pm)
Not sure about your first question, but the second might be caused by the .gui file being read only.
#2
01/05/2003 (4:30 pm)
Unfortunatly its not that as i have unchecked read only for all files and folders and i have added gui buttons to the "Quit mission" gui and they work in game like a charm...i just cant make the window say "options" instead of "Quit mission". But thx for trying :O) Im still plugging away at it though.

Does GuitextProfile grab text from somewhere other then the text field?

EDIT: yes it does call to another file for text...found it and now instead of a mission exit gui i have a options gui that pops up..huray :OP
#3
01/06/2003 (2:45 am)
About your first question: the bitmaps of the gui are stored in ...\example\common\ui\. In that directory there are some .pngs that hold the image data for the gui in a bitmap array. In the same directory theres is a script file called defaultProfiles.cs that constructs the various ui-profiles (some more in ...\example\client\ui\defaultGameProfiles.cs). In here you can change the image files to use.

There is also a resource about ui-themes that can be changed on the fly:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2810

I hope that helps a bit,

Stefan.
#4
01/06/2003 (5:09 am)
Stefan thx
I stumbled on some of this solving my gui window rename problem. I also found a gui object that allows for bitmaps to be displayed onscreen...probably the same thing your talking about. Im getting it slowly but surly. Everything is named so similar that i end up having GUI brains trying to separate them all.

EDIT: Ok just so i know, hear comes a dumb question...a bitmap is an image....but what is a bitmap array...is it something other then an image or just a fancy way of saying bitmap image :OP.

Burn
#5
01/06/2003 (5:50 am)
A bitmap array is basicaly a number of (sub-)images in one image/one image file, separated by a special color. The engine (at least some of the GuiControls) takes this image and separates the elements from each other. It then uses them to draw a window,... Take a look at e.g. "darkWindow.png" in the ...\example\common\ui-folder. So basically a bitmap- or image-array (which is the same, however I prefer image-array, since "bitmap" may be confused with the fileformat, which isn't meant here) is a collection of small images in one image file, so they are kept together and can be adressed together. Changes in those files will show in the GuiControls that use them.

Stefan.
#6
01/06/2003 (6:41 am)
AHH Yes i have seen that bitmap before it has the window boarder broken up in peices like a jigsaw puzzle. How does it know what peice to put where or do we do the placing of the peices in the gui editor?

Which brings up another question. You mentioned that they were separated by a special color. Can it be any color or does it have to be a specific color.

Sorry for all the questions but there is liitle Documentation on the gui editor.

thx for your help
#7
01/06/2003 (2:53 pm)
The GuiControl that is using the image/bitmap-array expects the elements to be at a special position. This is managed by the specific GuiControl-class, e.g. the GuiWindowCtrl-class knows where the sub-image for the close or minimize (...) button is located, or at least is supposed to be. When the window is drawn, it uses those sub-images how it needs it. Some of them are beeing stretched in the process, I think this is the case for the title bar of a GuiWindowCtrl.

The separating color is the color of the pixel in the upper left corner of the image (at position 0,0). Obviously this should be a color that is not used in the sub-images.

So, to sum up, you can't really choose how the sub-images are used unless you make some changes in the code, however, you can change the basic appearance.

I hope that helped,

Stefan.