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 |
canStartTransformation(PinchGesture gesture)
|
| float | |
| float | |
| float | |
| float | |
| void | |
| void |
onContinueTransformation(PinchGesture gesture)
|
| void |
onEndTransformation(PinchGesture gesture)
|
| void |
onUpdated(Node node, FrameTime frameTime)
Notifies the listener that
onUpdate(FrameTime) was called. |
| 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 float getElasticity ()
public float getMaxScale ()
public float getMinScale ()
public float getSensitivity ()
public void onActivated (Node node)
Notifies the listener that onActivate() was called.
Parameters
| node | the node that was activated |
|---|
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 |
public void setElasticity (float elasticity)
Parameters
| elasticity |
|---|
public void setMaxScale (float maxScale)
Parameters
| maxScale |
|---|
public void setMinScale (float minScale)
Parameters
| minScale |
|---|
public void setSensitivity (float sensitivity)
Parameters
| sensitivity |
|---|