TGB Window Focus
by Gellyware · in Torque Game Builder · 01/27/2008 (1:49 am) · 7 replies
What is the current best way with v 1.6 to determine if the window has lost or regained focus?
I found some source on the forums to add support but that source doesn't apply anymore it seems.
Any suggestions?
I found some source on the forums to add support but that source doesn't apply anymore it seems.
Any suggestions?
About the author
#2
01/28/2008 (9:17 pm)
I would like to know this as well!
#3
http://www.garagegames.com/mg/forums/result.thread.php?qt=35040
To pause the scene action you can use this:
yourGameWindow.getScenegraph().SetScenePause(true);
Pausing streaming music requires another patch, sorry I don't have the link handy.
01/28/2008 (9:43 pm)
GG solution to this, posted a while back but still works. http://www.garagegames.com/mg/forums/result.thread.php?qt=35040
To pause the scene action you can use this:
yourGameWindow.getScenegraph().SetScenePause(true);
Pausing streaming music requires another patch, sorry I don't have the link handy.
#4
01/31/2008 (2:54 pm)
That solution is now in the engine, it's a callback, here's an examplefunction onWindowFocusChange(%status)
{
error("on window focus change" SPC %status);
}
#5
01/31/2008 (6:12 pm)
You guys are awesome! Thanks GG team!
#6
01/31/2008 (6:47 pm)
Agreed, Thanks Matthew.
#7
01/31/2008 (9:12 pm)
Looks like this new feature didn't make it into the mac platform code. If you've got a Pro license and need this on Macs, open up macCarbEvents.cc and addif (Con::isFunction("onWindowFocusChange"))
Con::executef( 2, "onWindowFocusChange", activating ? "1" : "0" );to the end of _OnActivate (line 156).
Torque Owner Gellyware
GG Team?
I'm developing a casual game and need to pause the screen when the window has lost focus.
How can I go about doing this? Will it require source change? If so, what and where?