WanaPlan

API Docs for: 2.7.0
Show:

DGM_ZoomComponent

Extends BaseComponent2D
Module: Wanaplan

Summary

This component is used to zoom or dezoom the 2D canvas with a double tap on the screen. Double tap on the left of the screen for a dezoom and on the right of the screen for a zoom. The zoom factor can be modified. It's possible to use this feature with a the double click mouse event.

Constructor

DGM_ZoomComponent

Syntax

DGM_ZoomComponent

(
  • core
)

Summary

Parameters:

  • core Core

    The main engine.

Methods

_onDoubleTap

Syntax

_onDoubleTap

(
  • event
)
private

Summary

Called on a double tap/dougle click event. It increases or decreases the zoom.

Parameters:

destroy

Inherited from BaseComponent2D:

Syntax

destroy

()

Summary

Method called when the component is destroyed

disable

Inherited from BaseComponent2D:

Syntax

disable

()

Summary

Disables the component

enable

Inherited from BaseComponent2D:

Syntax

enable

()

Summary

Enables the component

getTargeted

Inherited from BaseComponent2D:

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.

getZoomFactor

Syntax

getZoomFactor

() Number

Summary

Gets the zoom factor.

Returns:

Number:

Returns the zoom factor.

initialize

Inherited from BaseComponent2D

Syntax

initialize

()

Summary

Initializes the component.

onContextChanged

Inherited from BaseComponent2D:

Syntax

onContextChanged

(
  • context
)

Summary

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

Parameters:

  • context String

    The new context

setMouseEnabled

Syntax

setMouseEnabled

(
  • enabled
)

Summary

Enabled or disable the mouse support.

Parameters:

  • enabled Boolean

    Set to true to enable the mouse support, otherwise set it to false.

setZoomFactor

Syntax

setZoomFactor

(
  • zoomFactor
)

Summary

Sets the zoom factor.

Parameters:

  • zoomFactor Number

    The desired zoom factor.

startListening

Inherited from BaseComponent2D

Syntax

startListening

()

Summary

Starts the event listeners.

stopListening

Inherited from BaseComponent2D

Syntax

stopListening

()

Summary

Stop the event listeners.

update

Inherited from BaseComponent2D:

Syntax

update

()

Summary

Generic update method, called on every frame

Properties

name

Inherited from BaseComponent2D:

Syntax

name

String

Summary

Component name

priority

Inherited from BaseComponent2D:

Syntax

priority

Number

Summary

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

structure

Inherited from BaseComponent2D:

Syntax

structure

wnp.Structure

Summary

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