private void InitializeQuitButton() { this.quit = new ClickableBox( this.GameTextures.GetTexture("Quit"), new Rectangle( MemoryMatrixConstants.QuitStartingX, MemoryMatrixConstants.QuitStartingY, MemoryMatrixConstants.QuitStartingWidth, MemoryMatrixConstants.QuitStartingHeight)); this.ListOfObjects.Add(this.quit); }
private void InitializeBackButton() { this.quit = new ClickableBox( this.GameTextures.GetTexture("BackButton"), new Rectangle( HighScoreStateConstants.BackStartingX, HighScoreStateConstants.BackStartingY, HighScoreStateConstants.BackStartingWidth, HighScoreStateConstants.BackStartingHeight)); this.ListOfObjects.Add(this.quit); }
private void InitializeButtons() { this.greenButton = new ClickableBox(this.GameTextures.GetTexture("GreenButton"), new Rectangle(5, 5, 258, 258)); this.redButton = new ClickableBox(this.GameTextures.GetTexture("RedButton"), new Rectangle(5, 330, 258, 258)); this.blueButton = new ClickableBox(this.GameTextures.GetTexture("BlueButton"), new Rectangle(330, 5, 258, 258)); this.yellowButton = new ClickableBox(this.GameTextures.GetTexture("YellowButton"), new Rectangle(330, 330, 258, 258)); this.ListOfObjects.Add(this.greenButton); this.ListOfObjects.Add(this.redButton); this.ListOfObjects.Add(this.blueButton); this.ListOfObjects.Add(this.yellowButton); this.quitButton = new ClickableBox(this.GameTextures.GetTexture("Quit"), new Rectangle(600, 600, 160, 41)); this.ListOfObjects.Add(this.quitButton); }
private void InitializeObjects() { this.difficultyBox = new RegularBox( this.GameTextures.GetTexture("DifficultyBox"), new Rectangle( MenuStateConstants.DifficultyBoxStartingX, MenuStateConstants.DifficultyBoxStartingY, MenuStateConstants.DifficultyBoxWidth, MenuStateConstants.DifficultyBoxHeight)); this.ListOfObjects.Add(this.difficultyBox); this.highScoresBox = new ClickableBox( this.GameTextures.GetTexture("HighScoresBox"), new Rectangle( MenuStateConstants.HighScoreBoxStartingX, MenuStateConstants.HighScoreBoxStartingY, MenuStateConstants.HighScoreBoxWidth, MenuStateConstants.HighScoreBoxHeight)); this.ListOfObjects.Add(this.highScoresBox); this.exitBox = new ClickableBox( this.GameTextures.GetTexture("ExitBox"), new Rectangle( MenuStateConstants.ExitBoxStartingX, MenuStateConstants.ExitBoxStartingY, MenuStateConstants.ExitBoxWidth, MenuStateConstants.ExitBoxHeight)); this.ListOfObjects.Add(this.exitBox); this.selectBox = new RegularBox( this.GameTextures.GetTexture("SelectBox"), new Rectangle( MenuStateConstants.SelectBoxStartingX, MenuStateConstants.SelectBoxStartingY, MenuStateConstants.SelectBoxWidth, MenuStateConstants.SelectBoxHeight)); this.ListOfObjects.Add(this.selectBox); this.difficultyBoxEasy = new ClickableBox( this.GameTextures.GetTexture("DifficultyEasySelected"), // default difficulty will be easy new Rectangle( MenuStateConstants.DifficultySelectBoxX, MenuStateConstants.DifficultySelectBoxY1, MenuStateConstants.DifficultySelectBoxWidth, MenuStateConstants.DifficultySelectBoxHeight)); this.ListOfObjects.Add(this.difficultyBoxEasy); this.difficultyBoxNormal = new ClickableBox( this.GameTextures.GetTexture("DifficultyNormal"), // default difficulty will be easy new Rectangle( MenuStateConstants.DifficultySelectBoxX, MenuStateConstants.DifficultySelectBoxY2, MenuStateConstants.DifficultySelectBoxWidth, MenuStateConstants.DifficultySelectBoxHeight)); this.ListOfObjects.Add(this.difficultyBoxNormal); this.difficultyBoxHard = new ClickableBox( this.GameTextures.GetTexture("DifficultyHard"), // default difficulty will be easy new Rectangle( MenuStateConstants.DifficultySelectBoxX, MenuStateConstants.DifficultySelectBoxY3, MenuStateConstants.DifficultySelectBoxWidth, MenuStateConstants.DifficultySelectBoxHeight)); this.ListOfObjects.Add(this.difficultyBoxHard); this.selectBoxAccuracyTrainer = new ClickableBox( this.GameTextures.GetTexture("SelectBoxAccuracy"), new Rectangle( MenuStateConstants.GameSelectBoxX, MenuStateConstants.GameSelectBoxY1, MenuStateConstants.GameSelectBoxWidth, MenuStateConstants.GameSelectBoxHeight)); this.ListOfObjects.Add(this.selectBoxAccuracyTrainer); this.selectBoxMemoryMatrix = new ClickableBox( this.GameTextures.GetTexture("SelectBoxMemoryMatrix"), new Rectangle( MenuStateConstants.GameSelectBoxX, MenuStateConstants.GameSelectBoxY2, MenuStateConstants.GameSelectBoxWidth, MenuStateConstants.GameSelectBoxHeight)); this.ListOfObjects.Add(this.selectBoxMemoryMatrix); this.selectBoxEagleEye = new ClickableBox( this.GameTextures.GetTexture("SelectBoxEagleEye"), new Rectangle( MenuStateConstants.GameSelectBoxX, MenuStateConstants.GameSelectBoxY3, MenuStateConstants.GameSelectBoxWidth, MenuStateConstants.GameSelectBoxHeight)); this.ListOfObjects.Add(this.selectBoxEagleEye); this.selectBoxSimonSays = new ClickableBox( this.GameTextures.GetTexture("SelectBoxSimonSays"), new Rectangle( MenuStateConstants.GameSelectBoxX, MenuStateConstants.GameSelectBoxY4, MenuStateConstants.GameSelectBoxWidth, MenuStateConstants.GameSelectBoxHeight)); this.ListOfObjects.Add(this.selectBoxSimonSays); }
public override void Load() { base.Load(); OsuGame game = Game as OsuGame; Add(new Box() { SizeMode = InheritMode.XY, Size = new Vector2(1, 1), Colour = Color4.DarkRed }); ClickableBox button; Add(button = new ClickableBox(Color4.Pink) { Size = new Vector2(50, 50) }); button.Activated += () => ExitMode(); Add(container = new AutoSizeContainer() { Anchor = Anchor.Centre, Origin = Anchor.Centre }); container.Add(new ClickableBox(Color4.SkyBlue) { SizeMode = InheritMode.XY, Size = Vector2.One }); container.Add(new ClickableBox(Color4.Orange) { Size = new Vector2(50, 50), Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft }); container.Add(new ClickableBox(Color4.Orange) { Size = new Vector2(50, 50), Anchor = Anchor.TopRight, Origin = Anchor.TopRight }); container.Add(new ClickableBox(Color4.Orange) { Size = new Vector2(50, 50), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }); container.Add(new ClickableBox(Color4.Blue) { Size = new Vector2(10, 10), Anchor = Anchor.Centre, Origin = Anchor.Centre }); container.Add(new ClickableBox(Color4.Orange) { Size = new Vector2(50, 50), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight }); container.Add(new SpriteCircular(game.Textures.Get("coin")) { Position = new Vector2(100), Origin = Anchor.Centre, Anchor = Anchor.Centre }); Add(new SpriteText(game.Textures) { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Text = "12345" }); }