Moving the Chathud
by Willbkool · in Torque Game Engine Advanced · 06/06/2011 (7:23 pm) · 6 replies
Ok, I know that this is probably simple, and I did it before in TGE, but I'm having a tough time moving the chathud to the bottom of the screen. I think that I originally did it all in script, but I don't remember how I did it and a search turned up nothing. I've tried using the gui editor, but that either crashes the engine or brings up a pink screen. I hope that someone can point me in the right direction on this.
#2
If you manually edit the position the chatHud gui code is located after the messageHud inside of chatHud.gui.
Be aware that you *may* have to change the coding for the sizing of the hud. I think by default it only handles sizing downwards when you increase the size of the hud display.
06/09/2011 (9:31 am)
In TGEa 1.8.2 open the mainChatHudGui.gui with the GuiEditor, select the GuiControl container just under the MainChatHud, and move as desired. Save. Restart, and the chatHud is where it was moved to.If you manually edit the position the chatHud gui code is located after the messageHud inside of chatHud.gui.
Be aware that you *may* have to change the coding for the sizing of the hud. I think by default it only handles sizing downwards when you increase the size of the hud display.
#3
06/09/2011 (9:34 am)
I just tested moving the chatHud to bottom of the screen and it automatically offsets itself for the full extent (max size) of the hud display, even if you're using a smaller size. So yeah, will have to adjust some code to overcome that.
#4
While working out the horizontal centering, after touching the guis with the gui editor, things would get irrevocably messed up and I'd have to revert the files.
chatHud.gui contains two "new guiControl" definitions--one for messageHud and one for MainChatHud. So I created two new files, with one control each and their own --OBJECT WRITE BEGIN-- and END tags (and exec'ed them, replacing the original chatHud.gui exec).
The GUI editor would chew the original file to bits for some reason. It may have been the position of the --OBJECT WRITE BEGIN-- in the middle of the file instead of the start, but it was ruined over and over and until I found it, caused me no end of pain.
Then, in the script game/scripts/client/chatHud.cs where retrieving the position of OuterChatHud is performed, what finally got alignment working was to first edit the ChatHud.gui file, and naming the unnamed GuiControl which contains OuterChatHud "AlignOuterChatHud", and using that object to get the correct horizontal position. Never could get OuterChatHud's position as the script calls for.
YMMV, you are in a different engine, but I had been stabbing at this forever (you are probably a better coder!).
06/09/2011 (7:14 pm)
I'm in T3D, but since you brought the subject to mind--and Torque script files don't change very much--one real problem I had with this was the file game/art/gui/chatHud.gui.While working out the horizontal centering, after touching the guis with the gui editor, things would get irrevocably messed up and I'd have to revert the files.
chatHud.gui contains two "new guiControl" definitions--one for messageHud and one for MainChatHud. So I created two new files, with one control each and their own --OBJECT WRITE BEGIN-- and END tags (and exec'ed them, replacing the original chatHud.gui exec).
The GUI editor would chew the original file to bits for some reason. It may have been the position of the --OBJECT WRITE BEGIN-- in the middle of the file instead of the start, but it was ruined over and over and until I found it, caused me no end of pain.
Then, in the script game/scripts/client/chatHud.cs where retrieving the position of OuterChatHud is performed, what finally got alignment working was to first edit the ChatHud.gui file, and naming the unnamed GuiControl which contains OuterChatHud "AlignOuterChatHud", and using that object to get the correct horizontal position. Never could get OuterChatHud's position as the script calls for.
YMMV, you are in a different engine, but I had been stabbing at this forever (you are probably a better coder!).
#5
I might just upgrade to T3D, but then I have to start converting resources again. lol
06/09/2011 (8:45 pm)
Thanks for the replies gentlemen, gives me something to work on this weekend. I have done it before, like 4 or 5 years ago, and I remember what Robert said is true. I have several things to move.I might just upgrade to T3D, but then I have to start converting resources again. lol
#6
Totally freedom to move my messageHud anywhere on the screen now! :o)
Now my GUI is nearing the perfect design.
We who sit in our mountains(basements/Garages/offices etc.) salute you @Netwyrm
05/27/2014 (7:39 pm)
Yiii Haaaaaaaaaaaaaa!!!!!!!!!!!Totally freedom to move my messageHud anywhere on the screen now! :o)
Now my GUI is nearing the perfect design.
We who sit in our mountains(basements/Garages/offices etc.) salute you @Netwyrm
Torque Owner Robert Fritzen
Phantom Games Development
I do believe it's messageHud.gui or something like that you should be making edits to. As for the crash/pink screen, I'm not sure.