Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Input.Tests.TouchPinchTriggerTests
2 unit tests call DeltaEngine.Input.Touch.GetPosition(System.Int32)
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- touchIndex
- Type: System Int32
Return Value
Type: Vector2DRemarks
Examples
[Test] public void ShowRedCircleOnPinch() { new FontText(Font.Default, "Pinch screen to show red circle", Rectangle.One); var ellipse = new Ellipse(new Rectangle(0.1f, 0.1f, 0.1f, 0.1f), Color.Red); var trigger = new TouchPinchTrigger(); var touch = Resolve<Touch>(); new Command(() => //ncrunch: no coverage start { ellipse.Center = touch.GetPosition(0); ellipse.Size = new Size(trigger.ZoomAmount * 0.5f); }).Add(trigger); //ncrunch: no coverage end }
[Test] public void ShowRedSquare() { new FontText(Font.Default, "Pinch screen to show red circle", Rectangle.One); var rect = new FilledRect(new Rectangle(0.1f, 0.1f, 0.1f, 0.1f), Color.Red); var trigger = new TouchRotateTrigger(); var touch = Resolve<Touch>(); new Command(() => //ncrunch: no coverage start { rect.Center = touch.GetPosition(0); rect.RotationCenter = rect.Center; rect.Rotation = trigger.Angle; }).Add(trigger); //ncrunch: no coverage end }
See Also