ScaleController

public class ScaleController

使用双指张合 PinchGestureRecognizer 操控 BaseTransformableNode 的缩放。将 BaseTransformableNode 缩放到低于最小值/最大值范围时,应用可调性弹跳。

常量

float 默认时区
float DEFAULT_MAX_SCALE
float DEFAULT_MIN_SCALE
float DEFAULT_SENSITIVITY

公共构造函数

ScaleControllerBaseTransformableNode 可变节点、PinchGestureRecognizer gestureRecognizer)

公共方法

布尔值
浮点数
浮点数
浮点数
浮点数
无效
onActivated节点节点)
向监听器发出调用 onActivate() 的通知。
无效
无效
无效
onUpdatedNode 节点、FrameTime frameTime)
向监听器发出调用 onUpdate(FrameTime) 的通知。
无效
setElasticity(浮点弹性)
无效
setMaxScale(float maxScale)
无效
setMinScale(浮点数下限)
无效
setSensitivity(浮点灵敏度)

继承的方法

常量

public static final float DEFAULT_ELASTIcity

常量值0.15

public static final float DEFAULT_MAX_SCALE

常量值1.75

public static final float DEFAULT_MIN_SCALE

常量值0.75

public static final float DEFAULT_SENSITIVITY

常量值0.75

公共构造函数

public ScaleController BaseTransformableNode 可变形节点、PinchGestureRecognizer gestureRecognizer)

参数
可变形节点
手势识别器

公共方法

布尔值 canStartTransformation (PinchGesture 手势)

参数
手势

public float getElasticity ()

public float getMaxScale ()

public float getMinScale ()

公开浮点数 getSensitivity ()

public void onActivated (Node Node)

向监听器发出调用 onActivate() 的通知。

参数
节点 已激活的节点

public void onContinueTransformation (PinchGesture 手势)

参数
手势

public void onEndTransformation (PinchGesture 手势)

参数
手势

public void onUpdated (Node Node, FrameTime frameTime)

向监听器发出调用 onUpdate(FrameTime) 的通知。

参数
节点 已更新的节点
帧时间 提供当前帧的时间信息

public void setElasticity (float elasteity)

参数
弹性

public void setMaxScale (float maxScale)

参数
最大比例

public void setMinScale (float minScale)

参数
最小缩放

public void setSensitivity (float sensitivity)

参数
灵敏度