Inheritance: MonoBehaviour
Example #1
0
        private void InitializeControls()
        {
            var buttonsX = Width / 2 - 10;

            startNewGameButton = new StandardButton(20)
            {
                Position = new Point(buttonsX, 16),
                Text     = "Start New Game"
            };
            startNewGameButton.Click += (sender, args) => StartNewGame?.Invoke(this, EventArgs.Empty);
            Add(startNewGameButton);

            backToMenuButton = new StandardButton(20)
            {
                Position = new Point(buttonsX, 20),
                Text     = "Back t0 Menu"
            };
            backToMenuButton.Click += (sender, args) => ExitToMenu?.Invoke(this, EventArgs.Empty);
            Add(backToMenuButton);

            exitGameButton = new StandardButton(20)
            {
                Position = new Point(buttonsX, 24),
                Text     = "Ex1t Game"
            };
            exitGameButton.Click += (sender, args) => Exit?.Invoke(this, EventArgs.Empty);
            Add(exitGameButton);
        }
Example #2
0
        private void InitializeControls()
        {
            var xPosition = GetLabelPosition();

            gameLabel = new GameLogoControl
            {
                Position = new Point(xPosition, 4)
            };
            Add(gameLabel);

            continueGameButton = new StandardButton(20)
            {
                Position = new Point(xPosition - 2, 9),
                Text     = "C0nt1nue Game"
            };
            continueGameButton.Click += (sender, args) => ContinueGame?.Invoke(this, EventArgs.Empty);
            Add(continueGameButton);

            startGameButton = new StandardButton(20)
            {
                Position = new Point(xPosition - 2, 13),
                Text     = "Start New Game"
            };
            startGameButton.Click += (sender, args) => StartNewGame?.Invoke(this, EventArgs.Empty);
            Add(startGameButton);

            exitToMenuButton = new StandardButton(20)
            {
                Position = new Point(xPosition - 2, 17),
                Text     = "Ex1t t0 Menu"
            };
            exitToMenuButton.Click += (sender, args) => ExitToMenu?.Invoke(this, EventArgs.Empty);
            Add(exitToMenuButton);

            exitButton = new StandardButton(20)
            {
                Position = new Point(xPosition - 2, 21),
                Text     = "Ex1t"
            };
            exitButton.Click += (sender, args) => Exit?.Invoke(this, EventArgs.Empty);
            Add(exitButton);
        }