public void moveTween2(float tweenTime, float xPos, float yPos, float zoom=1, bool round=false) { _cameraMoveTween = new Tween(_world, tweenTime); _cameraMoveTween.animate("x", -xPos); _cameraMoveTween.animate("y", -yPos); _cameraMoveTween.transition = Transitions.EASE_OUT; _cameraMoveTween.onComplete = Tween.Call(tweenComplete); _cameraMoveTween.roundToInt = round; _cameraZoomTween = new Tween(_harness, tweenTime); _cameraZoomTween.animate("scaleX", zoom); _cameraZoomTween.animate("scaleY", zoom); _cameraZoomTween.transition = Transitions.EASE_OUT; _cameraZoomTween.roundToInt = false; _juggler.add(_cameraMoveTween); _juggler.add(_cameraZoomTween); }
/** @private */ public static void toPool(Tween tween) { // reset any object-references, to make sure we don't prevent any garbage collection tween.mOnStart = tween.mOnUpdate = tween.mOnRepeat = tween.mOnComplete = null; tween.mOnStartArgs = tween.mOnUpdateArgs = tween.mOnRepeatArgs = tween.mOnCompleteArgs = null; tween.mTarget = null; tween.mTransitionFunc = null; tween.removeAllEventListeners(starling.events.Event.REMOVE_FROM_JUGGLER); sTweenPool.Push(tween); }
private void onPooledTweenComplete(CEvent e) { Tween.toPool(e.target as Tween); }