WanaPlan

API Docs for: 2.7.0
Show:

BaseComponent2D

Module: Component
Parent Module: Wanaplan

Summary

Base class for 2D components.

Constructor

BaseComponent2D

Syntax

BaseComponent2D

(
  • core
  • name
)

Summary

Parameters:

  • core wnp.Core

    Core instance

  • name String

    Component name

Methods

destroy

Syntax

destroy

()

Summary

Method called when the component is destroyed

disable

Syntax

disable

()

Summary

Disables the component

enable

Syntax

enable

()

Summary

Enables the component

getTargeted

Syntax

getTargeted

(
  • vector
)
Object

Summary

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

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 String

    The new context

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 frame

Properties

name

Syntax

name

String

Summary

Component name

priority

Syntax

priority

Number

Summary

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

structure

Syntax

structure

wnp.Structure

Summary

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