class flixel.input.touch.FlxTouch extends FlxPoint implements IFlxDestroyable

Available on all platforms

Helper class, contains and track touch points in your game. * Automatically accounts for parallax scrolling, etc.

Instance Fields

var touchPointID:Int

The unique ID of this touch. Example: if there are 3 concurrently active touches * (and the device supporst that many), they will have the IDs 0, 1 and 2.

function deactivate():Void

function destroy():Void

Clean up memory.

function getScreenPosition(?Camera:FlxCamera = null, ?point:FlxPoint = null):FlxPoint

Fetch the screen position of the touch on any given camera. * NOTE: Touch.screenX and Touch.screenY also store the screen position of the touch point on the main camera. * *

Camera

If unspecified, first/main global camera is used instead. *

point

An existing point object to store the results (if you don't want a new one created). *

returns

The touch point's location in screen space.

function getWorldPosition(?Camera:FlxCamera = null, ?point:FlxPoint = null):FlxPoint

Fetch the world position of the touch on any given camera. * NOTE: Touch.x and Touch.y also store the world position of the touch point on the main camera. * *

Camera

If unspecified, first/main global camera is used instead. *

point

An existing point object to store the results (if you don't want a new one created). *

returns

The touch point's location in world space.

function overlaps(ObjectOrGroup:FlxBasic, ?Camera:FlxCamera = null):Bool

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. * If the group has a LOT of things in it, it might be faster to use FlxG.overlaps(). * WARNING: Currently tilemaps do NOT support screen space overlap checks! * *

ObjectOrGroup

The object or group being tested. *

Camera

Specify which game camera you want. If null getScreenXY() will just grab the first global camera. *

returns

Whether or not the two objects overlap.

function reset(X:Float, Y:Float, PointID:Int):Void

Resets the just pressed/just released flags and sets touch to not pressed.