DGM_ZoomComponent
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:
-
coreCoreThe main engine.
Item Index
Methods
Methods
_onDoubleTap
Syntax
_onDoubleTap
-
event
Summary
Called on a double tap/dougle click event. It increases or decreases the zoom.
Parameters:
-
eventObjectThe event.
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vectorVectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Initializes the component.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
contextStringThe new context
setMouseEnabled
Syntax
setMouseEnabled
-
enabled
Summary
Enabled or disable the mouse support.
Parameters:
-
enabledBooleanSet to
trueto enable the mouse support, otherwise set it tofalse.
setZoomFactor
Syntax
setZoomFactor
-
zoomFactor
Summary
Sets the zoom factor.
Parameters:
-
zoomFactorNumberThe desired zoom factor.
startListening
Syntax
startListening
()
Summary
Starts the event listeners.
stopListening
Syntax
stopListening
()
Summary
Stop the event listeners.