API Docs for: 2.7.3
Show:

DGM_ZoomComponent Class

Extends BaseComponent2D
Module: Wanaplan

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

(
  • core
)

Parameters:

  • core Core

    The main engine.

Methods

_onDoubleTap

(
  • event
)
private

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

Parameters:

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.

getZoomFactor

() Number

Gets the zoom factor.

Returns:

Number:

Returns the zoom factor.

initialize

()

Inherited from BaseComponent2D

Initializes the component.

onContextChanged

(
  • context
)

Inherited from BaseComponent2D:

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

Parameters:

  • context String

    The new context

setMouseEnabled

(
  • enabled
)

Enabled or disable the mouse support.

Parameters:

  • enabled Boolean

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

setZoomFactor

(
  • zoomFactor
)

Sets the zoom factor.

Parameters:

  • zoomFactor Number

    The desired zoom factor.

startListening

()

Inherited from BaseComponent2D

Starts the event listeners.

stopListening

()

Inherited from BaseComponent2D

Stop 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