protected void back_Clicked(Button button) { if (currentPage > 0) currentPage--; else currentPage = this.backgrounds.Count - 1; ChangeBackground(); SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedSound, false, true); }
// Button event do protected void SetSceneComponents() { this.uiManager = new UIControlManager(this.Game, DefaultGestureHandlingFactory.Instance); this.gestureManager.AddDispatcher(this.uiManager); this.Components.Add(this.uiManager); this.spriteBatch = SCSServices.Instance.SpriteBatch; this.background = SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MainMenu"); start = new Button(this.Game, this.spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MStartGame"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MStartGameOver")); start.FitSizeByImage(); start.Canvas.Bound.Position = new Vector2(60f, 380f); start.OnTouched += this.start_Clicked; this.uiManager.Add(start); option = new Button(this.Game, this.spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MOption"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MOptionOver")); option.FitSizeByImage(); option.Canvas.Bound.Position = new Vector2(300f, 370f); option.OnTouched += this.option_Clicked; this.uiManager.Add(option); help = new Button(this.Game, this.spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MHelp"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MHelpOver")); help.FitSizeByImage(); help.Canvas.Bound.Position = new Vector2(435f, 415f); help.OnTouched += this.help_Clicked; this.uiManager.Add(help); quit = new Button(this.Game, this.spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MQuitGame"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\MQuitGameOver")); quit.FitSizeByImage(); quit.Canvas.Bound.Position = new Vector2(680f, 450f); quit.OnTouched += this.quit_Clicked; this.uiManager.Add(quit); }
void No_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedSound, false, true); this.Manager.RemoveCurrent(); }
// Button event do protected void SetSceneComponents() { this.spriteBatch = SCSServices.Instance.SpriteBatch; this.backgrounds.Add(SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\HelpScene_1")); this.backgrounds.Add(SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\HelpScene_2")); this.buttonTouchedSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_OK_SOUNDNAME); this.currentTexture = backgrounds[currentPage]; this.uiManager = new UIControlManager(this.Game, DefaultGestureHandlingFactory.Instance); gm.AddDispatcher(this.uiManager); this.Components.Add(this.uiManager); this.next = new Button(this.Game, spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Next"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\NextOver")); this.next.FitSizeByImage(); this.next.Canvas.Bound.Position = new Vector2(710f, 450f); this.next.OnTouched += this.next_Clicked; this.uiManager.Add(next); this.back = new Button(this.Game, spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Back"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\BackOver")); this.back.FitSizeByImage(); this.back.Canvas.Bound.Position = new Vector2(0f, 450f); this.back.OnTouched += this.back_Clicked; this.uiManager.Add(back); }
public override void Initialize() { this.waitList = new PvZChooseList(this.Game, ButtonWidth, ButtonHeight, ButtonPadding, this.uiManager); this.chosenList = new PvZChooseList(this.Game, ButtonWidth, ButtonHeight, ButtonPadding, this.uiManager); this.waitList.Canvas.Bound.Position = new Vector2(outsidePosition, 150); this.waitList.Canvas.Bound.Size = new Vector2(480, 200); this.waitList.Canvas.Content.Position = new Vector2(20, 40); this.waitList.Canvas.Content.Size = new Vector2(430, 150); this.waitList.Background = SCSServices.Instance.ResourceManager.GetResource<ISprite>("ChoosePlant"); this.chosenList.Canvas.Bound.Position = new Vector2(outsidePosition, 400); this.chosenList.Canvas.Bound.Size = new Vector2(460, 70); this.chosenList.Canvas.Content.Position = new Vector2(90, 5); this.chosenList.Canvas.Content.Size = new Vector2(440, 56); this.chosenList.Background = SCSServices.Instance.ResourceManager.GetResource<ISprite>("BuyPlant"); foreach (var buttonF in this.buttonFB) { var chButton = buttonF.Value.CreateChooseButton(this.Game); chButton.OnTap += this.OnChooseButtonInWaitListTapped; this.waitList.AddChooseButton(chButton); } this.waitList.ReArrange(); this.uiManager.Add(this.waitList); this.uiManager.Add(this.chosenList); this.readyButton = new Button(this.Game, SCSServices.Instance.SpriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Ready"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("ReadyOver")); readyButton.IsOverlay = true; readyButton.FitSizeByImage(); readyButton.Canvas.Bound.Position = new Vector2(outsidePosition + readyButtonMargin, 360f); readyButton.OnTouched += this.OnReadyButtonTouched; this.uiManager.Add(readyButton); this.state = ChooseSystemState.OUTSIDE; base.Initialize(); }
private void OnReadyButtonTouched(Button button) { this.ComeOut(); }
private void start_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.playGameSound, false, true); this.Manager.AddExclusive(this.Manager.Bank.GetNewScreen("PlayScreen")); }
private void option_Clicked(Button button) { }
private void option_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.buttonFailSound, false, true); }
private void help_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.buttonOKSound, false, true); this.Manager.AddPopup(this.Manager.Bank.GetScreen("Help")); }
void No_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedSound, false, true); this.Manager.RemoveScreen(this.Manager.Bank.GetScreen("PlayScreen")); this.Manager.AddExclusive(this.Manager.Bank.GetScreen("MainMenu")); }
private void OnReadyButtonTouched(Button button) { if (this.chosenList.NumberOfBufferedButtons == this.maxButtons) { SCSServices.Instance.AudioManager.PlaySound(this.buttonChoosedSound, false, true); this.ComeOut(); } else { SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedFail, false, true); } }
private void start_Clicked(Button button) { this.Manager.AddExclusive(this.Manager.Bank.GetScreen("PlayScreen")); }
private void quit_Clicked(Button button) { }
void Yes_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedSound, false, true); this.Game.Exit(); }
private void quit_Clicked(Button button) { SCSServices.Instance.AudioManager.PlaySound(this.exitGameSound, false, true); this.Manager.AddPopup(this.Manager.Bank.GetScreen("Exit")); }
// Button event do protected void SetSceneComponents() { this.spriteBatch = SCSServices.Instance.SpriteBatch; this.background = SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\ExitMenu"); this.buttonTouchedSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_OK_SOUNDNAME); this.uiManager = new UIControlManager(this.Game, DefaultGestureHandlingFactory.Instance); gm.AddDispatcher(this.uiManager); this.Components.Add(this.uiManager); this.Yes = new Button(this.Game, spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Yes"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\YesOver")); this.Yes.FitSizeByImage(); this.Yes.Canvas.Bound.Position = new Vector2(130f, 310f); this.Yes.OnTouched += this.Yes_Clicked; this.uiManager.Add(Yes); this.No = new Button(this.Game, spriteBatch, SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\No"), SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\NoOver")); this.No.FitSizeByImage(); this.No.Canvas.Bound.Position = new Vector2(440f, 310f); this.No.OnTouched += this.No_Clicked; uiManager.Add(No); }
private void help_Clicked(Button button) { }