Overview
The onTouch() method of a Display object can be defined.
This method handles touch events and is called when the events are occurred.
Syntax
Here, dispobj is a Display object such as image or shapes. The argument e is a table that has the following fields.
• phase : (string) this has four cases as follows.
• 'begin' : touch began
• 'move' : touch point is moving.
• 'end' : touch ended
• 'cancel' : touch cancelled
• x : the x-coordinates of touch point
• y : the y-coordinates of touch point
• dx : the deviations of x coordinates at 'move' phase. At 'begin' phase, it is zero.
• dy : the deviations of y coordinates at 'move' phase. At 'begin' phase, it is zero.
• id : touch id (in case of multiple touches, this distinguishes between them)
Examples
댓글 없음:
댓글 쓰기