MobileInputComponent
Summary
This component is responsible for configuring the correct input mode on mobile devices. It checks the user's input method (touch or mouse). If mouse is detected nothing is done and the component is removed. Otherwise, touch screen support is enabled.
Constructor
MobileInputComponent
Syntax
MobileInputComponent
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_bindListeners
Syntax
_bindListeners
()
Summary
Binds the listeners for input events
_onInputChanged
Syntax
_onInputChanged
-
event
Summary
Called when an input event is detected. It disables the input method that is not necessary (touch or mouse).
Triggered on window events touchstart
, mousemove
, pointerdown
, or MSPointerDown
Parameters:
-
event
EventThe event object.
_unbindListeners.
Syntax
_unbindListeners.
()
Summary
Unbinds the listeners for input events
destroy
Syntax
destroy
()
Summary
Destroys the component and removes all listeners.
disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
removeInputSupport
Syntax
removeInputSupport
-
type
Summary
Removes support of an input method (touch or mouse).
Parameters:
-
type
StringThe type of input method to remove (touch or mouse).