diff --git a/axios/Engine/AxiosEvents.cs b/axios/Engine/AxiosEvents.cs index 3d3fd30..57b045b 100644 --- a/axios/Engine/AxiosEvents.cs +++ b/axios/Engine/AxiosEvents.cs @@ -69,7 +69,7 @@ namespace Axios.Engine this.ScaleChanged(gameObject); } - private void OnEvent(AxiosHandler e, AxiosGameScreen gameScreen, InputHelper input) + private void OnEvent(AxiosHandler e, AxiosGameScreen gameScreen, InputState input) { AxiosHandler handle = e; if (handle != null) diff --git a/axios/Engine/AxiosGameScreen.cs b/axios/Engine/AxiosGameScreen.cs index 835976f..9077fad 100644 --- a/axios/Engine/AxiosGameScreen.cs +++ b/axios/Engine/AxiosGameScreen.cs @@ -334,7 +334,7 @@ namespace Axios.Engine } } - public override void HandleInput(InputState input, GameTime gameTime) + public override void HandleInput(GameTime gameTime, InputState input) { base.HandleInput(input, gameTime); @@ -345,7 +345,7 @@ namespace Axios.Engine g.HandleInput(this, input, gameTime); } - public override void UnloadContent() + public override void Deactivate() { base.UnloadContent(); //AxiosLog.Instance.AddLine("Memory usage before cleanup: " + GC.GetTotalMemory(true).ToString(), LoggingFlag.DEBUG); diff --git a/axios/ScreenSystem/GameScreen.cs b/axios/ScreenSystem/GameScreen.cs index 5319df2..783e7c7 100644 --- a/axios/ScreenSystem/GameScreen.cs +++ b/axios/ScreenSystem/GameScreen.cs @@ -35,6 +35,7 @@ namespace GameStateManagement /// public abstract class GameScreen { + protected bool HasCursor = false; /// /// Normally when one screen is brought up over the top of another, /// the first screen will transition off to make room for the new diff --git a/axios/ScreenSystem/InputHelper.cs b/axios/ScreenSystem/InputHelper.cs index 0703add..8a69843 100644 --- a/axios/ScreenSystem/InputHelper.cs +++ b/axios/ScreenSystem/InputHelper.cs @@ -146,6 +146,7 @@ namespace FarseerPhysics.SamplesFramework public void LoadContent() { + _cursorSprite = new Sprite(_manager.Content.Load("Common/cursor")); #if WINDOWS_PHONE // virtual stick content diff --git a/axios/ScreenSystem/LogoScreen.cs b/axios/ScreenSystem/LogoScreen.cs index 27b1ed6..89c15cd 100644 --- a/axios/ScreenSystem/LogoScreen.cs +++ b/axios/ScreenSystem/LogoScreen.cs @@ -62,8 +62,8 @@ namespace GameStateManagement public override void HandleInput(GameTime gameTime, InputState input) { //input. - if (input.KeyboardState.GetPressedKeys().Length > 0 || - input.GamePadState.IsButtonDown(Buttons.A | Buttons.Start | Buttons.Back) || + if (input.CurrentKeyboardStates[0].GetPressedKeys().Length > 0 || + input.CurrentGamePadStates[0].IsButtonDown(Buttons.A | Buttons.Start | Buttons.Back) || input.MouseState.LeftButton == ButtonState.Pressed) { _duration = TimeSpan.Zero; diff --git a/axios/ScreenSystem/MainMenuScreen.cs b/axios/ScreenSystem/MainMenuScreen.cs index 7a60d8e..2bd1d23 100644 --- a/axios/ScreenSystem/MainMenuScreen.cs +++ b/axios/ScreenSystem/MainMenuScreen.cs @@ -9,6 +9,7 @@ #region Using Statements using Microsoft.Xna.Framework; +using GameStateManagementSample; #endregion namespace GameStateManagement diff --git a/axios/ScreenSystem/PhoneMainMenuScreen.cs b/axios/ScreenSystem/PhoneMainMenuScreen.cs index 3afcd8b..151f0bd 100644 --- a/axios/ScreenSystem/PhoneMainMenuScreen.cs +++ b/axios/ScreenSystem/PhoneMainMenuScreen.cs @@ -9,6 +9,7 @@ using System; using GameStateManagement; +using GameStateManagementSample; using Microsoft.Xna.Framework; namespace GameStateManagement diff --git a/axios/ScreenSystem/PhysicsGameScreen.cs b/axios/ScreenSystem/PhysicsGameScreen.cs index fafc036..7b5145c 100644 --- a/axios/ScreenSystem/PhysicsGameScreen.cs +++ b/axios/ScreenSystem/PhysicsGameScreen.cs @@ -72,12 +72,13 @@ namespace GameStateManagement { if (!Axios.Settings.ScreenSaver) { + ContentManager man = new ContentManager(this.ScreenManager.Game.Services, "Content"); DebugView = new DebugViewXNA(World); DebugView.RemoveFlags(DebugViewFlags.Shape); DebugView.RemoveFlags(DebugViewFlags.Joint); DebugView.DefaultShapeColor = Color.White; DebugView.SleepingShapeColor = Color.LightGray; - DebugView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.Content); + DebugView.LoadContent(ScreenManager.GraphicsDevice, man); } } diff --git a/axios/ScreenSystem/ScreenManager.cs b/axios/ScreenSystem/ScreenManager.cs index f7bea6f..0efc224 100644 --- a/axios/ScreenSystem/ScreenManager.cs +++ b/axios/ScreenSystem/ScreenManager.cs @@ -18,6 +18,7 @@ using Microsoft.Xna.Framework.Input.Touch; using System.IO; using System.IO.IsolatedStorage; using System.Xml.Linq; +using FarseerPhysics.SamplesFramework; #endregion namespace GameStateManagement @@ -37,7 +38,7 @@ namespace GameStateManagement List screens = new List(); List tempScreensList = new List(); - InputState input = new InputState(); + InputState input; SpriteBatch spriteBatch; SpriteFont font; @@ -47,11 +48,21 @@ namespace GameStateManagement bool traceEnabled; + /// + /// Contains all the fonts avaliable for use. + /// + private SpriteFonts _spriteFonts; + #endregion #region Properties + public SpriteFonts Fonts + { + get { return _spriteFonts; } + } + /// /// A default SpriteBatch shared by all the screens. This saves /// each screen having to bother creating their own local instance. @@ -107,6 +118,7 @@ namespace GameStateManagement // we must set EnabledGestures before we can query for them, but // we don't assume the game wants to read them. TouchPanel.EnabledGestures = GestureType.None; + this.input = new InputState(this); }