Psych Engine Logo
Psych Engine - Lua Script API

Tween Functions

Functions to start tweens for visual effects.


startTween

startTween(twnTag:String, objTag:String, values:Any, duration:Float, ?options:Any = null):String

Starts a complex tween and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:

Note: For optimization sake, if you're changing a single value, you should use the other tween functions when possible.


doTweenX

doTweenX(twnTag:String, objTag:String, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Sprite's X and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


doTweenY

doTweenY(twnTag:String, objTag:String, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Sprite's Y and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


doTweenAngle

doTweenAngle(twnTag:String, objTag:String, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Sprite's Angle and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


doTweenAlpha

doTweenAlpha(twnTag:String, objTag:String, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Sprite's Alpha and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


doTweenColor

doTweenColor(twnTag:String, objTag:String, targetColor:String, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Sprite's Color and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


doTweenZoom

doTweenZoom(twnTag:String, camera:String, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change the Camera's Zoom and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:

Note: Use "setProperty('camZooming', false)" to disable the camera automatic zoom-in.


noteTweenX

noteTweenX(twnTag:String, note:Int, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change a Strum Note's X and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


noteTweenY

noteTweenY(twnTag:String, note:Int, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change a Strum Note's Y and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


noteTweenAngle

noteTweenAngle(twnTag:String, note:Int, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change a Strum Note's Angle and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


noteTweenAlpha

noteTweenAlpha(twnTag:String, note:Int, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change a Strum Note's Alpha and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


noteTweenDirection

noteTweenDirection(twnTag:String, note:Int, value:Dynamic, duration:Float, ?ease:String = 'linear'):String

Starts a simple tween to change a Strum Note's Direction and call function "onTweenCompleted" when it ends.
Returns the formatted Tween tag.

Examples:


cancelTween

cancelTween(twnTag:String):Void

Cancels a Tween created with any of the Tween functions.

Examples: