Drag and Drop events with Touch.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Commands Trigger
DeltaEngine.Commands InputTrigger
DeltaEngine.Input TouchDragDropTrigger
Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The TouchDragDropTrigger type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TouchDragDropTrigger(Dictionary String, String ) | Initializes a new instance of the TouchDragDropTrigger class | |
TouchDragDropTrigger(Rectangle) | Initializes a new instance of the TouchDragDropTrigger class |
Methods
Name | Description | |
---|---|---|
Add T | (Inherited from Entity.) | |
AddTag | (Inherited from Entity.) | |
ClearTags | (Inherited from Entity.) | |
Contains T | (Inherited from Entity.) | |
ContainsBehavior T | (Inherited from Entity.) | |
ContainsTag | (Inherited from Entity.) | |
Deactivate | (Inherited from Entity.) | |
Dispose | (Inherited from Entity.) | |
Get T |
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D)
View code on GitHub (Inherited from Entity.) | |
GetActiveBehaviors | (Inherited from Entity.) | |
GetComponentsForSaving | (Inherited from Entity.) | |
GetOrDefault T | (Inherited from Entity.) | |
GetTags | (Inherited from Entity.) | |
HandleWithTouch | ||
Invoke | (Inherited from Trigger.) | |
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
Set | (Inherited from Entity.) | |
SetComponents | (Inherited from Entity.) | |
Start T | (Inherited from Entity.) | |
StartInputDevice | (Overrides InputTrigger StartInputDevice .) | |
Stop T | (Inherited from Entity.) | |
ToString | (Inherited from Entity.) | |
Update | (Inherited from Trigger.) |
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) | |
Invoked | (Inherited from Trigger.) |
Properties
Name | Description | |
---|---|---|
IsActive | (Inherited from Entity.) | |
IsPauseable | (Inherited from Trigger.) | |
NumberOfComponents | (Inherited from Entity.) | |
StartArea | ||
StartDragPosition | ||
UpdatePriority | (Inherited from Entity.) | |
WasInvokedThisTick | (Inherited from Trigger.) |
Remarks
Examples
[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