コード例 #1
0
        public GameMenuInterface()
        {
            var position = new Vector2f(Initializer.WindowWidth / 2 - 120 / 2, Initializer.WindowHeight / 2 - 60 / 2);
            var size     = new Vector2f(120, 60);

            menuButton          = new RectangularSpriteButton(position, size, ResourceLoader.ButtonPlaySprites);
            menuButton.Clicked += TransitionToScene;
        }
コード例 #2
0
        public GameOverInterface()
        {
            overText = new Text("Game Over", ResourceLoader.Font, sizeText)
            {
                Position = new Vector2f(Initializer.WindowWidth / 2 - sizeText * 2.8f, Initializer.WindowHeight / 2 - sizeText * 2)
            };
            scoreText = new Text("Your score: " + WorldLogic.Score.ToString(), ResourceLoader.Font, sizeText)
            {
                Position = new Vector2f(overText.Position.X - sizeText * 1.5f, overText.Position.Y + sizeText * 1.5f),
                Color    = new Color(254, 216, 1)
            };

            var position = new Vector2f(Initializer.WindowWidth / 2 - 60 / 2, scoreText.Position.Y + 60 / 2 + sizeText * 1.5f);
            var size     = new Vector2f(60, 60);

            buttonOk          = new RectangularSpriteButton(position, size, ResourceLoader.ButtonOkSprites);
            buttonOk.Clicked += TransitionToScene;
        }
コード例 #3
0
 public override void DeleteNestedObjects()
 {
     buttonOk.Clicked -= TransitionToScene;
     buttonOk.DeleteNestedObjects();
     buttonOk = null;
 }
コード例 #4
0
 public override void DeleteNestedObjects()
 {
     menuButton.Clicked -= TransitionToScene;
     menuButton.DeleteNestedObjects();
     menuButton = null;
 }