Touch ClassDelta Engine Documentation
Provides a way to fetch the current input values from a Touch device. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities UpdateBehavior
    DeltaEngine.Input InputDevice
      DeltaEngine.Input Touch
        DeltaEngine.Input.GLFW2 GLFWTouch
        DeltaEngine.Input.GLFW3 GLFWTouch
        DeltaEngine.Input.Mocks MockTouch
        DeltaEngine.Input.SharpDX SharpDXTouch
        DeltaEngine.Input.SlimDX SlimDXTouch
        DeltaEngine.Input.Windows WindowsTouch
        DeltaEngine.Input.Xna.Tests XnaMockTouch
        DeltaEngine.Input.Xna XnaTouch

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

public abstract class Touch : InputDevice

The Touch type exposes the following members.

Constructors

  NameDescription
Protected methodTouch
Initializes a new instance of the Touch class
Top
Methods

  NameDescription
Public methodDispose (Inherited from InputDevice.)
Public methodGetPosition
Public methodGetState
Public methodUpdate (Overrides UpdateBehavior Update(IEnumerable Entity ).)
Top
Properties

  NameDescription
Public propertyIsAvailable (Inherited from InputDevice.)
Top
Remarks

Tests: DeltaEngine.Input.Tests.TouchDoubleTapTriggerTests
Examples

51 unit tests call DeltaEngine.Input.Touch
[Test]
public void ShowRedCircleOnTouch()
{
    new FontText(Font.Default, "Touch screen to show red circle", Rectangle.One);
    var ellipse = new Ellipse(new Rectangle(0.1f, 0.1f, 0.1f, 0.1f), Color.Red);
    new Command(() => ellipse.Center = Vector2D.Half).Add(new TouchDoubleTapTrigger());
    new Command(() => ellipse.Center = Vector2D.Zero).Add(new TouchPressTrigger(State.Released));
}
[Test, CloseAfterFirstFrame]
public void Create()
{
    Assert.DoesNotThrow(() => new TouchDoubleTapTrigger());
}
[Test, CloseAfterFirstFrame]
public void CreateFromAttributes()
{
    Assert.DoesNotThrow(() => new TouchDoubleTapTrigger(new Dictionary<string, string>()));
    Assert.Throws<TouchDoubleTapTrigger.TouchDoubleTapTriggerHasNoParameters>(
        () => new TouchDoubleTapTrigger(new Dictionary<string, string> { { "Button", "Right" } }));
}
See Also