Page Summary
-
ScaleControllerenables scaling ofBaseTransformableNodeobjects using pinch gestures. -
It provides elastic bounce-back when scaling beyond predefined minimum and maximum limits.
-
Sensitivity, elasticity, minimum and maximum scale can be adjusted using the provided methods.
-
The
ScaleControlleris triggered byPinchGestureRecognizerevents to manipulate the target node's scale.
Manipulates the Scale of a BaseTransformableNode
using a Pinch PinchGestureRecognizer
. Applies a tunable elastic bounce-back when scaling the BaseTransformableNode
beyond the min/max scale.
Constants
| float | DEFAULT_ELASTICITY | * |
| float | DEFAULT_MAX_SCALE | * |
|---|---|---|
| float | DEFAULT_MIN_SCALE | * |
| float | DEFAULT_SENSITIVITY | * |
Public Constructors
Public Methods
| boolean | |
| float | |
| float | getMaxScale
()
|
| float | getMinScale
()
|
| float | |
| void | |
| void | |
| void | |
| void | |
| void | setElasticity
(float elasticity)
|
| void | setMaxScale
(float maxScale)
|
| void | setMinScale
(float minScale)
|
| void | setSensitivity
(float sensitivity)
|
Inherited Methods
Constants
public static final float DEFAULT_ELASTICITY
public static final float DEFAULT_MAX_SCALE
public static final float DEFAULT_MIN_SCALE
public static final float DEFAULT_SENSITIVITY
Public Constructors
public ScaleController ( BaseTransformableNode transformableNode, PinchGestureRecognizer gestureRecognizer)
Parameters
| transformableNode |
|---|
| gestureRecognizer |
Public Methods
public boolean canStartTransformation ( PinchGesture gesture)
Parameters
public float getElasticity ()
public float getMaxScale ()
public float getMinScale ()
public float getSensitivity ()
public void onActivated ( Node node)
Notifies the listener that onActivate()
was called.
Parameters
public void onContinueTransformation ( PinchGesture gesture)
Parameters
public void onEndTransformation ( PinchGesture gesture)
Parameters
public void onUpdated ( Node node, FrameTime frameTime)
Notifies the listener that onUpdate(FrameTime)
was called.
Parameters
| node | the node that was updated |
|---|---|
| frameTime | provides time information for the current frame |

