Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flixel/input/touch/FlxTouch.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package flixel.input.touch;

#if FLX_TOUCH
import haxe.Int64;
import openfl.geom.Point;
import flixel.FlxG;
import flixel.input.FlxInput;
Expand Down Expand Up @@ -29,6 +30,11 @@ class FlxTouch extends FlxPointer implements IFlxDestroyable implements IFlxInpu
*/
public var pressure(default, null):Float;

/**
* The time (in nanoseconds) in which this touch happened.
*/
public var timestamp(default, null):Int64;

/**
* Check to see if this touch has just been moved upwards.
*/
Expand Down
3 changes: 3 additions & 0 deletions flixel/input/touch/FlxTouchManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class FlxTouchManager implements IFlxInputManager
{
touch = recycle(Std.int(FlashEvent.stageX), Std.int(FlashEvent.stageY), FlashEvent.touchPointID, FlashEvent.pressure);
}
touch.timestamp = FlashEvent.timestamp;
touch.input.press();
}

Expand All @@ -205,6 +206,7 @@ class FlxTouchManager implements IFlxInputManager

if (touch != null)
{
touch.timestamp = FlashEvent.timestamp;
touch.input.release();
}
}
Expand All @@ -220,6 +222,7 @@ class FlxTouchManager implements IFlxInputManager
{
touch.setXY(Std.int(FlashEvent.stageX), Std.int(FlashEvent.stageY));
touch.pressure = FlashEvent.pressure;
touch.timestamp = FlashEvent.timestamp;
}
}

Expand Down
Loading