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; }
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; }
public override void DeleteNestedObjects() { buttonOk.Clicked -= TransitionToScene; buttonOk.DeleteNestedObjects(); buttonOk = null; }
public override void DeleteNestedObjects() { menuButton.Clicked -= TransitionToScene; menuButton.DeleteNestedObjects(); menuButton = null; }