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); }
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(); } }
public override void Initialize() { base.Initialize(); LeftButton.Initialize(); RightButton.Initialize(); }
void EnablePlayerInput() { LeftButton.SetActive(true); RightButton.SetActive(true); JumpButton.SetActive(true); ScoreLabel.SetActive(true); }
public override void LoadContent() { base.LoadContent(); LeftButton.LoadContent(); RightButton.LoadContent(); }
// Update is called once per frame void Update() { if (Instance == null) { Instance = this; } }
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; } }
// Update is called once per frame void Update() { if (rightClicked) { RightClickTransition(); } if (leftClicked) { LeftClickTransition(); } if (currentPage == NumberOfPages() && !leftClicked && !rightClicked) { RightButton.SetActive(false); LeftButton.SetActive(true); } else if (currentPage == 0 && !leftClicked && !rightClicked) { LeftButton.SetActive(false); RightButton.SetActive(true); } else if (rightClicked || leftClicked) { RightButton.SetActive(false); LeftButton.SetActive(false); } else { RightButton.SetActive(true); LeftButton.SetActive(true); } }
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); } }
// 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>(); }
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); }
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 override void Update(GameTime gameTime) { base.Update(gameTime); if (Active) { LeftButton.Update(gameTime); RightButton.Update(gameTime); } }
public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); if (Visible) { LeftButton.Draw(spriteBatch); RightButton.Draw(spriteBatch); } }
public override void HandleInput() { base.HandleInput(); if (Active) { LeftButton.HandleInput(); RightButton.HandleInput(); } }
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); }
private void PaintFormControlsCollection_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Left) { LeftButton.PerformClick(); } if (e.KeyCode == Keys.Right) { RightButton.PerformClick(); } }
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; }
public override void Update(GameTime gameTime) { base.Update(gameTime); var currentState = Mouse.GetState(); LeftButton.Update(currentState.LeftButton); RightButton.Update(currentState.RightButton); MiddleButton.Update(currentState.MiddleButton); var newPoint = new Point(currentState.X, currentState.Y); if (!newPoint.Equals(lastPosition)) { MouseMove(newPoint); lastPosition = newPoint; } }
void ReleaseDesignerOutlets() { if (BottomButton != null) { BottomButton.Dispose(); BottomButton = null; } if (LeftButton != null) { LeftButton.Dispose(); LeftButton = null; } if (OkLootButton != null) { OkLootButton.Dispose(); OkLootButton = null; } if (RightButton != null) { RightButton.Dispose(); RightButton = null; } if (RoomImage != null) { RoomImage.Dispose(); RoomImage = null; } if (TopButton != null) { TopButton.Dispose(); TopButton = null; } if (TreasureFoundLabel != null) { TreasureFoundLabel.Dispose(); TreasureFoundLabel = null; } }
//private void MainWindow_LocationChanged(object sender, EventArgs e) //{ // // TODO Need to figure out a way to handle user dragging app to a monitor, with different resolution. // //MonitorInfo = MonitorSize.GetMonitorSize(); // //ZoomFit(img.Width, img.Height); //} protected override void OnRenderSizeChanged(SizeChangedInfo size) { if (size == null) { return; } if (!FitToWindow || !size.WidthChanged && !size.HeightChanged) { return; } //Keep position when size has changed Top += (size.PreviousSize.Height - size.NewSize.Height) / 2; Left += (size.PreviousSize.Width - size.NewSize.Width) / 2; // Move cursor after resize when the button has been pressed if (RightbuttonClicked) { Point p = RightButton.PointToScreen(new Point(50, 10)); //Points cursor to center of RighButton NativeMethods.SetCursorPos((int)p.X, (int)p.Y); RightbuttonClicked = false; } else if (LeftbuttonClicked) { Point p = LeftButton.PointToScreen(new Point(50, 10)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); LeftbuttonClicked = false; } else if (clickArrowRightClicked) { Point p = clickArrowRight.PointToScreen(new Point(25, 30)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); clickArrowRightClicked = false; } else if (clickArrowLeftClicked) { Point p = clickArrowLeft.PointToScreen(new Point(25, 30)); NativeMethods.SetCursorPos((int)p.X, (int)p.Y); clickArrowLeftClicked = false; } base.OnRenderSizeChanged(size); }
///////////////////////////////////////////////// // メイン処理 //////////////////////////////////////////////// void Update() { UpButton upButton = refObjUP.GetComponent <UpButton>(); RightButton rightButton = refObjR.GetComponent <RightButton>(); LeftButton leftButton = refObjL.GetComponent <LeftButton>(); FireButton fireButton = refObjF.GetComponent <FireButton>(); if (m_state != State.Damaged) { //キーでも反映 float x = rightButton.fRight + leftButton.fLeft + Input.GetAxis("Horizontal"); bool jump = upButton.bJump | Input.GetButtonDown("Jump"); Move(x, jump); // 弾の発射処理 if ((Input.GetKey(KeyCode.X) || fireButton.bfire) && bbulletflag) { Shot(); } if (30 == nflame) //取り敢えず30fに一度の発射で { bbulletflag = true; } if (false == bbulletflag) //発射不能時のみカウント { nflame += 1; } if (false == jump) //ジャンプが二回読み込まれてしまったので一回だけにするように調整 { nfirstjump = 0; } if (bigjump) // upobjectからのフラグでjump { m_rigidbody2D.AddForce(Vector2.up * jumpPower * 2); bigjump = false; } } }
public override void Update(TimeSpan elapsedTime) { if (Core.Settings.Fullscreen) { InputEngine.SetMousePosition(Cursor.Position.X, Cursor.Position.Y); } int x = 0, y = 0, dX = 0, dY = 0, roll = 0; bool button1 = false, button2 = false, button3 = false, button4 = false; InputEngine.GetMouseState(ref dX, ref dY, ref button1, ref button2, ref button3, ref button4, ref roll); InputEngine.GetMousePosition(ref x, ref y); position = new Vector2(x, y); Movement = new Vector2(dX, dY); LeftButton = LeftButton.NextState(button1, elapsedTime); RightButton = RightButton.NextState(button2, elapsedTime); MiddleButton = MiddleButton.NextState(button3, elapsedTime); WheelTurns = roll; }
void ReleaseDesignerOutlets() { if (ContainerViewMain != null) { ContainerViewMain.Dispose(); ContainerViewMain = null; } if (LeftButton != null) { LeftButton.Dispose(); LeftButton = null; } if (RightButton != null) { RightButton.Dispose(); RightButton = null; } if (ContentScrollView != null) { ContentScrollView.Dispose(); ContentScrollView = null; } if (ContainerViewSlider != null) { ContainerViewSlider.Dispose(); ContainerViewSlider = null; } if (SliderTitleLabel != null) { SliderTitleLabel.Dispose(); SliderTitleLabel = null; } }
void ReleaseDesignerOutlets() { if (DirectionValueLabel != null) { DirectionValueLabel.Dispose(); DirectionValueLabel = null; } if (LeftButton != null) { LeftButton.Dispose(); LeftButton = null; } if (MoveButton != null) { MoveButton.Dispose(); MoveButton = null; } if (RightButton != null) { RightButton.Dispose(); RightButton = null; } if (XCoordinateValueLabel != null) { XCoordinateValueLabel.Dispose(); XCoordinateValueLabel = null; } if (YCoordinateValueLabel != null) { YCoordinateValueLabel.Dispose(); YCoordinateValueLabel = null; } }
void ReleaseDesignerOutlets() { if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (DialogView != null) { DialogView.Dispose(); DialogView = null; } if (LeftButton != null) { LeftButton.Dispose(); LeftButton = null; } if (MessageLabel != null) { MessageLabel.Dispose(); MessageLabel = null; } if (RightButton != null) { RightButton.Dispose(); RightButton = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); Button0.SetCommand(_viewModel.Button0Action); Button1.SetCommand(_viewModel.Button1Action); Button2.SetCommand(_viewModel.Button2Action); Button3.SetCommand(_viewModel.Button3Action); Button4.SetCommand(_viewModel.Button4Action); Button5.SetCommand(_viewModel.Button5Action); Button6.SetCommand(_viewModel.Button6Action); Button7.SetCommand(_viewModel.Button7Action); Button8.SetCommand(_viewModel.Button8Action); Button9.SetCommand(_viewModel.Button9Action); LeftButton.SetCommand(_viewModel.LeftButtonAction); CommaButton.SetCommand(_viewModel.CommaButtonAction); RightButton.SetCommand(_viewModel.RightButtonAction); AddRecordButton.SetCommand(_viewModel.AddRecordAction); DeleteButton.SetCommand(_viewModel.DeleteButtonAction); IncomeButton.SetCommand(_viewModel.IncomeButtonAction); ExpensesButton.SetCommand(_viewModel.ExpensesButtonAction); TransferButton.SetCommand(_viewModel.TransferButtonAction); _bindings.Add(this.SetBinding(() => _viewModel.SignText, () => SignLabel.Text)); _bindings.Add(this.SetBinding(() => _viewModel.LeftButtonText, () => LeftButtonText)); _bindings.Add(this.SetBinding(() => _viewModel.RightButtonText, () => RightButtonText)); _bindings.Add(this.SetBinding(() => _viewModel.AmountLabelText, () => AmountLabel.Text)); _bindings.Add(this.SetBinding(() => _viewModel.IncomeButtonColor, () => IncomeButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); _bindings.Add(this.SetBinding(() => _viewModel.TransButtonColor, () => TransferButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); _bindings.Add(this.SetBinding(() => _viewModel.ExpensesButtonColor, () => ExpensesButton.BackgroundColor).ConvertSourceToTarget(x => x.ToNative())); HolderView.ApplyStyle(_viewModel.MainStyling); TemplatesButton.ApplyStyle(_viewModel.MainStyling); RightButton.ApplyStyle(_viewModel.MainStyling); LeftButton.ApplyStyle(_viewModel.MainStyling); MiddleImageView.ApplyStyle(_viewModel.MainStyling); }