GamePadAnalogTrigger Stick Property Delta Engine Documentation

Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public GamePadAnalog Stick { get; }

Property Value

Type: GamePadAnalog
Remarks

Tests: DeltaEngine.Input.Tests.GamePadAnalogTriggerTests
Examples

2 unit tests call DeltaEngine.Input.GamePadAnalogTrigger.Stick
[Test]
public void MovingSticksTranslatesCircle()
{
    var ellipseLeft = new Ellipse(new Rectangle(0.4f, 0.5f, 0.1f, 0.1f), Color.Green);
    var ellipseRight = new Ellipse(new Rectangle(0.6f, 0.5f, 0.1f, 0.1f), Color.Blue);
    new Command(pos => ellipseLeft.Center = pos * 0.2f + Vector2D.Half).Add(
        new GamePadAnalogTrigger(GamePadAnalog.LeftThumbStick));
    new Command(pos => ellipseRight.Center = pos * 0.2f + Vector2D.Half).Add(
        new GamePadAnalogTrigger(GamePadAnalog.RightThumbStick));
}
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new GamePadAnalogTrigger(GamePadAnalog.RightThumbStick);
    Assert.AreEqual(GamePadAnalog.RightThumbStick, trigger.Stick);
    Assert.AreEqual(Vector2D.Zero, trigger.Movement);
}
See Also