Exemple #1
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this)
                           {
                               IsFullScreen = false,
                               PreferredBackBufferHeight = 768,
                               PreferredBackBufferWidth = 1024
                           };
            Content.RootDirectory = "Content";
            eggGameState = EggGameState.Game;

            newGameButton = CreateButtonSprite(Resources.NewGame, new Vector2(50, 710));
            pauseButton = CreateButtonSprite(Resources.Pause, new Vector2(346, 710));
            continueButton = CreateButtonSprite(Resources.Continue, new Vector2(346, 710));
            continueButton.Visible = false;
            exitButton = CreateButtonSprite(Resources.Exit, new Vector2(800, 710));
        }
Exemple #2
0
 private Button CreateButtonSprite(string text, Vector2 position)
 {
     var button = new Button(this, text, position);
     Components.Add(button);
     return button;
 }