A game framework written with osu! in mind.
at master 1.2 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using osu.Framework.Input.States; 5using osuTK; 6 7namespace osu.Framework.Input.Events 8{ 9 /// <summary> 10 /// Represents a touch motion event. 11 /// </summary> 12 public class TouchMoveEvent : TouchEvent 13 { 14 /// <summary> 15 /// The last touch position in the screen space. 16 /// </summary> 17 public readonly Vector2 ScreenSpaceLastTouchPosition; 18 19 /// <summary> 20 /// The last touch position in local space. 21 /// </summary> 22 public Vector2 LastTouchPosition => ToLocalSpace(ScreenSpaceLastTouchPosition); 23 24 /// <summary> 25 /// The difference of touch position from last position to current position in local space. 26 /// </summary> 27 public Vector2 Delta => Touch.Position - LastTouchPosition; 28 29 public TouchMoveEvent(InputState state, Touch touch, Vector2? screenSpaceTouchDownPosition, Vector2 screenSpaceLastTouchPosition) 30 : base(state, touch, screenSpaceTouchDownPosition) 31 { 32 ScreenSpaceLastTouchPosition = screenSpaceLastTouchPosition; 33 } 34 } 35}