MouseHoldTriggerTests HoldLeftClickOnRectangle 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 HoldLeftClickOnRectangle()
Examples

[Test]
public void HoldLeftClickOnRectangle()
{
    var drawArea = new Rectangle(0.25f, 0.25f, 0.5f, 0.25f);
    new FilledRect(drawArea, Color.Blue);
    var trigger = new MouseHoldTrigger(drawArea);
    var counter = 0;
    var text = new FontText(Font.Default, "", drawArea.Move(new Vector2D(0.0f, 0.25f)));
    new Command(() => text.Text = "MouseHold Triggered " + ++counter + " times.").Add(trigger);
}
See Also