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_PlayerSelectNames(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.35f), Color.Black, "Player X:", true); AddElement(_playerText); _isComputerPlayer = new UI_CheckBox(Camera, new Vector(Width(0.59f), Height(0.397f)), "Computer Player?"); AddElement(_isComputerPlayer); _inputMethodKey = new Dictionary <bool, IInputMethod>(); _inputMethodKey.Add(true, new AIInputMethod()); _inputMethodKey.Add(false, new PlayerInputMethod()); }
public UI_PlayerSelect() { _stateComponent = new StateComponent <PlayerSelectState>(PlayerSelectState.ReadingNumberPlayers); _menuLogo = new UI_StaticImage(Width(0.45f), Height(0.14f), SwinGame.BitmapNamed("menuLogo")); AddElement(_menuLogo); textElement = new UI_Text(Width(0.5f), Height(0.35f), Color.Black, "Number of players:", true); AddElement(textElement); //start reading number players. SwinGame.StartReadingText(Color.Black, 20, SwinGame.FontNamed("guiFont"), (int)Width(0.5f), (int)Height(0.4f)); _players = new List <Player>(); }
public UI_PlayerSelect_Legacy(A3RData a3RData) : base(a3RData) { _stateComponent = new StateComponent <PlayerSelectState>(PlayerSelectState.ReadingNumberPlayers); _menuLogo = new UI_StaticImage(a3RData.Camera, Width(0.45f), Height(0.14f), SwinGame.BitmapNamed("menuLogo")); AddElement(_menuLogo); textElement = new UI_Text(a3RData.Camera, Width(0.5f), Height(0.35f), Color.Black, "Number of players:", true); AddElement(textElement); //start reading number players. SwinGame.StartReadingText(Color.Black, 20, SwinGame.FontNamed("guiFont"), (int)Width(0.5f), (int)Height(0.4f)); _players = Artillery3R.Services.A3RData.Players; }
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); }