Home Reference Source
import GestureListener from 'oxygen-core/components/GestureListener.js'
public class | source

GestureListener

Extends:

ComponentScript → GestureListener

Entity listener for mouse input (good for buttons logic).

Example:

const component = new GestureListener();
component.deserialize({ camera: '/ui' });

Static Member Summary

Static Public Members
public static get
public static get

Static Method Summary

Static Public Methods
public static

Component factory.

Constructor Summary

Public Constructor
public

Constructor.

Member Summary

Public Members
public get

actions: *

public set
public get
public set
public get
public set

Method Summary

Public Methods
public
public
public

onMouseDown(unitVec: *, screenVec: *)

public

onMouseMove(unitVec: *, screenVec: *)

public

onMouseUp(unitVec: *, screenVec: *)

public

onPropertySerialize(name: *, value: *): *

public

onPropertySetup(name: *, value: *)

public

onTouchDown(unitVec: *, screenVec: *)

public

onTouchMove(unitVec: *, screenVec: *)

public

onTouchUp(unitVec: *, screenVec: *)

Inherited Summary

From class Component
public static get
public static

Component factory.

public get
public

[name]: *

public

deserialize(json: *)

Deserialize JSON properties into this component.

public

Destructor (dispose internal resources and detach from entity).

public

onAction(name: string, args: *)

Called when action arrived.

public

onAlterActionArguments(name: string, args: *): array | undefined

Called when asked to alter arrived action parameters.

public

Called after attached to entity.

public

Called before detached from entity.

public

onPropertySerialize(name: string, value: *): *

Called when property is serialized.

public

onPropertySetup(name: string, value: *)

Called when given property is deserialized.

public

serialize(): *

Serialize component into JSON data.

From class Script
public static get
public static get

propsTypes: {"listenTo": *}

public static

factory(): *

public get
public set
public
public

onAction(name: *, args: ...*): *

public
public

onContactBegin(body: *, contact: *)

public

onContactEnd(body: *, contact: *)

public
public

onGamepadConnected(gamepad: *)

public

onGamepadDisconnected(gamepad: *)

public

onGamepadProcess(gamepad: *)

public

onKeyDown(code: *)

public

onKeyUp(code: *)

public

onMouseDown(unitVec: *, screenVec: *, button: *)

public

onMouseMove(unitVec: *, screenVec: *)

public

onMouseUp(unitVec: *, screenVec: *, button: *)

public

onPreview(gl: *, renderer: *, deltaTime: *)

public

onPropertySerialize(name: *, value: *): *

public

onPropertySetup(name: *, value: *)

public

onRender(gl: *, renderer: *, deltaTime: *, layer: *)

public

onRenderLayer(gl: *, renderer: *, deltaTime: *, layer: *)

public

onTouchDown(unitVec: *, screenVec: *, identifier: *)

public

onTouchMove(unitVec: *, screenVec: *, identifier: *)

public

onTouchUp(unitVec: *, screenVec: *, identifier: *)

public

onUpdate(deltaTime: *)

Static Public Members

public static get ActionFlags: * source

public static get propsTypes: * source

Override:

Script#propsTypes

Static Public Methods

public static factory(): GestureListener source

Component factory.

Override:

Script#factory

Return:

GestureListener

Component factory.

Public Constructors

public constructor() source

Constructor.

Override:

Script#constructor

Public Members

public get actions: * source

public set actions source

public get camera: string | null source

public set camera: string | null source

public get layer: string | null source

public set layer: string | null source

Public Methods

public dispose() source

Destructor (dispose internal resources and detach from entity).

Override:

Script#dispose

public onAttach() source

Called after attached to entity.

Override:

Script#onAttach

public onMouseDown(unitVec: *, screenVec: *) source

Override:

Script#onMouseDown

Params:

NameTypeAttributeDescription
unitVec *
screenVec *

public onMouseMove(unitVec: *, screenVec: *) source

Override:

Script#onMouseMove

Params:

NameTypeAttributeDescription
unitVec *
screenVec *

public onMouseUp(unitVec: *, screenVec: *) source

Override:

Script#onMouseUp

Params:

NameTypeAttributeDescription
unitVec *
screenVec *

public onPropertySerialize(name: *, value: *): * source

Called when property is serialized.

Override:

Script#onPropertySerialize

Params:

NameTypeAttributeDescription
name *
value *

Return:

*

public onPropertySetup(name: *, value: *) source

Called when given property is deserialized.

Override:

Script#onPropertySetup

Params:

NameTypeAttributeDescription
name *
value *

public onTouchDown(unitVec: *, screenVec: *) source

Override:

Script#onTouchDown

Params:

NameTypeAttributeDescription
unitVec *
screenVec *

public onTouchMove(unitVec: *, screenVec: *) source

Override:

Script#onTouchMove

Params:

NameTypeAttributeDescription
unitVec *
screenVec *

public onTouchUp(unitVec: *, screenVec: *) source

Override:

Script#onTouchUp

Params:

NameTypeAttributeDescription
unitVec *
screenVec *