Game Development Community

Setting OnWakeDelegate

by Henry Shilling · in Torque X 2D · 01/25/2010 (5:11 pm) · 2 replies

I am trying to set the OnWakeDelegate for a GUI screen and don't seem to have any luck, in the example gui there is a function OnMainScreenWake that never gets called. Anyone know how to do this? I am not to up on how to make or deal with delegates.

#1
01/25/2010 (8:01 pm)
Hey Henry,

Are you subclassing your GUI Screens?
IE:
class MainMenu : GUISceneview, IGUIScreen
{
....
}

If you are you can add
OnGUIWake = OnScreenWake;
to the constructor and then add the
public void OnScreenWake(GUIControl mainGUI)
        {

            // perform your custom screen-activation tasks
        }

call to the class and it will get called when the screen is woken up and you can do the same for the OnGUISleep delegate too.
#2
01/25/2010 (10:04 pm)
Thanks, I actually figured it out about 15 minutes later, after 3 hours of tracing source etc, isn't that the way it goes?

I am trying to make a loading screen, press play, screen appears, loading, then when the game is loaded press A to continue. Sadly the OnWakeDelegate is not the way to go.