Adding Deactivate event for when the screen leaves focus

Added flag to enable/disable moving camera with gamepad
This commit is contained in:
Nathan Adams
2015-01-04 16:40:19 -06:00
parent d924498cb6
commit e23503cd00
3 changed files with 7 additions and 3 deletions

View File

@@ -330,9 +330,10 @@ namespace Axios.Engine
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
{
if (otherScreenHasFocus)
if (otherScreenHasFocus && !screenHidden)
{
screenHidden = true;
this.Deactivate();
}
if (screenHidden && !otherScreenHasFocus)
@@ -508,7 +509,6 @@ namespace Axios.Engine
{
//this.IsExiting = true;
//System.Diagnostics.Debugger.Break();
base.Deactivate();
ScreenState = GameStateManagement.ScreenState.TransitionOff;
AxiosLog.Instance.AddLine("Memory usage before cleanup: " + GC.GetTotalMemory(true).ToString(), LoggingFlag.DEBUG);
foreach (AxiosGameObject g in _gameObjects)
@@ -538,6 +538,7 @@ namespace Axios.Engine
}
#endif
}