API Docs for: 2.7.3
Show:

MobileComponent Class

Extends BaseComponent2D
Module: Component
Parent Module: Wanaplan

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 Core

    The main engine.

  • forceNoDirty Boolean

    If true, forces this component to be clean.

Methods

_toggleMenu

()

Toggle the visibility of the left menu. Triggered on event wnp.mobile.toggleMenu

destroy

()

Inherited from BaseComponent2D:

Method called when the component is destroyed

disable

()

Inherited from BaseComponent2D:

Disables the component

enable

()

Inherited from BaseComponent2D:

Enables the component

getTargeted

(
  • vector
)
Object

Inherited from BaseComponent2D:

Finds out if the given position is over an element handled by the component

Parameters:

  • vector Vector

    A position, usually the cursor's one.

Returns:

Object:

The targeted element, or null if nothing is found.

initialize

()

Inherited from BaseComponent2D

Disables/Removes some unecessary components and applies the mobile configuration.

onContextChanged

(
  • context
)

Inherited from BaseComponent2D:

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String
    The 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 Event

    The event object.

startListening

()

Inherited from BaseComponent2D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent2D:

Removes all the event listeners.

update

()

Inherited from BaseComponent2D:

Generic update method, called on every frame

Properties

name

String

Inherited from BaseComponent2D:

Component name

priority

Number

Inherited from BaseComponent2D:

Priority of the component in the "update" and "draw" routines

structure

wnp.Structure

Inherited from BaseComponent2D:

Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is saved

Events

wnp.menu.top.sub.add

Fired to add a menu item into the sub menu.

wnp.menu.top.sub.replace

Fired to replace a sub menu item.

wnp.mobile.toggleMenu

Fired to show/hide the left menu on mobile devices