Turning off the crosshair
by Steve Montgomery · in Torque Game Engine · 04/28/2006 (3:45 pm) · 3 replies
I am working on a feature that requires the crosshair to be turned off.
I have looked through the forums and seen a few examples where it done like this:
crosshair.visible = 0;
Well, that doesn't work for me. There is no 'crosshair' GUI object explicitly declared in PlayGUI, so I am having trouble tracing the code.
Anyone have any ideas why this wouldn't work? I am trying this on the TGE 1.4 starter.fps demo.
I have looked through the forums and seen a few examples where it done like this:
crosshair.visible = 0;
Well, that doesn't work for me. There is no 'crosshair' GUI object explicitly declared in PlayGUI, so I am having trouble tracing the code.
Anyone have any ideas why this wouldn't work? I am trying this on the TGE 1.4 starter.fps demo.
About the author
#2
04/28/2006 (8:36 pm)
Yup, needs a name to work, otherwise you're telling a blank (no object with such name) to be invisible.
#3
04/29/2006 (7:43 am)
I was actually following your scope HUD example... I just didn't see where you went in and named the standard crosshair. I assumed that there was some object declared in the Engine called crosshair that you could manipulate. But I figure out that wasn't correct after I dug through all of the code. It was a newb mistake.. oh well.
Torque Owner Steve Montgomery
new GuiCrossHairHud(crosshair) { Profile = "GuiDefaultProfile"; HorizSizing = "center"; VertSizing = "center"; position = "496 368"; Extent = "32 32"; MinExtent = "8 8"; Visible = "1"; bitmap = "./crossHair"; wrap = "0"; damageFillColor = "0 1 0 1"; damageFrameColor = "1 0.6 0 1"; damageRect = "50 4"; damageOffset = "0 10"; helpTag = "0"; };