public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { if (!inputTouch.IsConnected || !inputTouch.CurrentTouches.Any()) { this.Value = 0; return; } bool leftTouch; bool rightTouch; if (this.isVertical) { leftTouch = inputTouch.CurrentTouches.Any(a => a.Position.Y < this.region.Height / 2f); rightTouch = inputTouch.CurrentTouches.Any(a => a.Position.Y >= this.region.Height / 2f); } else { leftTouch = inputTouch.CurrentTouches.Any(a => a.Position.X < this.region.Width / 2f); rightTouch = inputTouch.CurrentTouches.Any(a => a.Position.X >= this.region.Width / 2f); } this.SetValue(leftTouch, rightTouch); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { if (inputGamePad.DpadRightDown) { this.ValueX = 1; } else if (inputGamePad.DpadLeftDown) { this.ValueX = -1; } else { this.ValueX = 0; } if (inputGamePad.DpadDownDown) { this.ValueY = 1; } else if (inputGamePad.DpadUpDown) { this.ValueY = -1; } else { this.ValueY = 0; } }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { if (!inputTouch.IsConnected || !inputTouch.CurrentTouches.Any()) { this.ValueX = 0; this.ValueY = 0; return; } bool leftTouch; bool rightTouch; bool upTouch; bool downTouch; upTouch = inputTouch.CurrentTouches.Any(a => a.Position.Y < this.region.Height / 2f); downTouch = inputTouch.CurrentTouches.Any(a => a.Position.Y >= this.region.Height / 2f); leftTouch = inputTouch.CurrentTouches.Any(a => a.Position.X < this.region.Width / 2f); rightTouch = inputTouch.CurrentTouches.Any(a => a.Position.X >= this.region.Width / 2f); this.SetValue(upTouch, downTouch, leftTouch, rightTouch); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = inputKeyboard.IsKeyDown(this.Key); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = this.ButtonValue; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = inputTouch.IsConnected && inputTouch.CurrentTouches.Any(); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = inputMouse.RightMouseButtonDown; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = inputGamePad.IsRightTriggerDown(this.Threshold); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.SetValue(inputMouse.LeftMouseButtonDown, inputMouse.RightMouseButtonDown); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.Value = this.AxisValue; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.IsDown = inputGamePad.DpadLeftDown; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.SetValue(inputKeyboard.IsKeyDown(this.Negative), inputKeyboard.IsKeyDown(this.Positive)); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.Value = Mathf.SignThreshold(inputGamePad.GetRightStick(this.Deadzone).Y, this.Deadzone); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { this.ValueX = this.JoysticValue.X; this.ValueY = this.JoysticValue.Y; }
public virtual void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { foreach (var node in this.Nodes) { node.Update(inputKeyboard, inputMouse, inputTouch, inputGamePad); } }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { var value = inputGamePad.GetRightStick(this.Deadzone); this.ValueX = value.X; this.ValueY = value.Y; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { var multiplier = this.InvertResult ? -1 : 1; this.Value = multiplier * Mathf.SignThreshold( inputGamePad.GetLeftStick(this.Deadzone).Y, this.Deadzone); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { var up = inputKeyboard.IsKeyDown(this.Up); var down = inputKeyboard.IsKeyDown(this.Down); var left = inputKeyboard.IsKeyDown(this.Left); var right = inputKeyboard.IsKeyDown(this.Right); this.SetValue(up, down, left, right); }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { base.Update(inputKeyboard, inputMouse, inputTouch, inputGamePad); var thisTickValue = 0f; for (var i = 0; i < this.Nodes.Count; i++) { var val = ((Node)this.Nodes[i]).Value; if (val == null) { thisTickValue = this.CheckOverlap(this.Value); break; } if (val == 0) { continue; } var newResult = Math.Sign(val.Value); var oldResult = Math.Sign(thisTickValue); if (oldResult == newResult) { continue; } if (thisTickValue == 0) { thisTickValue = newResult; continue; } thisTickValue = this.CheckOverlap(this.Value); break; } this.Value = thisTickValue; }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { if (inputGamePad.DpadDownDown) { this.Value = 1f; } else if (inputGamePad.DpadUpDown) { this.Value = -1f; } else { this.Value = 0f; } }
public override void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad) { base.Update(inputKeyboard, inputMouse, inputTouch, inputGamePad); var downLastFrame = this.IsDown; this.IsDown = false; foreach (var node in this.Nodes) { if (((Node)node).IsDown) { this.IsDown = true; break; } } this.IsPressed = !downLastFrame && this.IsDown; this.IsReleased = downLastFrame && !this.IsDown; }
public abstract void Update( InputKeyboardComponent inputKeyboard, InputMouseComponent inputMouse, InputTouchComponent inputTouch, InputGamePadComponent inputGamePad);