public override void Load() { #region Ressources sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprMyCharactersBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Characters Background"); sprMyEquipmentBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Equipment Background"); ResetSlotButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Reset Slot", new Vector2(535, 549), OnButtonOver, null); MyCharacterButton = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Character Icon", Vector2.Zero, 0, 1, 4); MyCharacterOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Character Outline", Vector2.Zero, 0, 1, 4); MyCharacterOutline.SetFrame(2); MyItemOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Item Outline", Vector2.Zero, 0, 1, 4); MyItemOutline.SetFrame(2); MyWeaponOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Weapon Outline", Vector2.Zero, 0, 1, 4); MyWeaponOutline.SetFrame(2); ArrayMenuButton = new InteractiveButton[] { ResetSlotButton, }; #endregion }
public static void PlaySpecialAttackSound(InteractiveButton buttonSpecialAttack) { if (buttonSpecialAttack.Material.Name == GameHud.DragonAttackBreathMat.ToString()) { PlayAttackSound(GameSounds.DragonBreathOfFire); } else if (buttonSpecialAttack.Material.Name == GameHud.PenguinAttackBigFireworkMat.ToString()) { PlayAttackSound(GameSounds.PenguinFireworks); } else if (buttonSpecialAttack.Material.Name == GameHud.PiggyAttackCoinRainMat.ToString()) { PlayAttackSound(GameSounds.PiggyCoinsRain); } else if (buttonSpecialAttack.Material.Name == GameHud.DragonAttackCannonMat.ToString()) { PlayAttackSound(GameSounds.DragonAuraCannon); } else if (buttonSpecialAttack.Material.Name == GameHud.PenguinAttackCarpetBombingMat.ToString()) { PlayAttackSound(GameSounds.PenguinSnowball); } else if (buttonSpecialAttack.Material.Name == GameHud.PiggyAttackPaydayMat.ToString()) { PlayAttackSound(GameSounds.PiggyPayDay); } }
public void AddControlToScene(Control control) { Control newControl = null; if (control.GetType() == typeof(Picture)) { newControl = new Picture(control.Get <Theme>(), control.Get <Material>(), control.DrawArea); } else if (control.GetType() == typeof(Label)) { newControl = new Label(control.Get <Theme>(), control.DrawArea, (control as Label).Text); newControl.Set(control.Get <BlendMode>()); newControl.Set(control.Get <Material>()); } else if (control.GetType() == typeof(Button)) { newControl = new Button(control.Get <Theme>(), control.DrawArea, (control as Button).Text); } else if (control.GetType() == typeof(InteractiveButton)) { newControl = new InteractiveButton(control.Get <Theme>(), control.DrawArea, (control as Button).Text); } else if (control.GetType() == typeof(Slider)) { newControl = new Slider(control.Get <Theme>(), control.DrawArea); } newControl.RenderLayer = control.RenderLayer; if (!newControl.Contains <AnchoringState>()) { newControl.Add(new AnchoringState()); //ncrunch: no coverage } CheckIfAnyMaterialIsCorrupt(newControl); Scene.Add(newControl); }
private void AddQuitButton() { var quitButton = new InteractiveButton(exitTheme, new Rectangle(0.3f, 0.72f, 0.4f, 0.15f)); quitButton.Clicked += TryInvokeQuit; Add(quitButton); }
public override void Load() { sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Character Select/Background"); CharacterBackground = new AnimatedSprite(Content, "Triple Thunder/Menus/Character Select/Character Background", Vector2.Zero, 0, 1, 4); CancelButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Cancel Button", new Vector2(508, 510), OnButtonOver, Cancel); OKButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/OK Button", new Vector2(590, 510), OnButtonOver, Confirm); foreach (string ActiveCharacterPath in Directory.EnumerateFiles("Content/Units/Triple Thunder/Characters")) { string ActiveCharacter = ActiveCharacterPath.Remove(0, 40); ActiveCharacter = ActiveCharacter.Remove(ActiveCharacter.Length - 4); CharacterInfo NewCharacterInfo = new CharacterInfo(ActiveCharacter, Content.Load <Texture2D>("Triple Thunder/Menus/Character Select/" + ActiveCharacter), Content.Load <Texture2D>("Triple Thunder/Menus/Character Select/" + ActiveCharacter + " Portrait")); ListCharacterInfo.Add(NewCharacterInfo); if (ActivePlayer.Equipment.CharacterType == ActiveCharacter) { SelectedCharacterInfo = NewCharacterInfo; } } }
public override void Load() { sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Wait Room/Mode Select Background"); DeathmatchButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Deathmatch Button", new Vector2(397, 249), OnButtonOver, OnDeathmatchSelected); DeathmatchButton.CanBeChecked = true; CaptureTheFlagButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Capture The Flag Button", new Vector2(397, 286), OnButtonOver, OnCaptureTheFlagSelected); CaptureTheFlagButton.CanBeChecked = true; SurvivalButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Survival Button", new Vector2(397, 323), OnButtonOver, OnSurvivalSelected); SurvivalButton.CanBeChecked = true; CloseButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Close Button", new Vector2(460, 392), OnButtonOver, Close); if (Room.RoomSubtype == "Deathmatch") { DeathmatchButton.Check(); } else if (Room.RoomSubtype == "Capture The Flag") { CaptureTheFlagButton.Check(); } else if (Room.RoomSubtype == "Survival") { SurvivalButton.Check(); } }
public void SetUp() { button = new InteractiveButton(Center, "Click Me"); InitializeMouse(); InitializeTouch(); AdvanceTimeAndUpdateEntities(); }
public void TestDragonBreathOfFireAttackSound(GameHud material) { var buttonSpecialAttack = new InteractiveButton(CreateTheme(material), drawArea); AvatarSpecialAttackSoundSelector.PlaySpecialAttackSound(buttonSpecialAttack); }
//ncrunch: no coverage end private void AddOptions() { var optionsButton = new InteractiveButton(optionsTheme, new Rectangle(0.3f, 0.58f, 0.4f, 0.15f)); optionsButton.Clicked += ShowOptionsSubmenu; Add(optionsButton); }
private void AddQuitButton() { var quitButton = new InteractiveButton(menuTheme, new Rectangle(0.3f, 0.6f, 0.4f, 0.1f), "Quit Game"); quitButton.Clicked += TryInvokeQuit; Add(quitButton); }
private void AddStartButton() { var startButton = new InteractiveButton(menuTheme, new Rectangle(0.3f, 0.1f, 0.4f, 0.15f), "Start Game"); startButton.Clicked += TryInvokeGameStart; Add(startButton); }
private void AddButton(Theme theme, Action clicked, string text) { var button = new InteractiveButton(theme, new Rectangle(Vector2D.Zero, ButtonSize), text); button.Clicked += clicked; buttons.Add(button); Add(button); }
//ncrunch: no coverage end private void AddHowToPlay() { var howToButton = new InteractiveButton(menuTheme, new Rectangle(0.3f, 0.5f, 0.4f, 0.15f), "How To Play"); howToButton.Clicked += ShowHowToPlaySubMenu; Add(howToButton); }
//ncrunch: no coverage start private void AddGameElementSelection() { var backgroundButton = new InteractiveButton(parentMenu.menuTheme, new Rectangle(0.2f, 0.2f, 0.12f, 0.07f), "Background") { RenderLayer = 5 }; backgroundButton.Clicked += () => { currentColorIndex = 0; UpdateColorDisplay(); UpdateSliderValues(); }; Add(backgroundButton); var borderButton = new InteractiveButton(parentMenu.menuTheme, new Rectangle(0.35f, 0.2f, 0.12f, 0.07f), "Border") { RenderLayer = 5 }; borderButton.Clicked += () => { currentColorIndex = 1; UpdateColorDisplay(); UpdateSliderValues(); }; Add(borderButton); var snakeButton = new InteractiveButton(parentMenu.menuTheme, new Rectangle(0.5f, 0.2f, 0.12f, 0.07f), "Snake") { RenderLayer = 5 }; snakeButton.Clicked += () => { currentColorIndex = 2; UpdateColorDisplay(); UpdateSliderValues(); }; Add(snakeButton); var chunkButton = new InteractiveButton(parentMenu.menuTheme, new Rectangle(0.65f, 0.2f, 0.12f, 0.07f), "Chunk") { RenderLayer = 5 }; chunkButton.Clicked += () => { currentColorIndex = 3; UpdateColorDisplay(); UpdateSliderValues(); }; Add(chunkButton); }
private void AddClickEvent(InteractiveButton button, TowerType type, string towerName) { button.Clicked += () => { //ContentLoader.Load<Sound>(GameSounds.PressButton.ToString()).Play(); //game.Get<InGameCommands>().HideTowerPanel(); //game.CreateTower(game.Get<InGameCommands>().PositionInGrid, type, towerName); }; }
private InteractiveButton CreateInteractiveButton(float angle, Color color, string towerName) { var drawArea = CalculateDrawArea(angle); var button = new InteractiveButton(drawArea, towerName); button.Color = color; button.AddTag(towerName); return(button); }
private void CreateTopLeftButton() { topLeft = new InteractiveButton(ControlDrawArea) { LeftMargin = new Margin(this, Edge.Left, ControlMargin), TopMargin = new Margin(this, Edge.Top, ControlMargin), Text = "Top\nLeft" }; }
public override void Load() { #region Ressources sndBGM = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/Music/Shop.mp3"); sndBGM.SetLoop(true); sndBGM.PlayAsBGM(); sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Background"); BackToLobbyButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Back To Lobby", new Vector2(678, 28), "Triple Thunder/Menus/Common/Back Arrow Icon", new Vector2(-86, 0), 6, OnButtonOver, ReturnToLobby); CharacterFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Character Filter", new Vector2(60, 102), OnButtonOver, FilterCharacters); EquipmentFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Equipment Filter", new Vector2(113, 102), OnButtonOver, FilterEquipment); WeaponsFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Weapons Filter", new Vector2(169, 102), OnButtonOver, FilterWeapons); ItemsFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Items Filter", new Vector2(225, 102), OnButtonOver, FilterItems); OthersFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Others Filter", new Vector2(281, 102), OnButtonOver, FilterOther); CharacterFilterButton.CanBeChecked = true; EquipmentFilterButton.CanBeChecked = true; WeaponsFilterButton.CanBeChecked = true; ItemsFilterButton.CanBeChecked = true; OthersFilterButton.CanBeChecked = true; CharacterFilterButton.Select(); ArrayMenuButton = new InteractiveButton[] { BackToLobbyButton, CharacterFilterButton, EquipmentFilterButton, WeaponsFilterButton, ItemsFilterButton, OthersFilterButton, }; #endregion ShopCharactersScreen NewShopCharacterScreen = new ShopCharactersScreen(Owner); ShopEquipmentScreen NewShopEquipmentScreen = new ShopEquipmentScreen(Owner); ShopWeaponsScreen NewShopWeaponsScreen = new ShopWeaponsScreen(Owner); ShopItemsScreen NewShopItemsScreen = new ShopItemsScreen(Owner); ShopOtherScreen NewShopOtherScreen = new ShopOtherScreen(Owner); ArrayShopScreen = new GameScreen[] { NewShopCharacterScreen, NewShopEquipmentScreen, NewShopWeaponsScreen, NewShopItemsScreen, NewShopOtherScreen }; foreach (GameScreen ActiveScreen in ArrayShopScreen) { ActiveScreen.Content = Content; ActiveScreen.ListGameScreen = ListGameScreen; ActiveScreen.Load(); } ActiveShopScreen = NewShopCharacterScreen; }
public void SelectAnInterActiveButton() { var button = new InteractiveButton(Rectangle.One); button.AddTag("New Button"); uiEditorScene.Scene.Add(button); uiEditorScene.SetEntity2D(button); Assert.AreEqual(button, uiEditorScene.SelectedEntity2DList[0]); }
protected Game(Logic logic) { this.logic = logic; buttonShader = ContentLoader.Create <Shader>(new ShaderCreationData(ShaderFlags.Position2DColoredTextured)); buttonImage = new Theme().Button.DiffuseMap; buttons = new InteractiveButton[logic.Board.Width, logic.Board.Height]; ArrangeScene(); ScreenSpace.Current.ViewportSizeChanged += ArrangeScene; }
public override void Load() { ListShopCharacter.Add(new CharacterMenuEquipment("Soul", 100, null, Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Icons/Player Soul Portrait"))); ListShopEquipment.Add(new MenuEquipment("Armor 1", EquipmentTypes.Armor, 150, Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Icons/Armor 01 Icon"), Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Icons/Armor 01 Full"))); #region Ressources sndBGM = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/Music/Shop.mp3"); sndBGM.SetLoop(true); sndBGM.PlayAsBGM(); sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Background"); sprMyCharactersBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Characters Background"); sprMyEquipmentBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Equipment Background"); sprMyItemsBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Items Background"); sprMyWeaponsBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/My Weapons Background"); BackToLobbyButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Back To Lobby", new Vector2(678, 28), "Triple Thunder/Menus/Common/Back Arrow Icon", new Vector2(-86, 0), 6, OnButtonOver, ReturnToLobby); CharacterFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Character Filter", new Vector2(60, 102), OnButtonOver, FilterCharacters); EquipmentFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Equipment Filter", new Vector2(113, 102), OnButtonOver, FilterEquipment); WeaponsFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Weapons Filter", new Vector2(169, 102), OnButtonOver, FilterWeapons); ItemsFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Items Filter", new Vector2(225, 102), OnButtonOver, FilterItems); OthersFilterButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Others Filter", new Vector2(281, 102), OnButtonOver, FilterOther); ResetSlotButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Reset Slot", new Vector2(535, 549), OnButtonOver, null); BuyCharacterIcon = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/Buy Character Icon", Vector2.Zero, 0, 1, 4); BuyItemIcon = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/Buy Item Icon", Vector2.Zero, 0, 1, 4); BuyWeaponIcon = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/Buy Weapon Icon", Vector2.Zero, 0, 1, 4); MyCharacterButton = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Character Icon", Vector2.Zero, 0, 1, 4); MyCharacterOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Character Outline", Vector2.Zero, 0, 1, 4); MyCharacterOutline.SetFrame(2); MyItemOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Item Outline", Vector2.Zero, 0, 1, 4); MyItemOutline.SetFrame(2); MyWeaponOutline = new AnimatedSprite(Content, "Triple Thunder/Menus/Shop/My Weapon Outline", Vector2.Zero, 0, 1, 4); MyWeaponOutline.SetFrame(2); ArrayMenuButton = new InteractiveButton[] { BackToLobbyButton, CharacterFilterButton, EquipmentFilterButton, WeaponsFilterButton, ItemsFilterButton, OthersFilterButton, ResetSlotButton, }; #endregion }
public void SelectControlWithHighestRenderlayerWhenSelectingNewControl() { CreateNewButtons(); var button = new InteractiveButton(Rectangle.One); button.AddTag("New Button"); button.RenderLayer = 6; uiEditorScene.Scene.Controls.Insert(1, button); uiEditorScene.FindEntity2DOnPosition(new Vector2D(0.5f, 0.5f)); Assert.AreEqual(6, uiEditorScene.SelectedEntity2DList[0].RenderLayer); }
private void AddBackButton() { var backButton = new InteractiveButton(menuTheme, new Rectangle(0.3f, ScreenSpace.Current.Bottom - 0.15f, 0.4f, 0.1f), "Back"); backButton.Clicked += () => { Hide(); parent.Show(); }; Add(backButton); }
public void LoadWithoutBinaryDataExtensions() { var stream = BinaryDataExtensions.SaveToMemoryStream(button); button.Text = "Original"; var loadedButton = new InteractiveButton(); loadedButton.LoadFromStream(stream); Assert.AreEqual(Center, loadedButton.DrawArea); Assert.AreEqual("Click Me", loadedButton.Text); loadedButton.DrawArea = loadedButton.DrawArea.Move(new Vector2D(0.0f, 0.2f)); }
public override void Load() { sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Create Room/Background Battle"); sprTextCaptureTheFlag = Content.Load <Texture2D>("Triple Thunder/Menus/Create Room/Capture The Flag Text"); sprTextDeathmatch = Content.Load <Texture2D>("Triple Thunder/Menus/Create Room/Deathmatch Text"); sprTextSurvival = Content.Load <Texture2D>("Triple Thunder/Menus/Create Room/Survival Text"); CaptureTheFlagButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Capture The Flag Button", new Vector2(533, 242), OnButtonOver, SelectCaptureTheFlag); DeathmatchButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Deathmatch Button", new Vector2(313, 242), OnButtonOver, SelectDeathmatch); SurvivalButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Survival Button", new Vector2(423, 242), OnButtonOver, SelectSurvival); MaxPlayers2Button = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Max Players 2 Button", new Vector2(353, 354), OnButtonOver, MaxPlayers2); MaxPlayers4Button = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Max Players 4 Button", new Vector2(388, 354), OnButtonOver, MaxPlayers4); MaxPlayers6Button = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Max Players 6 Button", new Vector2(422, 354), OnButtonOver, MaxPlayers6); MaxPlayers8Button = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Max Players 8 Button", new Vector2(457, 354), OnButtonOver, MaxPlayers8); TeamBalanceOnButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/On Button", new Vector2(370, 395), OnButtonOver, null); TeamBalanceOffButton = new InteractiveButton(Content, "Triple Thunder/Menus/Create Room/Off Button", new Vector2(453, 395), OnButtonOver, null); CaptureTheFlagButton.CanBeChecked = true; DeathmatchButton.CanBeChecked = true; SurvivalButton.CanBeChecked = true; DeathmatchButton.Check(); MaxPlayers2Button.CanBeChecked = true; MaxPlayers4Button.CanBeChecked = true; MaxPlayers6Button.CanBeChecked = true; MaxPlayers8Button.CanBeChecked = true; MaxPlayers8Button.Check(); TeamBalanceOnButton.CanBeChecked = true; TeamBalanceOffButton.CanBeChecked = true; TeamBalanceOffButton.Check(); CancelButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Cancel Button", new Vector2(490, 481), OnButtonOver, Cancel); OKButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/OK Button", new Vector2(565, 481), OnButtonOver, CreateRoom); fntArial12 = Content.Load <SpriteFont>("Fonts/Arial12"); RoomNameInput = new TextInput(fntArial12, sprPixel, new Vector2(270, 155), new Vector2(314, 20)); PasswordInput = new TextInput(fntArial12, sprPixel, new Vector2(470, 187), new Vector2(84, 20), null, true); RoomNameInput.SetText("Let's have fun!"); ArrayMenuButton = new InteractiveButton[] { CaptureTheFlagButton, DeathmatchButton, SurvivalButton, MaxPlayers2Button, MaxPlayers4Button, MaxPlayers6Button, MaxPlayers8Button, TeamBalanceOnButton, TeamBalanceOffButton, CancelButton, OKButton, }; }
//ncrunch: no coverage start private void AddColorsButton() { var colorButton = new InteractiveButton(menuTheme, new Rectangle(0.3f, 0.3f, 0.4f, 0.15f), "ChooseColours"); colorButton.Clicked += () => { Hide(); colorOptions.Show(); }; Add(colorButton); CreateColorOptions(); }
private void CreateButton(int x, int y) { if (buttons[x, y] != null) { buttons[x, y].Dispose(); } var theme = GetCachedButtonThemeOrCreateNewButtonTheme(x, y); var drawArea = new Rectangle(buttonsLeft + x * buttonWidth, buttonsTop + y * buttonHeight, buttonWidth, buttonHeight); buttons[x, y] = new InteractiveButton(theme, drawArea); buttons[x, y].Clicked = () => ButtonClicked(x, y); }
public override void Load() { sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav"); sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav"); fntText = Content.Load <SpriteFont>("Fonts/Arial10"); sprBackground = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Buy Character Background"); sprHeader = Content.Load <Texture2D>("Triple Thunder/Menus/Shop/Buy Character Text"); BuyButton = new InteractiveButton(Content, "Triple Thunder/Menus/Shop/Buy Button", new Vector2(568, 462), OnButtonOver, Buy); CancelButton = new InteractiveButton(Content, "Triple Thunder/Menus/Common/Cancel Button", new Vector2(488, 462), OnButtonOver, Cancel); }
private void AddExitButtonToOptionsMenu() { var exit = new InteractiveButton(new Rectangle(0.6f, 0.575f, 0.1f, 0.05f), "Exit") { RenderLayer = 4 }; exit.Clicked += () => //ncrunch: no coverage start { optionsMenu.Hide(); mainMenu.ToForeground(); }; //ncrunch: no coverage end optionsMenu.Add(exit); }
private void AddShowEulaButton() { var launchEulaMenu = new InteractiveButton(new Rectangle(0.3f, 0.5f, 0.2f, 0.1f), "Read EULA") { RenderLayer = 1 }; launchEulaMenu.Clicked += () => //ncrunch: no coverage start { eulaMenu.Show(); mainMenu.ToBackground(); }; //ncrunch: no coverage end mainMenu.Add(launchEulaMenu); }
IEnumerator ResetOff(InteractiveButton button) { yield return new WaitForSeconds(delayBeforeOff); button.SetOnStatus(false); }