Touch GetState Method Delta Engine Documentation

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

public abstract State GetState(
	int touchIndex
)

Return Value

Type: State
Remarks

Tests: DeltaEngine.Input.Tests.TouchTests
Examples

1 unit tests call DeltaEngine.Input.Touch.GetState(System.Int32)
[Test, CloseAfterFirstFrame]
public void TestPositionAndState()
{
    bool isTouched = false;
    new Command(() => isTouched = true).Add(new TouchPressTrigger(State.Pressed));
    Assert.IsFalse(isTouched);
    var mockTouch = Resolve<Touch>() as MockTouch;
    if (mockTouch == null)
        return; //ncrunch: no coverage
    Assert.NotNull(mockTouch);
    Assert.AreEqual(State.Released, mockTouch.GetState(0));
    Assert.True(mockTouch.IsAvailable);
}
See Also