TouchDragDropTrigger StartArea Property Delta Engine Documentation

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

public Rectangle StartArea { get; }

Property Value

Type: Rectangle
Remarks

Tests: DeltaEngine.Input.Tests.TouchDragDropTriggerTests
Examples

6 unit tests call DeltaEngine.Input.TouchDragDropTrigger.StartArea
[Test, CloseAfterFirstFrame]
public void DragDropTouchOutsideStartArea()
{
    if (touch == null)
        return; //ncrunch: no coverage
    Vector2D startPoint = -Vector2D.One;
    new Command(position => { startPoint = position; }).Add(
        new TouchDragDropTrigger(Rectangle.HalfCentered));
    SetTouchState(State.Pressing, Vector2D.Zero);
    SetTouchState(State.Pressed, Vector2D.One);
    SetTouchState(State.Releasing, Vector2D.One);
    SetTouchState(State.Released, Vector2D.One);
    Assert.AreEqual(-Vector2D.One, startPoint);
}
[Test, CloseAfterFirstFrame]
public void DragDropTouchInsideStartArea()
{
    if (touch == null)
        return; //ncrunch: no coverage
    Vector2D startPoint = -Vector2D.One;
    new Command(position => { startPoint = position; }).Add(
        new TouchDragDropTrigger(Rectangle.HalfCentered));
    SetTouchState(State.Pressing, Vector2D.Half);
    SetTouchState(State.Pressed, Vector2D.One);
    SetTouchState(State.Releasing, Vector2D.One);
    Assert.AreEqual(Vector2D.Half, startPoint);
}
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new TouchDragDropTrigger(Rectangle.One);
    Assert.AreEqual(Rectangle.One, trigger.StartArea);
    Assert.AreEqual(Vector2D.Unused, trigger.StartDragPosition);
}
See Also