MouseHoldTriggerTests HoldMouseOutsideHoldArea Method Delta Engine Documentation

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

public void HoldMouseOutsideHoldArea()
Examples

[Test, CloseAfterFirstFrame]
public void HoldMouseOutsideHoldArea()
{
    if (mouse == null)
        return; //ncrunch: no coverage
    Vector2D mousePosition = -Vector2D.One;
    new Command(position => { mousePosition = position; }).Add(
        new MouseHoldTrigger(Rectangle.HalfCentered));
    SetMouseState(State.Pressing, Vector2D.Zero);
    SetMouseState(State.Pressed, Vector2D.Zero);
    AdvanceTimeAndUpdateEntities(1.05f);
    Assert.AreEqual(-Vector2D.One, mousePosition);
}
See Also