Skip to main content

PanInput

class PanInput

A module that passes the amount of change to eg.Axes when the mouse or touchscreen is down and moved. use less than two axes.

constructor

new PanInput(element, options)
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
elementString | HTMLElement | Ref.<HTMLElement> | jQueryAn element to use the eg.Axes.PanInput module
optionsPanInputOption✔️{}The option object of the eg.Axes.PanInput module
const pan = new eg.Axes.PanInput("#area", {
inputType: ["touch"],
scale: [1, 1.3],
});

// Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
// Connect the 'somethingN' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
axes.connect(["something2", "somethingN"], pan); // or axes.connect("something2 somethingN", pan);

// Connect only one 'something1' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
axes.connect(["something1"], pan); // or axes.connect("something1", pan);

// Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
axes.connect(["", "something2"], pan); // or axes.connect(" something2", pan);

Methods

destroy

Destroys elements, properties, and events used in a module.

enable

Enables input devices

Returns: PanInput

  • An instance of a module itself

disable

Disables input devices

Returns: PanInput

  • An instance of a module itself

isEnabled

Returns whether to use an input device

Returns: Boolean

  • Whether to use an input device

release

Releases current user input.

Returns: PanInput

  • An instance of a module itself