/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } spriteBatch = new SpriteBatch(ScreenManager.GraphicsDevice); lineBatch = new LineBatch(ScreenManager.GraphicsDevice); spriteFont = content.Load <SpriteFont>("Fonts/retroSmall"); starTexture = content.Load <Texture2D>("Textures/blank"); // update the projection in the line-batch lineBatch.SetProjection(Matrix.CreateOrthographicOffCenter(0.0f, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height, 0.0f, 0.0f, 1.0f)); #if ANDROID || IOS gamePadTexture = content.Load <Texture2D>("Textures/gamepad"); ThumbStickDefinition thumbStickLeft = new ThumbStickDefinition(); thumbStickLeft.Position = new Vector2(10, 400); thumbStickLeft.Texture = gamePadTexture; thumbStickLeft.TextureRect = new Rectangle(2, 2, 68, 68); GamePad.LeftThumbStickDefinition = thumbStickLeft; ThumbStickDefinition thumbStickRight = new ThumbStickDefinition(); thumbStickRight.Position = new Vector2(240, 400); thumbStickRight.Texture = gamePadTexture; thumbStickRight.TextureRect = new Rectangle(2, 2, 68, 68); GamePad.RightThumbStickDefinition = thumbStickRight; #endif }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } spriteBatch = new SpriteBatch(ScreenManager.GraphicsDevice); lineBatch = new LineBatch(ScreenManager.GraphicsDevice); spriteFont = content.Load <SpriteFont>("Fonts/retroSmall"); starTexture = content.Load <Texture2D>("Textures/blank"); // update the projection in the line-batch lineBatch.SetProjection(Matrix.CreateOrthographicOffCenter(0.0f, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height, 0.0f, 0.0f, 1.0f)); }
/// <summary> /// Loads graphics content for this screen. The background texture is quite /// big, so we use our own local ContentManager to load it. This allows us /// to unload before going from the menus into the game itself, wheras if we /// used the shared ContentManager provided by the ScreenManager, the content /// would remain loaded forever. /// </summary> public override void LoadContent() { lineBatch = new LineBatch(ScreenManager.GraphicsDevice); titleTexture = ScreenManager.Game.Content.Load<Texture2D>("Textures/title"); int viewportWidth = ScreenManager.GraphicsDevice.Viewport.Width; int viewportHeight = ScreenManager.GraphicsDevice.Viewport.Height; // update the projection in the line-batch lineBatch.SetProjection(Matrix.CreateOrthographicOffCenter(0.0f, viewportWidth, viewportHeight, 0.0f, 0.0f, 1.0f)); // recreate the particle systems particleSystems.Clear(); for (int i = 0; i < 4; i++) { particleSystems.Add(new ParticleSystem( new Vector2(random.Next(viewportWidth), random.Next(viewportHeight)), Vector2.Zero, 64, 256, 128, 1f + 2f * (float)random.NextDouble(), 0.05f, explosionColors)); } base.LoadContent(); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } spriteBatch = new SpriteBatch(ScreenManager.GraphicsDevice); lineBatch = new LineBatch(ScreenManager.GraphicsDevice); spriteFont = content.Load<SpriteFont>("Fonts/retroSmall"); starTexture = content.Load<Texture2D>("Textures/blank"); // update the projection in the line-batch lineBatch.SetProjection(Matrix.CreateOrthographicOffCenter(0.0f, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height, 0.0f, 0.0f, 1.0f)); #if ANDROID || IOS gamePadTexture = content.Load<Texture2D>("Textures/gamepad"); ThumbStickDefinition thumbStickLeft = new ThumbStickDefinition(); thumbStickLeft.Position = new Vector2(10,400); thumbStickLeft.Texture = gamePadTexture; thumbStickLeft.TextureRect = new Rectangle(2,2,68,68); GamePad.LeftThumbStickDefinition = thumbStickLeft; ThumbStickDefinition thumbStickRight = new ThumbStickDefinition(); thumbStickRight.Position = new Vector2(240,400); thumbStickRight.Texture = gamePadTexture; thumbStickRight.TextureRect = new Rectangle(2,2,68,68); GamePad.RightThumbStickDefinition = thumbStickRight; #endif }
/// <summary> /// Loads graphics content for this screen. The background texture is quite /// big, so we use our own local ContentManager to load it. This allows us /// to unload before going from the menus into the game itself, wheras if we /// used the shared ContentManager provided by the ScreenManager, the content /// would remain loaded forever. /// </summary> public override void LoadContent() { lineBatch = new LineBatch(ScreenManager.GraphicsDevice); titleTexture = ScreenManager.Game.Content.Load<Texture2D>("Textures/title"); int viewportWidth = ScreenManager.GraphicsDevice.Viewport.Width; int viewportHeight = ScreenManager.GraphicsDevice.Viewport.Height; // update the projection in the line-batch lineBatch.SetProjection(Matrix.CreateOrthographicOffCenter(0.0f, viewportWidth, viewportHeight, 0.0f, 0.0f, 1.0f)); // recreate the particle systems particleSystems.Clear(); for (int i = 0; i < 4; i++) { particleSystems.Add(new ParticleSystem( new Vector2(random.Next(viewportWidth), random.Next(viewportHeight)), Vector2.Zero, 64, 256, 128, 1f + 2f * (float)random.NextDouble(), 0.05f, explosionColors)); } base.LoadContent(); }