void ReleaseDesignerOutlets() { if (GoButton != null) { GoButton.Dispose(); GoButton = null; } if (LeftButton != null) { LeftButton.Dispose(); LeftButton = null; } if (RightButton != null) { RightButton.Dispose(); RightButton = null; } if (StopButton != null) { StopButton.Dispose(); StopButton = null; } if (BackButton != null) { BackButton.Dispose(); BackButton = null; } }
//クリア時の処理 void ClearState() { if (TextBackGround.activeInHierarchy) { return; } //プレイヤーを止める Player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); //リザルト表示 TextBackGround.SetActive(true); SC.ResultSE(); string result_text; if (ConfigPara.language != ConfigPara.Language.Japanese) { result_text = "Clear!\n" + "Score " + (int)(Variable.count * jewel_rate + Variable.time * time_rate); } else { result_text = "クリア!\n" + "スコア " + (int)(Variable.count * jewel_rate + Variable.time * time_rate); if ((int)(Variable.count * jewel_rate + Variable.time * time_rate) > Variable.Score) { Variable.Score = (int)(Variable.count * jewel_rate + Variable.time * time_rate); SL.Save(); } } TextUtility.SetText(TextUtility.TextName.win, result_text); //ボタン表示 RightButton.SetActive(true); LeftButton.SetActive(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); Bounces = true; ShakeToClearEnabled = true; KeyboardPanningEnabled = true; ShouldScrollToBottomAfterKeyboardShows = false; Inverted = true; LeftButton.SetImage(UIImage.FromBundle("upload.png"), UIControlState.Normal); LeftButton.TintColor = UIColor.Gray; RightButton.SetTitle("Send", UIControlState.Normal); TextInputbar.AutoHideRightButton = true; TextInputbar.MaxCharCount = 256; TextInputbar.CounterStyle = CounterStyle.Split; TextInputbar.CounterPosition = CounterPosition.Top; TextInputbar.EditorTitle.TextColor = UIColor.DarkGray; TextInputbar.EditorLeftButton.TintColor = UIColor.FromRGB(0, 122, 255); TextInputbar.EditorRightButton.TintColor = UIColor.FromRGB(0, 122, 255); TypingIndicatorView.CanResignByTouch = true; TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; TableView.RegisterClassForCellReuse(typeof(MessageTableViewCell), MessengerCellIdentifier); AutoCompletionView.RegisterClassForCellReuse(typeof(MessageTableViewCell), AutoCompletionCellIdentifier); RegisterPrefixesForAutoCompletion(new [] { "@", "#", ":", "+:" }); }
void DisablePlayerInput() { LeftButton.SetActive(false); RightButton.SetActive(false); JumpButton.SetActive(false); ScoreLabel.SetActive(false); }
public override void ViewDidLoad() { base.ViewDidLoad(); DialogView.AddBorder(Colors.PopUpShadowColor, 13); DialogView.AddShadow(Colors.PopUpShadowColor, 13, 0, 0); if (!String.IsNullOrEmpty(titleText)) { TitleLabel.Text = titleText; } if (!String.IsNullOrEmpty(messageText)) { MessageLabel.Text = messageText; } if (AttributedMessage != null) { MessageLabel.AttributedText = AttributedMessage; } if (!String.IsNullOrEmpty(leftButtonText)) { LeftButton.SetTitle(leftButtonText, UIControlState.Normal); } if (!String.IsNullOrEmpty(rightButtonText)) { RightButton.SetTitle(rightButtonText, UIControlState.Normal); } }
private void UpdateInput() { if (UpButton.Down()) { Physics.Thrust(_FLYSPEED); } else if (DownButton.Down()) { Physics.Thrust(-_FLYSPEED); } if (LeftButton.Down()) { Physics.AddAngularForce(-_TURNSPEED); } else if (RightButton.Down()) { Physics.AddAngularForce(_TURNSPEED); } if (LookAnalog.Position != Vector2.Zero) { Body.Angle = Physics.GetAngle(new Vector2(-LookAnalog.Position.X, -LookAnalog.Position.Y)); } if (ThrustTrigger.Value > ThrustTrigger.DeadZone) { Physics.Thrust(ThrustTrigger.Value * _FLYSPEED); } if (FireButton.RapidFire(250)) { Gun.Fire(); } }
/* * Scroll * Shows and hides buttons to simulate pages turning * int direction changes visible set */ public void Scroll(int direction) { RightButton.GetComponent<Button>().interactable = false; LeftButton.GetComponent<Button>().interactable = false; Buttons1.SetActive(false); Buttons2.SetActive(false); Buttons3.SetActive(false); _set += direction; if (_set < 1) { _set = 1; } else if (_set > _scrollMax) { _set = _scrollMax; } if (_set == 1) { Buttons1.SetActive(true); RightButton.GetComponent<Button>().interactable = true; } else if (_set == 2) { Buttons2.SetActive(true); LeftButton.GetComponent<Button>().interactable = true; //RightButton.GetComponent<Button>().interactable = true; RightButton.GetComponent<Button>().interactable = false; } else if (_set == 3) { Buttons3.SetActive(true); LeftButton.GetComponent<Button>().interactable = true; } }//Scroll
// Update is called once per frame void Update() { if (Instance == null) { Instance = this; } }
private void MakeGuess(bool correct) { //if game has started if (GameStarted && GuessCount > 0) { try { //letter is a good guess if (correct) { IndexButton.Show(); IndexInfo.Show(); TipText.Show(); WrongButton.Hide(); RightButton.Hide(); }//letter is a bad guess else { BadGuesses += Guess; PossibleLetters = PossibleLetters.Replace(Guess, ""); Guess = PossibleLetters[0].ToString(); label2.Text = TheWord; GuessText.Text = Guess; label1.Text = BadGuesses; GuessCount--; GuessCountLabel.Text = GuessCount.ToString(); //remove words from list containing bad guessed letter PossibleWordSet = new SortedSet <string>(from p in PossibleWordSet where !p.Contains(Guess) select p); possible.Text = PossibleLetters; possiblewordcount.Text = PossibleWordSet.Count.ToString(); } if (GuessCount == 0) { WinningGif.Show(); RightButton.Hide(); WrongButton.Hide(); GuessText.Hide(); } //if (label2.Text == TheWord) //{ // RightButton.Hide(); // WrongButton.Hide(); //} } catch (Exception ex) { Debug.WriteLine(ex); } } }
//when new word is picked public void ResetGame() { TheWordText.Text = "The Word Being Guessed:"; PossibleText.Text = "# of Possible Words Left:"; LettersLeftText.Text = "Letters Left:"; BadGuessesText.Text = "Bad Guesses:"; GoodGuessesText.Text = "Good Guesses:"; GuessesLeftText.Text = "Guesses Left:"; GoodGuessesText.Hide(); GuessCount = 9; GameStarted = true; GuessCountLabel.Text = GuessCount.ToString(); GuessCountLabel.Show(); WinningGif.Hide(); RightButton.Show(); WrongButton.Show(); GuessText.Show(); GoodGuesses = ""; BadGuesses = ""; PossibleLetters = "etainoshrdlucmfwygpbvkqjxz"; //most popular letters based on https://en.oxforddictionaries.com/explore/which-letters-are-used-most GuessesSoFar = ""; label1.Text = ""; label2.Text = ""; test.Text = ""; TheWord = ""; Guess = PossibleLetters[0].ToString(); label2.Text = Guess; IndexButton.Hide(); IndexInfo.Hide(); TipText.Hide(); }
void EnablePlayerInput() { LeftButton.SetActive(true); RightButton.SetActive(true); JumpButton.SetActive(true); ScoreLabel.SetActive(true); }
private void UpdateMouseButtons() { LeftButton = LeftButton.UpdateOnNativePressing(currentState.Buttons[0]); RightButton = RightButton.UpdateOnNativePressing(currentState.Buttons[1]); MiddleButton = MiddleButton.UpdateOnNativePressing(currentState.Buttons[2]); X1Button = X1Button.UpdateOnNativePressing(currentState.Buttons[3]); X2Button = X2Button.UpdateOnNativePressing(currentState.Buttons[4]); }
private void UpdateValuesFromState(MouseState newState) { Position = ScreenSpace.Current.FromPixelSpace(new Vector2D((float)newState.X, (float)newState.Y)); LeftButton = LeftButton.UpdateOnNativePressing(newState.LeftButton); MiddleButton = MiddleButton.UpdateOnNativePressing(newState.MiddleButton); RightButton = RightButton.UpdateOnNativePressing(newState.RightButton); }
void EnableGUI() { LeftButton.SetActive(true); RightButton.SetActive(true); GameObject.Find("StartButton").SetActive(false); GameObject.Find("HighScore").SetActive(false); GameObject.Find("Title").SetActive(false); }
// Start is called before the first frame update void Start() { Mode = FishingMode.waiting; Lure = GameObject.Find("Lure").GetComponent <Lure>(); LeftButton = GameObject.Find("LeftButton").GetComponent <LeftButton>(); RightButton = GameObject.Find("RightButton").GetComponent <RightButton>(); ActionButton = GameObject.Find("ActionButton").GetComponent <ActionButton>(); }
internal new void LoadContent(string StyleFilePath, string HorizontalScrollbarNodeNameInXml) { base.LoadContent(StyleFilePath, HorizontalScrollbarNodeNameInXml); LeftButton.LoadContent(StyleFilePath, HorizontalScrollbarNodeNameInXml + "/LeftButton"); RightButton.LoadContent(StyleFilePath, HorizontalScrollbarNodeNameInXml + "/RightButton"); horizontalSlider.LoadContent(StyleFilePath, HorizontalScrollbarNodeNameInXml + "/SliderStyle"); }
internal new void Draw() { base.Draw(); LeftButton.Draw(); RightButton.Draw(); horizontalSlider.Draw(); }
internal new void Initialize(GraphicsDeviceManager Graphics) { base.Initialize(Graphics); LeftButton.Initialize(Graphics); RightButton.Initialize(Graphics); horizontalSlider.Initialize(Graphics); }
private void UpdateButtonStates(ref MouseState newState) { LeftButton = LeftButton.UpdateOnNativePressing(newState.LeftButton == ButtonState.Pressed); MiddleButton = MiddleButton.UpdateOnNativePressing(newState.MiddleButton == ButtonState.Pressed); RightButton = RightButton.UpdateOnNativePressing(newState.RightButton == ButtonState.Pressed); X1Button = X1Button.UpdateOnNativePressing(newState.XButton1 == ButtonState.Pressed); X2Button = X2Button.UpdateOnNativePressing(newState.XButton2 == ButtonState.Pressed); }
public void right() { grid.transform.position -= new Vector3(0, 0, 3); LeftButton.SetActive(true); if (grid.transform.position.z <= -9) { RightButton.SetActive(false); } }
public void left() { grid.transform.position += new Vector3(0, 0, 3); RightButton.SetActive(true); Debug.Log("called"); if (grid.transform.position.z >= 3) { LeftButton.SetActive(false); } }
internal new void UpdateOnce(SpriteBatch spriteBatch) { base.UpdateOnce(spriteBatch); horizontalSlider.CalculatePixelsToScroll = true; LeftButton.UpdateOnce(spriteBatch); RightButton.UpdateOnce(spriteBatch); horizontalSlider.UpdateOnce(spriteBatch); }
protected override void OnRenderSizeChanged(SizeChangedInfo size) { if (size == null) { return; } if (!size.WidthChanged && !size.HeightChanged) { return; } else if (!AutoFitWindow) { if (Properties.Settings.Default.FullscreenGallery == false) { return; } } //Keep position when size has changed Top += ((size.PreviousSize.Height / MonitorInfo.DpiScaling) - (size.NewSize.Height / MonitorInfo.DpiScaling)) / 2; Left += ((size.PreviousSize.Width / MonitorInfo.DpiScaling) - (size.NewSize.Width / MonitorInfo.DpiScaling)) / 2; // Move cursor after resize when the button has been pressed if (Navigation.RightbuttonClicked) { Point p = RightButton.PointToScreen(new Point(50, 10)); //Points cursor to center of RighButton NativeMethods.SetCursorPos((int)p.X, (int)p.Y); Navigation.RightbuttonClicked = false; } else if (Navigation.LeftbuttonClicked) { Point p = LeftButton.PointToScreen(new Point(50, 10)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); Navigation.LeftbuttonClicked = false; } else if (Navigation.ClickArrowRightClicked) { Point p = GetClickArrowRight.PointToScreen(new Point(25, 30)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); Navigation.ClickArrowRightClicked = false; FadeControls.FadeControlsAsync(true); } else if (Navigation.ClickArrowLeftClicked) { Point p = GetClickArrowLeft.PointToScreen(new Point(25, 30)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); Navigation.ClickArrowLeftClicked = false; FadeControls.FadeControlsAsync(true); } base.OnRenderSizeChanged(size); }
internal new void Update(GameTime gameTime) { UpdateDimantions(); LeftButton.Update(gameTime); RightButton.Update(gameTime); horizontalSlider.Update(gameTime); base.Update(gameTime); }
private void PaintFormControlsCollection_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Left) { LeftButton.PerformClick(); } if (e.KeyCode == Keys.Right) { RightButton.PerformClick(); } }
public Form1() { InitializeComponent(); PlayButton.Hide(); numericUpDown1.Hide(); GuessCountLabel.Hide(); WinningGif.Hide(); WrongButton.Hide(); RightButton.Hide(); IndexInfo.Hide(); IndexButton.Hide(); guessRightLabel.Hide(); }
void TouchOn() { if ((Screen.width / 2 < startPos.x) && (Player.motion.offset.x < 1.5f)) { Player.motion.offset = new Vector2(Player.motion.offset.x + Time.deltaTime * 5, 0); RightButton.GetComponent <Transform>().localScale = new Vector3(1.25f, 1.25f, 1.25f); } if ((Screen.width / 2 > startPos.x) && (Player.motion.offset.x > -1.5f)) { Player.motion.offset = new Vector2(Player.motion.offset.x - Time.deltaTime * 5, 0); LeftButton.GetComponent <Transform>().localScale = new Vector3(1.25f, 1.25f, 1.25f); } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); MainMenu.dngNav.SetNavigationBarHidden(true, true); RoomImage.Image = rc.Image; TopButton.SetTitle(TopButtonDuty.ToString(), UIControlState.Normal); BottomButton.SetTitle(BottomButtonDuty.ToString(), UIControlState.Normal); RightButton.SetTitle(RightButtonDuty.ToString(), UIControlState.Normal); LeftButton.SetTitle(LeftButtonDuty.ToString(), UIControlState.Normal); base.ViewDidAppear(animated); }
private void hScrollBar_Scroll(object sender, ScrollEventArgs e) { if (e.Type == ScrollEventType.SmallDecrement || e.Type == ScrollEventType.SmallIncrement) { if (e.NewValue < 0) { LeftButton?.Invoke(this, new EventArgs()); } else if (e.NewValue > 0) { RightButton?.Invoke(this, new EventArgs()); } } e.NewValue = 0; }
private void Update() { if (splashScreen) { splashTimer += Time.deltaTime; if (splashTimer > 6f) { splashScreen.color = Color.Lerp(splashScreen.color, new Color(1, 1, 1, 0f), 0.08f); splashScreen.raycastTarget = false; } else { splashScreen.raycastTarget = true; } } if (ShowPages) { LeftButton.anchoredPosition = Vector2.Lerp(LeftButton.anchoredPosition, new Vector2(30f, -20f), 0.1f); RightButton.anchoredPosition = Vector2.Lerp(RightButton.anchoredPosition, new Vector2(30f, -20f), 0.1f); if (page == -pageCount) { RightButton.GetComponent <Image>().color = new Color(0.5f, 0.5f, 0.5f, 1f); } else { RightButton.GetComponent <Image>().color = Color.white; } //Remove play button from view PlayButton.anchoredPosition = Vector2.Lerp(PlayButton.anchoredPosition, new Vector2(-1000, -112.9f), 0.1f); CreditsButton.anchoredPosition = Vector2.Lerp(CreditsButton.anchoredPosition, new Vector2(-1000, -112.9f), 0.1f); } else { LeftButton.anchoredPosition = Vector2.Lerp(LeftButton.anchoredPosition, new Vector2(-85, -550f), 0.1f); RightButton.anchoredPosition = Vector2.Lerp(RightButton.anchoredPosition, new Vector2(85, -550f), 0.1f); //Move Play Button into view PlayButton.anchoredPosition = Vector2.Lerp(PlayButton.anchoredPosition, new Vector2(0, 0f), 0.1f); CreditsButton.anchoredPosition = Vector2.Lerp(CreditsButton.anchoredPosition, new Vector2(0f, 0f), 0.1f); } }