Static methods

@:value({ num : 0 })staticget(num:Int = 0):Surface

Get current Surface.

Parameters:

num

(optional) surface id (0 by default).

staticsetTouchDownEventBlockBehavior(behavior:TouchDownEventBlockBehavior):Void

Allows fine grained control of touch down browser default actions (html5 only).

Parameters:

behavior

can be: Full - block touch down events. None - do not block touch down events. Custom(func:(event:TouchEvent)->Bool) - set custom handler for touch down event (should return true if touch down event blocked).

Methods

notify(?touchStartListener:(id:Int, x:Int, y:Int) ‑> Void, ?touchEndListener:(id:Int, x:Int, y:Int) ‑> Void, ?moveListener:(id:Int, x:Int, y:Int) ‑> Void):Void

Creates event handlers from passed functions.

Parameters:

touchStartListener

(optional) function with id:Int,x:Int,y:Int arguments, fired when a surface is pressed down. The finger id goes from 0 increasing by one. When the finger releases the screen, the old id is freed up and will be occupied with pressing the next finger (when releasing a finger, the shift of ids does not occur).

touchEndListener

(optional) function with id:Int,x:Int,y:Int arguments, fired when a surface is released.

moveListener

(optional) function with id:Int,x:Int,y:Int arguments, fired when a surface is moved.

remove(?touchStartListener:(id:Int, x:Int, y:Int) ‑> Void, ?touchEndListener:(id:Int, x:Int, y:Int) ‑> Void, ?moveListener:(id:Int, x:Int, y:Int) ‑> Void):Void

Removes event handlers from the passed functions that were passed to notify function.