TouchMoveEvent
Lens Studio v1.0.0+
Scripting Name: TouchMoveEvent
Inherits from SceneObjectEvent
Description
Triggered when a touch position on the screen is moved.
Methods
getTouchId()
: Number
Returns the ID of this specific touch. Useful for distinguishing between touches when multiple are occurring simultaneously.
getTouchPosition()
: vec2
Returns the normalized 2D screen position of the user’s touch. The normalized coordinates range from ([0-1], [0-1]), (0,0) being top-left and (1,1) being bottom-right.
Inherited Methods
getSceneObject()
: SceneObject
Returns the SceneObject this Event is associated with.
bind(function evCallback)
: void
Binds a callback function to this event.
getTypeName()
: String
Returns the typename of the SceneEvent.
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Inherited Properties
enabled
: Boolean
If true, the event is able to trigger. If false, the event will not trigger.
Examples
// Prints "touch move" when the touch position on the screen has moved
var event = script.createEvent("TouchMoveEvent");
event.bind(function(eventData)
{
print("touch move");
});
Still Looking for help?
Visit Support