Class R.struct.Touch
A data object which represents a touch event generated by R.components.TouchInput.
Since touches are handled differently across platforms, this class aims to
normalize what is returned and allow a game to handle the input without concern
for platform.
Defined in: touch.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.struct.Touch(touch)
A touch data object.
|
Method Attributes | Method Name and Description |
---|---|
get()
Get a R.math.Point2D which represents the location of the touch
|
|
Get the class name of this object
|
|
getX()
Get the X coordinate of the touch
|
|
getY()
Get the Y coordinate of the touch
|
Class Detail
R.struct.Touch(touch)
A touch data object.
- Parameters:
- touch
- {Event} The touch from the event object
Method Detail
{R.math.Point2D}
get()
Get a R.math.Point2D which represents the location of the touch
- Returns:
- {R.math.Point2D} The coordinates of the touch
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} "R.struct.Touch"
{Number}
getX()
Get the X coordinate of the touch
- Returns:
- {Number} The X coordinate of the touch
{Number}
getY()
Get the Y coordinate of the touch
- Returns:
- {Number} The Y coordinate of the touch