How does GuiShapeNameHud work?
by weihua · in Torque 3D Professional · 05/12/2010 (2:50 am) · 4 replies
I searched all the scripts files.
There is only one place to find GuiShapeNameHud. That is in the file: playgui.gui, where it is newed with no name.
Who can tell me where and how does the torque system use GuiShapeNameHud?
Thanks !
There is only one place to find GuiShapeNameHud. That is in the file: playgui.gui, where it is newed with no name.
Who can tell me where and how does the torque system use GuiShapeNameHud?
Thanks !
About the author
TD of Beijing Pixel Software Technology Joint-Stock Co., Ltd.
#2
Thank you JANR. I looked into the c code. Now I roughly understand its tricks. GuiShapeNameHud in c code works as a filter, it processes all net objects and prints those with a name. Is that right?
05/12/2010 (5:19 pm)
I am just trying to implement team. I found some former resouce involving GuiShapeNameHud. So I just wonder how the object newed in script is affecting the game appearence.Thank you JANR. I looked into the c code. Now I roughly understand its tricks. GuiShapeNameHud in c code works as a filter, it processes all net objects and prints those with a name. Is that right?
#3
Aside from the new render calls for T3D, the GUI element's behavior probably hasn't changed much since TGE. Any resource you find will likely work, but it'll need any rendering code it implements updated for the new system. Just look at how it's done now vs. whatever the old resource did.
05/17/2010 (1:52 pm)
Essentially. In onRender it cycles every (well, every ShapeBaseObjectType) object in the client scene, then checks to see whether the object is within visible range and your viewcone and attempts a line of sight raycast to make sure it isn't obscured by something. It then projects the object's world coordinates to local screen space. If all of this checks out, it goes ahead and calls drawName which is another function in the class which actually does the rendering of the name (take a look at the GFX-> calls).Aside from the new render calls for T3D, the GUI element's behavior probably hasn't changed much since TGE. Any resource you find will likely work, but it'll need any rendering code it implements updated for the new system. Just look at how it's done now vs. whatever the old resource did.
#4
05/17/2010 (5:40 pm)
Thank you Henry. You made it clearer to me :)
Torque 3D Owner JANR
GuiShapeNameHud is a GUI panel that is created on top of everything else on the screen.
It's function is to draw the names and health bar of players on screen.
All functionality is implemented in the c code.
I think you can do some small changes with script like what color it uses and such.
hope that helps