public UI_PlayerSelectCharacters(A3RData a3RData, endSelectStage endSelectStage) : base(a3RData, endSelectStage) { _background = new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("shopBg")); AddElement(_background); _playerText = new UI_Text(Camera, Width(0.5f), Height(0.38f), Color.Black, "Player X:", true); AddElement(_playerText); AddElement(new UI_Text(A3RData.Camera, Width(0.5f), Height(0.35f), Color.Black, "Select a Character", true)); UI_Button _uiButton; _uiButton = new UI_Button(A3RData.Camera, "G.W. Tiger", Width(0.25f), Height(0.5f), new UIEventArgs("gwt")); _uiButton.OnUIEvent += CharacterButtonPressed; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); _uiButton = new UI_Button(A3RData.Camera, "Object 15X", Width(0.5f), Height(0.5f), new UIEventArgs("obj")); _uiButton.OnUIEvent += CharacterButtonPressed; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); _uiButton = new UI_Button(A3RData.Camera, "Innocentia", Width(0.75f), Height(0.5f), new UIEventArgs("int")); _uiButton.OnUIEvent += CharacterButtonPressed; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); }
public UI_MainMenu(A3RData a3RData) : base(a3RData) { AddElement(new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("shopBg"))); Rectangle _windowRect = A3RData.WindowRect; AddElement(new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("fullBg"))); UI_DynamicImage _menuGradient = new UI_DynamicImage(A3RData.Camera, -20, 0, -5000, 0, 10, SwinGame.BitmapNamed("menuLeftWhite")); AddElement(_menuGradient); _menuGradient = new UI_DynamicImage(A3RData.Camera, 0, 0, -5000, 0, 10, SwinGame.BitmapNamed("menuGradientFull")); AddElement(_menuGradient); _menuGradient = new UI_DynamicImage(A3RData.Camera, 0, 0, -8000, 0, 15, SwinGame.BitmapNamed("menuGradientHalf")); AddElement(_menuGradient); UI_StaticImage _menuLogo = new UI_StaticImage(a3RData.Camera, _windowRect.Width * 0.022f, _windowRect.Height * 0.24f, SwinGame.BitmapNamed("menuLogo")); AddElement(_menuLogo); _playButton = new UI_Button(a3RData.Camera, "New Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.417f, UIEvent.StartGame, SwinGame.BitmapNamed("startButton"), SwinGame.BitmapNamed("startButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button(a3RData.Camera, "Load Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.466f, UIEvent.StartGame, SwinGame.BitmapNamed("loadButton"), SwinGame.BitmapNamed("loadButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button(a3RData.Camera, "Test Text", _windowRect.Width * 0.026f, _windowRect.Height * 0.520f, UIEvent.StartGame, SwinGame.BitmapNamed("optionsButton"), SwinGame.BitmapNamed("optionsButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button(a3RData.Camera, "Exit", _windowRect.Width * 0.026f, _windowRect.Height * 0.572f, UIEvent.Exit, SwinGame.BitmapNamed("exitButton"), SwinGame.BitmapNamed("exitButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); }
public UI_ShopMenu(A3RData a3RData, NotifyPlayerFinishedShop notifyPlayerFinishedShop) : base(a3RData) { _notifyPlayerFinishedShop = notifyPlayerFinishedShop; _shopBackground = SwinGame.BitmapNamed("shopBg"); AddElement(new UI_StaticImage(a3RData.Camera, Width(0.5f), Height(0.24f), SwinGame.BitmapNamed("menuLogo"))); _characterBox = new UI_Box(A3RData, 300, 200, new Vector(20, 20)); _statBox = new UI_TextBox(A3RData, 300, 370, new Vector(20, 240)); _equipBox = new UI_EquipBox(A3RData, 300, 750, new Vector(Width(1) - 320, 20), RefreshShopItems); UI_Button _nextButton = new UI_Button(Camera, "Next", Width(1) - 170, Height(1) - 60, FinishShopButton); _nextButton.Width = 300; _nextButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _nextButton.MiddleAligned = true; _nextButton.LockToScreen(); _fadeFx = new UI_StaticImage(Camera, 0, 0, SwinGame.BitmapNamed("fadeFx")); if (A3RData.EasterEggTriggered) { AddElement(new UI_StaticImage(a3RData.Camera, Width(0.5f), Height(-1f), SwinGame.BitmapNamed("ddlc"))); } _playerName = A3RData.SelectedPlayer.Name; _characterName = A3RData.SelectedPlayer.Character.Name; _shopItems = new UI_ShopItems(A3RData, RefreshEquipBox); AddElement(_shopItems); AddElement(_nextButton); AddElement(_equipBox); AddElement(_characterBox); AddElement(_statBox); AddElement(new UI_HealthUpgradeButton(a3RData, 300, 60, new Vector(20, _statBox.Pos.Y + 390))); AddElement(new UI_ArmourUpgradeButton(a3RData, 300, 60, new Vector(20, _statBox.Pos.Y + 390 + 80))); AddElement(_fadeFx); _selPlayer = A3RData.SelectedPlayer; }
public UI_MainMenu() { UI_DynamicImage _menuGradient = new UI_DynamicImage(0, 0, -5000, 0, 10, SwinGame.BitmapNamed("menuGradientFull")); AddElement(_menuGradient); _menuGradient = new UI_DynamicImage(0, 0, -8000, 0, 15, SwinGame.BitmapNamed("menuGradientHalf")); AddElement(_menuGradient); UI_StaticImage _menuLogo = new UI_StaticImage(_windowRect.Width * 0.022f, _windowRect.Height * 0.24f, SwinGame.BitmapNamed("menuLogo")); AddElement(_menuLogo); _playButton = new UI_Button("New Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.417f, UIEvent.StartGame, SwinGame.BitmapNamed("startButton"), SwinGame.BitmapNamed("startButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button("Load Game", _windowRect.Width * 0.026f, _windowRect.Height * 0.466f, UIEvent.StartGame, SwinGame.BitmapNamed("loadButton"), SwinGame.BitmapNamed("loadButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button("Test Text", _windowRect.Width * 0.026f, _windowRect.Height * 0.520f, UIEvent.StartGame, SwinGame.BitmapNamed("optionsButton"), SwinGame.BitmapNamed("optionsButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); _playButton = new UI_Button("Exit", _windowRect.Width * 0.026f, _windowRect.Height * 0.572f, UIEvent.Exit, SwinGame.BitmapNamed("exitButton"), SwinGame.BitmapNamed("exitButtonSelected")); _playButton.OnUIEvent += UserInterface.Instance.NotifyUIEvent; _playButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); AddElement(_playButton); }
public void SwitchState(PlayerSelectState nextState) { // State machine logic goes here switch (nextState) { case PlayerSelectState.ReadingPlayers: SwinGame.StartReadingText(Color.Black, 20, SwinGame.FontNamed("guiFont"), (int)Width(0.5f), (int)Height(0.4f)); currentIndexPlayer++; ClearUI(); AddElement(_menuLogo); textElement = new UI_Text(A3RData.Camera, Width(0.5f), Height(0.35f), Color.Black, "Player " + currentIndexPlayer + "'s Name:", true); AddElement(textElement); break; case PlayerSelectState.ReadingPlayerCharacters: SwinGame.EndReadingText(); if (currentIndexPlayer < numberPlayers) { ClearUI(); AddElement(_menuLogo); /* create the ui */ UI_Button _uiButton; textElement = new UI_Text(A3RData.Camera, Width(0.5f), Height(0.35f), Color.Black, "Select a Character", true); AddElement(textElement); textElement = new UI_Text(A3RData.Camera, Width(0.5f), Height(0.38f), Color.Black, _players[currentIndexPlayer].Name, true); AddElement(textElement); _uiButton = new UI_Button(A3RData.Camera, "G.W. Tiger", Width(0.25f), Height(0.5f), new UIEventArgs("gwt")); _uiButton.OnUIEvent += NotifyUIEvent; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); _uiButton = new UI_Button(A3RData.Camera, "Object 15X", Width(0.5f), Height(0.5f), new UIEventArgs("obj")); _uiButton.OnUIEvent += NotifyUIEvent; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); _uiButton = new UI_Button(A3RData.Camera, "Innocentia", Width(0.75f), Height(0.5f), new UIEventArgs("int")); _uiButton.OnUIEvent += NotifyUIEvent; _uiButton.MouseOverSoundEffect = SwinGame.SoundEffectNamed("menuSound"); _uiButton.MiddleAligned = true; AddElement(_uiButton); /* End ui creation */ } currentIndexPlayer++; break; } _stateComponent.Switch(nextState); }