Utility class for handling touch input within the FlxG context.

Static variables

staticread onlyjustMoved:Bool

Indicates if any touch is moved this frame.

staticread onlyjustPressed:Bool

Indicates if any touch was just pressed this frame.

staticread onlyjustReleased:Bool

Indicates if any touch was just released this frame.

staticread onlypressed:Bool

Indicates if any touch is currently pressed.

staticread onlyreleased:Bool

Indicates if any touch is released this frame.

staticread onlytouch:FlxMouse

The first touch in the FlxG.touches list.

Static methods

staticoverlaps(?object:FlxBasic, ?camera:FlxCamera):Bool

Checks if the specified object overlaps with any active touch.

Parameters:

object

The FlxBasic object to check for overlap.

camera

Optional camera for the overlap check. Defaults to the object's camera.

Returns:

true if there is an overlap with any touch; false otherwise.

staticoverlapsComplex(?object:FlxObject, ?camera:FlxCamera):Bool

Checks if the specified object overlaps with any active touch using precise point checks.

Parameters:

object

The FlxObject to check for overlap.

camera

Optional camera for the overlap check. Defaults to all cameras of the object.

Returns:

true if there is a precise overlap with any touch; false otherwise.

@:value({ inScreenSpace : false })staticoverlapsComplexPoint(?object:FlxObject, point:FlxPoint, inScreenSpace:Bool = false, ?camera:FlxCamera):Bool

Checks if the specified object overlaps with a specific point using precise point checks.

Parameters:

object

The FlxObject to check for overlap.

point

The FlxPoint to check against the object.

inScreenSpace

Whether to take scroll factors into account when checking for overlap.

camera

Optional camera for the overlap check. Defaults to all cameras of the object.

Returns:

true if there is a precise overlap with the specified point; false otherwise.

@:value({ useOverlapsComplex : true })staticpressAction(?object:FlxBasic, ?camera:FlxCamera, useOverlapsComplex:Bool = true):Bool

A helper function to check if the selection is pressed using touch.

Parameters:

object

The optional FlxBasic to check for overlap.

camera

Optional camera for the overlap check. Defaults to all cameras of the object.

useOverlapsComplex

If true and atleast the object is not null, the function will use complex overlaps method.