MobileComponent Class
This component is responsible for configuring Wanaplan on mobile devices. It adapts graphics, adds a mobile stylesheet and removes some unecessary components.
Constructor
MobileComponent
(
-
core
-
forceNoDirty
Parameters:
-
core
CoreThe main engine.
-
forceNoDirty
BooleanIf true, forces this component to be clean.
Item Index
Methods
Methods
_toggleMenu
()
Toggle the visibility of the left menu.
Triggered on event wnp.mobile.toggleMenu
destroy
()
Method called when the component is destroyed
disable
()
Disables the component
enable
()
Enables the component
getTargeted
(
Object
-
vector
Finds out if the given position is over an element handled by the component
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
Object:
The targeted element, or null if nothing is found.
initialize
()
Disables/Removes some unecessary components and applies the mobile configuration.
onContextChanged
(
-
context
Method called when the context is switched (2D -> 3D or 3D -> 2D)
Parameters:
-
context
StringThe new context
onCoreInitialized
(
-
event
Applies configuration for mobile (graphics, performances). This method is called after all components are initialized.
Triggered on event wnp.core.initialized
Parameters:
-
event
EventThe event object.
startListening
()
Calls all the event listeners.
stopListening
()
Removes all the event listeners.
update
()
Generic update method, called on every frame
Properties
structure
wnp.Structure
Structure file instance (shortcut to wanaplan.structure).
This is the base object where the whole plan is saved
Events
wnp.mobile.toggleMenu
Fired to show/hide the left menu on mobile devices