Game Development Community

2D HUD SceneGraph

by Ben Hamlett · in Torque Game Builder · 07/18/2012 (6:11 pm) · 5 replies

Hey there I have made a hud using this Tutorial http://www.garagegames.com/community/blog/view/21753/2 (2D Tuesdays Fancy HUD) and my game also uses the "Face Mouse" behaviour.

The issue is once I add
new t2dSceneWindow(hudWindow)
{
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiContentProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "1024 768";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
lockMouse = "0";
useWindowMouseEvents = "0";
useObjectMouseEvents = "0";
};

to my mainscreen.gui , Face Mouse behaviour no longer works. This is a gamebreaker for me and would like some advice if possible :) thanks.

#1
07/18/2012 (7:18 pm)
I seem to remember that this is because the default modality is set to true. Your new scene window is taking all of the mouse events. As a start, try adding a new profile like this
if(!isObject(GuiModelessContentProfile)) new GuiControlProfile (GuiModelessContentProfile)
{
   modal = false;
   opaque = true;
   fillColor = "255 255 255";
};
to your profiles.cs file, set it as your 'Profile' for the hudWindow and see if that fixes your problem. If not, let me know and I'll direct you to a more complicated change.
#2
07/18/2012 (11:26 pm)
http://tg017.pua-blogs.de/
http://thediary.org/tg017/
http://tg017t.comblang.in/
http://masteryhub.com/archives/3488
#3
07/19/2012 (12:57 am)
well i made the new profile and this is the set the hudWindow profile to it but still no luck :(
#4
07/19/2012 (1:02 am)
scratch that, it does work but for some reason had to reload the game. You are a life saver and I think this should be somewhere in the docs for others to see! :) cheers mate.
#5
07/19/2012 (9:07 am)
Cool! I'm glad to hear it worked.