From 4c7c9e6d6186217a7233be39293d44369d2c84c4 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 2 Aug 2012 20:59:41 -0500 Subject: [PATCH] * - Adding Factory for Texture2D to create from a list (ie lay a list of texture2D row by row) * - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One) --- axios/Axios_WP7.csproj | 1 + axios/Axios_Windows.csproj | 1 + axios/Axios_Xbox_360.csproj | 1 + axios/Axios_settings.cs | 4 ++++ axios/Engine/Extensions/Texture2D.cs | 2 +- axios/Properties/AssemblyInfo.cs | 2 +- axios/ScreenSystem/ScreenManager.cs | 21 +++++++++++++++++++++ 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/axios/Axios_WP7.csproj b/axios/Axios_WP7.csproj index 3004a0b..27fb8c7 100644 --- a/axios/Axios_WP7.csproj +++ b/axios/Axios_WP7.csproj @@ -173,6 +173,7 @@ + diff --git a/axios/Axios_Windows.csproj b/axios/Axios_Windows.csproj index f07f89f..b5972c2 100644 --- a/axios/Axios_Windows.csproj +++ b/axios/Axios_Windows.csproj @@ -216,6 +216,7 @@ + diff --git a/axios/Axios_Xbox_360.csproj b/axios/Axios_Xbox_360.csproj index d3fd9da..ad26ced 100644 --- a/axios/Axios_Xbox_360.csproj +++ b/axios/Axios_Xbox_360.csproj @@ -166,6 +166,7 @@ + diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index 6d8f906..86b7c99 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -112,6 +112,10 @@ * - Passing Layer to Items in Glee2D library * - Adding public virtual bool LoadTextureItem(TextureItem textureitem) to AxiosGameScreen * + * 1.0.1.7 - 7/22/2012 + * - Adding Factory for Texture2D to create from a list (ie lay a list of texture2D row by row) + * - Adding AddScreen method to ScreenManager to make the PlayerIndex optional (default of PlayerIndex.One) + * */ #endregion diff --git a/axios/Engine/Extensions/Texture2D.cs b/axios/Engine/Extensions/Texture2D.cs index 0979556..d3622d6 100644 --- a/axios/Engine/Extensions/Texture2D.cs +++ b/axios/Engine/Extensions/Texture2D.cs @@ -1,4 +1,4 @@ - +using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/axios/Properties/AssemblyInfo.cs b/axios/Properties/AssemblyInfo.cs index 9e4836d..bc3d36d 100644 --- a/axios/Properties/AssemblyInfo.cs +++ b/axios/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.0.1.6")] +[assembly: AssemblyVersion("1.0.1.7")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] diff --git a/axios/ScreenSystem/ScreenManager.cs b/axios/ScreenSystem/ScreenManager.cs index eb4f79d..953aedd 100644 --- a/axios/ScreenSystem/ScreenManager.cs +++ b/axios/ScreenSystem/ScreenManager.cs @@ -289,6 +289,27 @@ namespace GameStateManagement TouchPanel.EnabledGestures = screen.EnabledGestures; } + /// + /// Adds a new screen to the screen manager with a default PlayerIndex of one + /// + public void AddScreen(GameScreen screen) + { + screen.ControllingPlayer = PlayerIndex.One; + screen.ScreenManager = this; + screen.IsExiting = false; + + // If we have a graphics device, tell the screen to load content. + if (isInitialized) + { + screen.Activate(false); + } + + screens.Add(screen); + + // update the TouchPanel to respond to gestures this screen is interested in + TouchPanel.EnabledGestures = screen.EnabledGestures; + } + /// /// Removes a screen from the screen manager. You should normally