diff -r 582ddc97e15166df66d64d866d3cfd593bd70ffb -r 8de1b5b4c3973676cb8974c7a1bf1495a43a5cb9 sandbox/sandbox/Game.ico Binary file sandbox/sandbox/Game.ico has changed diff -r 582ddc97e15166df66d64d866d3cfd593bd70ffb -r 8de1b5b4c3973676cb8974c7a1bf1495a43a5cb9 sandbox/sandbox/Game1.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sandbox/sandbox/Game1.cs Tue Jul 24 20:56:04 2012 -0500 @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; +using GameStateManagement; +using FarseerPhysics.SamplesFramework; +using sandbox.Menus; + +namespace sandbox +{ + /// + /// This is the main type for your game + /// + public class Game1 : Microsoft.Xna.Framework.Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + + public ScreenManager ScreenManager { get; set; } + + public Game1() + { + graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + + graphics.IsFullScreen = false; + graphics.PreferredBackBufferWidth = 1280; + graphics.PreferredBackBufferHeight = 720; + ConvertUnits.SetDisplayUnitToSimUnitRatio(Axios.Settings.DisplayUnitToSimUnitRatio); + + ScreenManager = new ScreenManager(this); + Components.Add(ScreenManager); + } + + /// + /// Allows the game to perform any initialization it needs to before starting to run. + /// This is where it can query for any required services and load any non-graphic + /// related content. Calling base.Initialize will enumerate through any components + /// and initialize them as well. + /// + protected override void Initialize() + { + // TODO: Add your initialization logic here + + base.Initialize(); + + BackgroundScreen bg = new BackgroundScreen(); + + ScreenManager.AddScreen(bg); + ScreenManager.AddScreen(new MainMenu()); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be used to draw textures. + spriteBatch = new SpriteBatch(GraphicsDevice); + + // TODO: use this.Content to load your game content here + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// all content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + protected override void Update(GameTime gameTime) + { + // Allows the game to exit + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) + this.Exit(); + + // TODO: Add your update logic here + + base.Update(gameTime); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + // TODO: Add your drawing code here + + base.Draw(gameTime); + } + } +} diff -r 582ddc97e15166df66d64d866d3cfd593bd70ffb -r 8de1b5b4c3973676cb8974c7a1bf1495a43a5cb9 sandbox/sandbox/GameThumbnail.png Binary file sandbox/sandbox/GameThumbnail.png has changed diff -r 582ddc97e15166df66d64d866d3cfd593bd70ffb -r 8de1b5b4c3973676cb8974c7a1bf1495a43a5cb9 sandbox/sandbox/Menus/MainMenu.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sandbox/sandbox/Menus/MainMenu.cs Tue Jul 24 20:56:04 2012 -0500 @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using GameStateManagement; +using sandbox.Screens; +using Microsoft.Xna.Framework; + + +namespace sandbox.Menus +{ + class MainMenu : MenuScreen + { + public MainMenu() : base("Axios Sandbox") { } + + public override void Activate(bool instancePreserved) + { + base.Activate(instancePreserved); + + MenuEntries.Add(new MenuEntry("Texture2D Factory Test")); + MenuEntries.Add(new MenuEntry("----")); + MenuEntries.Add(new MenuEntry("Exit")); + } + + protected override void OnSelectEntry(int entryIndex, PlayerIndex playerIndex) + { + base.OnSelectEntry(entryIndex, playerIndex); + + switch (entryIndex) + { + case 0: + this.ScreenManager.AddScreen(new Texture2DFactTest(), PlayerIndex.One); + break; + case 2: + this.ScreenManager.Game.Exit(); + break; + + } + } + + protected override void OnCancel(PlayerIndex playerIndex) + { + base.OnCancel(playerIndex); + + ScreenManager.Game.Exit(); + } + } +} diff -r 582ddc97e15166df66d64d866d3cfd593bd70ffb -r 8de1b5b4c3973676cb8974c7a1bf1495a43a5cb9 sandbox/sandbox/Screens/Texture2DFactTest.cs --- a/sandbox/sandbox/Screens/Texture2DFactTest.cs Mon Jul 23 22:15:13 2012 -0500 +++ b/sandbox/sandbox/Screens/Texture2DFactTest.cs Tue Jul 24 20:56:04 2012 -0500 @@ -12,7 +12,8 @@ class Texture2DFactTest : AxiosGameScreen { private Texture2D town_tile; - private Texture2D drawme; + private Texture2D drawme_1; + private Texture2D drawme_2; public override void Activate(bool instancePreserved) { base.Activate(instancePreserved); @@ -24,17 +25,22 @@ list_of_tiles.Add(town_tile); } - drawme = Texture2DFactory.CreateFromList(list_of_tiles, 80, 80); + drawme_1 = Texture2DFactory.CreateFromList(list_of_tiles, 160, 16); + drawme_2 = Texture2DFactory.CreateFromList(list_of_tiles, 80, 80); } public override void Draw(GameTime gameTime) { base.Draw(gameTime); ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View); - ScreenManager.SpriteBatch.Draw(drawme, Vector2.Zero, + ScreenManager.SpriteBatch.Draw(drawme_1, new Vector2(-30, -30), null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0f); + ScreenManager.SpriteBatch.Draw(drawme_2, Vector2.Zero, + null, + Color.White, 0, Vector2.Zero, 1f, + SpriteEffects.None, 0f); ScreenManager.SpriteBatch.End(); } }