public void Load() { m_newGameButton = new DButton( DButton.DButtonState.Foused, "Texture/Menu/Buttons/new game_0", m_spriteBatch,"NewGameButton"); m_continueButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/continue_0", m_spriteBatch, "ContinueButton"); m_optionButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/option_0", m_spriteBatch, "OptionButton"); m_howToPlayButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/howtoplay", m_spriteBatch, "HowToPlay" ); m_achievementsButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/achievements_0", m_spriteBatch, "AchievementsButton"); m_creditButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/credit_0", m_spriteBatch, "CreditButton"); m_exitButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/exit_0", m_spriteBatch, "ExitButton"); m_buttonList = new List<DButton>(); m_buttonList.Add( m_newGameButton ); if( CoreUtilities.IsTrue( "Continue" ) ) m_buttonList.Add(m_continueButton); m_buttonList.Add( m_optionButton ); m_buttonList.Add(m_howToPlayButton); m_buttonList.Add( m_achievementsButton ); m_buttonList.Add( m_creditButton ); m_buttonList.Add( m_exitButton ); for( int i = 0; i < m_buttonList.Count; i++ ) { m_buttonList[i].Size = new Vector2( 440 , 40 ); m_buttonList[i].DestRect = new Rectangle( 40, 20 + i * 35, (int)( m_buttonList[i].Size.X ), (int)( m_buttonList[i].Size.Y) ); } }
public void OnShowSpeechClick() { DCinematicSpeech dCinematicSpeech = new DCinematicSpeech(); dCinematicSpeech.Text = Service.Get <Localizer>().GetTokenTranslation(SpeechInput.text); dCinematicSpeech.BubbleContentKey = "Prefabs/Quest/CinematicSpeedBubbles/CinematicSpeechBubbleDynamic"; DButton dButton = new DButton(); dButton.Text = "Yes"; dButton.ButtonPrefabKey = "Prefabs/Buttons/Button_Test"; DButton dButton2 = new DButton(); dButton2.Text = "No"; dButton2.ButtonPrefabKey = "Prefabs/Buttons/Button_Test"; dCinematicSpeech.Buttons = new DButton[2] { dButton, dButton2 }; DTextStyle dTextStyle = new DTextStyle(); dTextStyle.ColorHex = "08FF08"; dTextStyle.FontContentKey = "Fonts/Draculon-Regular"; dCinematicSpeech.TextStyle = dTextStyle; dCinematicSpeech.BackgroundImageKey = "Sprites/CinematicSpeechBubbles/CinematicSpeachBubble_RockHopper"; Service.Get <EventDispatcher>().DispatchEvent(new CinematicSpeechEvents.ShowSpeechEvent(dCinematicSpeech)); }
private void closeQuests() { DButton dButton = new DButton(); dButton.Id = "QuestLogAdventureExit"; Service.Get <EventDispatcher>().DispatchEvent(new ButtonEvents.ClickEvent(dButton)); }
public override void OnClick(ButtonClickListener.ClickType clickType) { DButton dButton = new DButton(); dButton.Id = "MainNavControl"; Service.Get <EventDispatcher>().DispatchEvent(new ButtonEvents.ClickEvent(dButton)); setState(MainNavButtonState.SELECTED); }
private IEnumerator loadButton(DButton buttonData) { AssetRequest <GameObject> assetRequest = Content.LoadAsync <GameObject>(buttonData.ButtonPrefabKey); yield return(assetRequest); GameObject buttonGameObject = Object.Instantiate(assetRequest.Asset); buttonGameObject.transform.SetParent(ButtonParentTransform, worldPositionStays: false); ButtonController buttonController = buttonGameObject.GetComponent <ButtonController>(); buttonController.ShowButton(buttonData); }
public void Load() { m_backButton = new DButton( DButton.DButtonState.Foused, "Texture/Menu/Buttons/BackButton", m_spriteBatch, "BackButton" ); m_buttonList = new List<DButton>(); m_buttonList.Add( m_backButton ); for( int i = 0; i < m_buttonList.Count; i++ ) { m_buttonList[i].Size = new Vector2( 440, 40 ); m_buttonList[i].DestRect = new Rectangle( 40, 20 + i * 35, (int)( m_buttonList[i].Size.X ), (int)( m_buttonList[i].Size.Y ) ); } }
public void Load() { m_resumeGameButton = new DButton( DButton.DButtonState.Foused, "Texture/Menu/Buttons/resume_1", m_spriteBatch, "ResumeGameButton" ); m_optionButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/option_1", m_spriteBatch, "OptionButton" ); m_exitButton = new DButton( DButton.DButtonState.Idle, "Texture/Menu/Buttons/menu_1", m_spriteBatch, "BacktoStartButton" ); m_buttonList = new List<DButton>(); m_buttonList.Add( m_resumeGameButton ); m_buttonList.Add( m_optionButton ); m_buttonList.Add( m_exitButton ); for( int i = 0; i < m_buttonList.Count; i++ ) { m_buttonList[i].Size = new Vector2( 440, 40 ); m_buttonList[i].DestRect = new Rectangle(30, 20 + i*35, (int) (m_buttonList[i].Size.X), (int) (m_buttonList[i].Size.Y)); } }
void ReleaseDesignerOutlets() { if (AnswerLabel != null) { AnswerLabel.Dispose(); AnswerLabel = null; } if (BButton != null) { BButton.Dispose(); BButton = null; } if (CButton != null) { CButton.Dispose(); CButton = null; } if (DButton != null) { DButton.Dispose(); DButton = null; } if (HeadingLabel != null) { HeadingLabel.Dispose(); HeadingLabel = null; } if (QuestionLabel != null) { QuestionLabel.Dispose(); QuestionLabel = null; } }
public void ShowButton(DButton buttonData) { this.buttonData = buttonData; if (!string.IsNullOrEmpty(buttonData.Text)) { ButtonText.text = buttonData.Text; } if (!string.IsNullOrEmpty(buttonData.IconKey)) { CoroutineRunner.Start(loadButtonIcon(buttonData.IconKey), this, "loadButtonIcon"); } else { if (ButtonImage != null) { ButtonImage.enabled = false; } if (EButtonLoadCompleteAction != null) { EButtonLoadCompleteAction(); } } addCLickListener(); }
public ClickEvent(DButton buttonData) { ButtonData = buttonData; }
internal override void load() { base.load(); buttonPlay = new DButton("yellow_button01", 100, 100); addChild(buttonPlay); }