ScaleController

public class ScaleController

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

ScaleController(BaseTransformableNode transformableNode, PinchGestureRecognizer gestureRecognizer)

Public Methods

boolean
float
float
float
float
void
onActivated(Node node)
Notifies the listener that onActivate() was called.
void
void
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

Constant Value: 0.15

public static final float DEFAULT_MAX_SCALE

Constant Value: 1.75

public static final float DEFAULT_MIN_SCALE

Constant Value: 0.75

public static final float DEFAULT_SENSITIVITY

Constant Value: 0.75

Public Constructors

public ScaleController (BaseTransformableNode transformableNode, PinchGestureRecognizer gestureRecognizer)

Parameters
transformableNode
gestureRecognizer

Public Methods

public boolean canStartTransformation (PinchGesture gesture)

Parameters
gesture

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 onContinueTransformation (PinchGesture gesture)

Parameters
gesture

public void onEndTransformation (PinchGesture gesture)

Parameters
gesture

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