ScaleController

公開類別 ScaleController

使用雙指撥動 PinchGestureRecognizer 操控 BaseTransformableNode 的體重計。在將 BaseTransformableNode 擴充至最小/最大尺寸時,套用可調整的彈性返回機制。

常數

浮動 DEFAULT_ELASTICITY
浮動 DEFAULT_MAX_SCALE
浮動 DEFAULT_MIN_SCALE
浮動 DEFAULT_SENSITIVITY

公用建構函式

ScaleController (BaseTransformableNode conversionableNode、PetteGestureRecognizer 手勢辨識)

公用方法

布林
浮點值
浮點值
浮點值
浮點值
void
onActivated (Node 節點)
通知事件監聽器已呼叫 onActivate()
void
void
void
onUpdated(Node 節點、FrameTime frameTime)
通知事件監聽器已呼叫 onUpdate(FrameTime)
void
setElasticity (浮點彈性)
void
setMaxScale (浮動浮點值)
void
setMinScale (浮點值)
void
setSensitivity (浮點靈敏度)

沿用的方法

常數

public static final float DEFAULT_ELASTICITY

常數值: 0.15

公開靜態最終浮點值 DEFAULT_MAX_SCALE

常數值: 1.75

public static final float DEFAULT_MIN_SCALE

常數值: 0.75

公開靜態 浮動值 DEFAULT_SENSITIVITY

常數值: 0.75

公用建構函式

public ScaleController (BaseTransformableNodetransformableNode、PetteGestureRecognizerGestureRecognizer)

參數
transformableNode
手勢辨識器

公用方法

公開布林值 canStartTransformation (P 雙指手勢 手勢)

參數
手勢

public float getElasticity ()

public float getMaxScale ()

public float getMinScale ()

public float getSensitivity ()

public void onActivated (節點節點)

通知事件監聽器已呼叫 onActivate()

參數
個節點 已啟用的節點

public onContinueTransformation (PetteGesture 手勢)

參數
手勢

public onEndTransformation (PetteGesture 手勢)

參數
手勢

public onUpdated (節點節點、FrameTime frameTime)

通知事件監聽器已呼叫 onUpdate(FrameTime)

參數
個節點 已更新的節點
frametime 提供目前畫格的時間資訊

公開 void setElasticity (浮點彈性)

參數
彈性

public setMaxScale (float maxScale)

參數
最大規模

public setMinScale (float minScale)

參數
minScale

public setSensitivity (浮點敏感度)

參數
靈敏度