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:
-
core
CoreThe 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:
-
event
ObjectThe 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:
-
vector
VectorA 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:
-
context
StringThe new context
setMouseEnabled
Syntax
setMouseEnabled
-
enabled
Summary
Enabled or disable the mouse support.
Parameters:
-
enabled
BooleanSet to
true
to enable the mouse support, otherwise set it tofalse
.
setZoomFactor
Syntax
setZoomFactor
-
zoomFactor
Summary
Sets the zoom factor.
Parameters:
-
zoomFactor
NumberThe desired zoom factor.
startListening
Syntax
startListening
()
Summary
Starts the event listeners.
stopListening
Syntax
stopListening
()
Summary
Stop the event listeners.