API Docs for: 2.7.3
Show:

BaseComponent2D Class

Module: Component
Parent Module: Wanaplan

Base class for 2D components.

Constructor

BaseComponent2D

(
  • core
  • name
)

Parameters:

  • core wnp.Core

    Core instance

  • name String

    Component name

Methods

destroy

()

Method called when the component is destroyed

disable

()

Disables the component

enable

()

Enables the component

getTargeted

(
  • vector
)
Object

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

()

Method called when Wanaplan is initialized. You don't need to call this method manually.

onContextChanged

(
  • context
)

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

Parameters:

  • context String

    The new context

startListening

()

Calls all the event listeners.

stopListening

()

Removes all the event listeners.

update

()

Generic update method, called on every frame

Properties

name

String

Component name

priority

Number

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

structure

wnp.Structure

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