Game Development Community

Chathud Gui

by David Byrge · in Torque Game Engine · 08/25/2006 (1:39 pm) · 13 replies

We have created a bitmapctrl to hold the health, ammo count, and grenade count. We want the chathud to be displayed below this ctrl minus the stock frame that is currently around the chathud. Everytime we mess with the chathud image the .exe crashes. Does anyone have a clue/resource on how to mange/change the chathud?

#1
08/25/2006 (1:41 pm)
ChatHud uses a bitmap border array. These are real buggers to do properly.
Basically the 0,0 coordinate is the seperator color. If the engine cannot find the seperator color or every segment it's looking for it will crash.
#2
08/25/2006 (1:49 pm)
That kind of puts you in a box and limits functionality! So to me the obvious would be to change what the engine is looking for in the seperator color and every segement? Would you recommend following the chathud resource in the TDN?
#3
08/25/2006 (1:57 pm)
Theres no reason you need to add your counters to the chathud, keep them as seperate controls. You say you wish to remove the hud border, so you don't need to worry about altering the bitmap array at all. Just turn off the border in your chathud profile. Edit the chathudgui, placing the window just below where your counter controls will be. It will take a few trial errors to get it to line up properly, but if you keep both playgui and chathudgui at the same resolution, and make both sets of controls 'relative' in their positioning, you should be able to achieve the result you want, and valid at any resolution the client wants.
#4
08/25/2006 (1:59 pm)
Send me your bitmap and I will correct it for you and explain what I did. I've mastered these guys.

dave@brooklawnstudios.com
#5
08/25/2006 (2:03 pm)
It's not that we have the counters added to the chathud. To the user it looks like a control panel containing the info with the chat. They are all seperate though. I will try to disable the border and see if that works.

Side note: There are only three (that I can see) syles of fonts and I can't seem to find UFT fonts anywhere. Do you all know where to get these fonts? All of the fonts I have downloaded are TTF and I really wish that I could use them in the chat hud as well as the other txtctrls.
#6
08/25/2006 (2:31 pm)
Http://www.garagegames.com/mg/forums/result.thread.php?qt=45920

Has a pretty good discussion about .uft and font caches. The .uft is not a font, it's a TGE-created cache of the used fonts/sizes defined in your gui profiles.
#7
08/25/2006 (3:04 pm)
You need TGB in order to view that forum. But your other info was well received. Thank you.
#8
08/25/2006 (5:00 pm)
Install any fancy fonts you wish, as normal, into /windows/fonts. Set a profile with that font, run your game. Torque will auto-generate .uft files. If you're using standard fonts (arial, etc), then don't bother packaging up these .ufts, your players will make their own. If you're using custom fonts you've installed and generated, as above, then you will need to include those .uft's in your distro. Then your players will see them properly, even without having those fonts installed themselves.
#9
08/25/2006 (5:10 pm)
Thanks a lot erik. That was the info on the fonts I was looking for. I sent you an e-mail Dave Young.
#10
08/28/2006 (9:23 pm)
Hey Dave Young!!!! Hows about a reply to the e-mail so I know that you got it? Thanks.
#11
08/29/2006 (12:33 pm)
Dave-

The main problem from looking at your images is that the chat gui should be a bitmaparray. This allows it to resize as a border. If you do not want to use it as a bitmap border and dont need the chat hud to resize, you must delete the guibitmapborder control form chathud. This is the real reason for the engine crash, as its trying to make a bitmap array out of the png, and it fails the requirements for a bitmap array.
#12
08/30/2006 (9:34 pm)
Let me just clarify. All I need to do is "delete" the guibitmapborder control from the chathud. Then, all I have to do is "add" a bitmap control containing the background for the new chat hud (png) and then have the text scroll over top of the new bitmap control? This will allow me to resize and position without crashing?
#13
09/01/2006 (3:36 am)
It will stretch if you resize of course, but yes you can do that.