MobileComponent
Summary
This component is responsible for configuring Wanaplan on mobile devices. It adapts graphics, adds a mobile stylesheet and removes some unecessary components.
Constructor
MobileComponent
Syntax
MobileComponent
-
core
-
forceNoDirty
Summary
Parameters:
-
core
CoreThe main engine.
-
forceNoDirty
BooleanIf true, forces this component to be clean.
Item Index
Methods
Methods
_toggleMenu
Syntax
_toggleMenu
()
Summary
Toggle the visibility of the left menu.
Triggered on event wnp.mobile.toggleMenu
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
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
Disables/Removes some unecessary components and applies the mobile configuration.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
onCoreInitialized
Syntax
onCoreInitialized
-
event
Summary
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
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.update
Syntax
update
()
Summary
Generic update method, called on every frameProperties
priority
Syntax
priority
Number
Summary
Priority of the component in the "update" and "draw" routinesstructure
Syntax
structure
wnp.Structure
Summary
Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is savedEvents
wnp.mobile.toggleMenu
Syntax
wnp.mobile.toggleMenu
Summary
Fired to show/hide the left menu on mobile devices