protected void LoadContent()
        {
            this.spriteBatch = new SpriteBatch(GraphicsDevice);

            Button playButton = new Button("play", Content.Load<Texture2D>("GUI/MainMenuTextures/PlayBtn"), 700, 30);
            Button howToPlayButton = new Button("howToPlay", Content.Load<Texture2D>("GUI/MainMenuTextures/HowToPlay"), 700, 200);
            Button aboutButton = new Button("about", Content.Load<Texture2D>("GUI/MainMenuTextures/AboutBtn"), 700, 350);
            Button quitButton = new Button("quit", Content.Load<Texture2D>("GUI/MainMenuTextures/Quit"), 700, 500);

            mainMenu = new MainMenu(Content.Load<Texture2D>("GUI/MainMenuTextures/grunge-texture5"));

            playButton.Click += OnClick;
            howToPlayButton.Click += OnClick;
            aboutButton.Click += OnClick;
            quitButton.Click += OnClick;

            mainMenu.Buttons.Add(playButton);
            mainMenu.Buttons.Add(howToPlayButton);
            mainMenu.Buttons.Add(aboutButton);
            mainMenu.Buttons.Add(quitButton);
        }
Пример #2
0
        protected override void Initialize()
        {
            //window settings
            this.graphics.PreferredBackBufferWidth = MainClass.WindowWidth;
            this.graphics.PreferredBackBufferHeight = MainClass.WindowHeight;

            this.Window.Title = MainClass.GameWindowTitle;

            this.Window.Position = new Point((MainClass.CurrentScreenWidth - MainClass.WindowWidth) / 2,
                (MainClass.CurrentScreenHeight - MainClass.WindowHeight) / 2);

            this.IsMouseVisible = true;

            //this.graphics.ToggleFullScreen();
            //this.Window.IsBorderless = true;

            this.LoadImages();

            this.mainMenu = new MainMenu(Content.Load<Texture2D>("GUI/MainMenuTextures/background"));

            // TODO: Add your initialization logic here

            this.getItemSound = new Sound(MainClass.GotItem);
            this.musicTheme = new Sound(MainClass.Music);
            this.killEnemy = new Sound(MainClass.KillEnemy);

            this.map = new Map();

            this.musicTheme.Play(true);

            base.Initialize();
        }