Lens Scripting API

    Class TouchStartEvent

    Triggered when a touch event starts.

    // Prints the touch position when a screen touch has started
    var event = script.createEvent("TouchStartEvent");
    event.bind(function(eventData)
    {
    var touchedPos = eventData.getTouchPosition();
    print("touch started at " + touchedPos.x + " " + touchedPos.y);
    });

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    enabled: boolean

    If true, the event is able to trigger. If false, the event will not trigger.

    Methods

    • Binds a callback function to this event.

      Parameters

      • evCallback: (arg1: this) => void

      Returns void

    • Returns the ID of this specific touch. Useful for distinguishing between touches when multiple are occurring simultaneously.

      Returns number

    • Returns the normalized 2D screen position of the users touch. The normalized coordinates range from ([0-1], [0-1]), (0,0) being top-left and (1,1) being bottom-right.

      Returns vec2

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR