Tweens interpolate a property from its current value to a target value over a given duration. When a tween finishes, theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Quiet-Wolfe/Rustic-Engine/llms.txt
Use this file to discover all available pages before exploring further.
onTweenCompleted callback fires. Timers fire onTimerCompleted on each loop completion.
All tweens and timers are identified by a tag string. Cancelling a tag stops that tween immediately. If you start a new tween with a tag that is already running, the old tween is replaced.
Position tweens
doTweenX
Tweens the X position of a sprite or game object.
Identifier for this tween. Passed to
onTweenCompleted when done.The object to tween. Can be a Lua sprite tag,
"dad" / "boyfriend" / "gf", or a strum path like "strumLineNotes.members[0]".Target X position.
Duration in seconds.
Easing function name. See the easing reference below.
doTweenY
Tweens the Y position of a sprite or game object.
Tween identifier.
Target object.
Target Y position.
Duration in seconds.
Easing function name.
Visual property tweens
doTweenAlpha
Tweens the alpha (transparency) of a sprite.
Tween identifier.
Sprite tag.
Target alpha, from
0.0 (invisible) to 1.0 (opaque).Duration in seconds.
Easing function name.
doTweenAngle
Tweens the rotation angle of a sprite.
Tween identifier.
Sprite tag.
Target angle in degrees.
Duration in seconds.
Easing function name.
Camera zoom tweens
doTweenZoom
Tweens the zoom level of a camera. Integrates with the property write system — the game applies the zoom each frame.
Tween identifier.
Camera to zoom:
"camGame" or "camHUD". Aliases "game" and "hud" are also accepted.Target zoom value.
1.0 = no zoom. 0.9 is the typical default for camGame.Duration in seconds.
Easing function name.
Rustic Engine’s camera zoom implementation is smoother than Psych Engine’s original. The zoom math uses proper lerp interpolation instead of the jittery bump system. The Lua API is identical.
Strum/note tweens
These functions tween properties of individual strum note receptors. Thenote parameter is a 0-based index from 0 to 7 (0–3 = opponent, 4–7 = player).
noteTweenX
Tween identifier.
Strum index (0–7).
Target X position.
Duration in seconds.
Easing function.
noteTweenY
Same as noteTweenX but for Y position.
noteTweenAlpha
Same signature, tweens the alpha of a strum receptor.
noteTweenAngle
Same signature, tweens the rotation of a strum receptor.
Generic tween
startTween
Tweens multiple properties on an object at once. Supports any combination of x, y, alpha, angle, scale.x, scale.y, offset.x, offset.y, and color transform offsets.
Tween identifier.
Target object (sprite tag, strum path, or character name).
Table of property→value pairs to tween.
Duration in seconds.
Either an ease string or a table with
ease and optionally onComplete keys.Cancelling tweens
cancelTween
Stops a running tween immediately. The property keeps whatever value it was at when cancelled. onTweenCompleted does not fire.
The tag of the tween to cancel.
Cancelling a tag also cancels any sub-property tweens created by
startTween (e.g. "myTag_x", "myTag_y").Timers
runTimer
Runs a countdown timer that fires onTimerCompleted after each loop.
Timer identifier. Passed to
onTimerCompleted.Duration of each loop in seconds.
Number of times to repeat. Pass
0 for infinite loops.cancelTimer
Stops a running timer. onTimerCompleted will not fire for cancelled timers.
The tag of the timer to cancel.
Easing functions
All tween functions accept anease string. The available values are:
Basic
Basic
| Name | Description |
|---|---|
linear | Constant speed (default) |
Quadratic
Quadratic
| Name | Description |
|---|---|
quadIn | Slow start, fast end |
quadOut | Fast start, slow end |
quadInOut | Slow at both ends |
Cubic / Quartic / Quintic
Cubic / Quartic / Quintic
| Name | Description |
|---|---|
cubeIn, cubeOut, cubeInOut | Cubic — stronger than quad |
quartIn, quartOut, quartInOut | Quartic |
quintIn, quintOut, quintInOut | Quintic — very strong |
Sine / Expo / Circ
Sine / Expo / Circ
| Name | Description |
|---|---|
sineIn, sineOut, sineInOut | Smooth sine curve |
expoIn, expoOut, expoInOut | Exponential — extreme acceleration |
circIn, circOut, circInOut | Circular arc |
Back / Bounce / Elastic
Back / Bounce / Elastic
| Name | Description |
|---|---|
backIn, backOut, backInOut | Slight overshoot before settling |
bounceIn, bounceOut, bounceInOut | Physical bounce effect |
elasticIn, elasticOut, elasticInOut | Spring oscillation |
Smooth step
Smooth step
| Name | Description |
|---|---|
smoothStepIn, smoothStepOut, smoothStepInOut | Hermite smooth step |
smootherStepIn, smootherStepOut, smootherStepInOut | Ken Perlin’s smoother step |
"QuadOut" and "quadout" both work).