]> git.r.bdr.sh - rbdr/super-polarity/blame - SuperPolarityMac/TitleScreen.cs
Works in win, compiles in mac
[rbdr/super-polarity] / SuperPolarityMac / TitleScreen.cs
CommitLineData
74c15570
BB
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
b587e9d8
BB
5using Microsoft.Xna.Framework;
6using Microsoft.Xna.Framework.Graphics;
74c15570
BB
7
8namespace SuperPolarity
9{
10 class TitleScreen : Screen
11 {
b587e9d8
BB
12 protected Texture2D TitleImage;
13
74c15570 14 public TitleScreen(SuperPolarity newGame) : base(newGame) {}
b587e9d8
BB
15
16 public override void LoadContent()
17 {
18 base.LoadContent();
19 TitleImage = Game.Content.Load<Texture2D>("Graphics\\polaritydemotitle");
20 InputController.Bind("pause", HandleStart);
21 }
22
23 public void HandleStart(float value)
24 {
25 if (!Active) { return; }
26 Game.Player.Reset();
27 var gameScreen = new GameScreen(Game);
28 gameScreen.Initialize();
29 ScreenManager.Push(gameScreen);
30 }
31
32 public override void CleanUp()
33 {
34 base.CleanUp();
35 TitleImage = null;
36 }
37
38 public override void Draw(SpriteBatch spriteBatch)
39 {
40 base.Draw(spriteBatch);
41 spriteBatch.Draw(TitleImage, new Vector2(0, 0), Color.White);
42 }
43
44 public override void Update(GameTime gameTime)
45 {
46 base.Update(gameTime);
47 InputController.UpdateInput(false);
48 }
74c15570
BB
49 }
50}