Moai SDK
2.0
|
Function List | |
countTouches | |
down | |
getActiveTouches | |
getCenterLoc | |
getTouch | |
hasTouches | |
isDown | |
setAcceptCancel | |
setCallback | |
setTapMargin | |
setTapTime | |
up | |
|
|
Return the number of currently active touches.
function countTouches ( MOAITouchSensor self )
MOAITouchSensor | self |
|
Checks to see if the screen was touched during the last iteration.
function down ( MOAITouchSensor self [, number idx ] )
MOAITouchSensor | self |
number | idx Optional. Index of touch to check. |
|
Returns the IDs of all of the touches currently occurring (for use with getTouch).
function getActiveTouches ( MOAITouchSensor self )
MOAITouchSensor | self |
|
Get the center coordinate of all currently active touches (as a simple average of all active touch coordinates). Returns nil if no current active touches.
function getCenterLoc ( MOAITouchSensor self )
MOAITouchSensor | self |
|
Checks to see if there are currently touches being made on the screen.
function getTouch ( MOAITouchSensor self, number id )
MOAITouchSensor | self |
number | id The ID of the touch. |
|
Checks to see if there are currently touches being made on the screen.
function hasTouches ( MOAITouchSensor self )
MOAITouchSensor | self |
|
Checks to see if the touch status is currently down.
function isDown ( MOAITouchSensor self [, number idx ] )
MOAITouchSensor | self |
number | idx Optional. Index of touch to check. |
|
Sets whether or not to accept cancel events ( these happen on iOS backgrounding ), default value is false.
function setAcceptCancel ( MOAITouchSensor self, boolean accept )
MOAITouchSensor | self |
boolean | accept true then touch cancel events will be sent |
|
Sets or clears the callback to be issued when the pointer location changes.
function setCallback ( MOAITouchSensor self [, function callback ] )
MOAITouchSensor | self |
function | callback Optional. Default value is nil. |
|
Sets maximum distance between two touches for them to be considered a tap.
function setTapMargin ( MOAITouchSensor self, number margin )
MOAITouchSensor | self |
number | margin Max difference on x and y between taps |
|
Sets the time between each touch for it to be counted as a tap.
function setTapTime ( MOAITouchSensor self, number time )
MOAITouchSensor | self |
number | time New time between taps |
|
Checks to see if the screen was untouched (is no longer being touched) during the last iteration.
function up ( MOAITouchSensor self [, number idx ] )
MOAITouchSensor | self |
number | idx Optional. Index of touch to check. |