🎬 Lua Tween Animation Demo
Note: This demo showcases the Lua Tween API for smooth animations. Each box demonstrates different animation properties and easing functions.
Fade Animation
Fade Me
Color Animation
Change Color
Scale Animation
Scale Me
Rotation Animation
Spin Me
Movement Animation
Move Me
Complex Animations
Complex
Available Tween Methods:
- element:createTween() - Create a new tween for the element
- tween:to(property, target_value, duration, easing) - Animate to a target value
- tween:from(property, start_value, duration, easing) - Animate from a start value
- tween:parallel() - Set tween to run animations in parallel
- tween:chain() - Set tween to run animations in sequence
- tween:steps(count) - Set number of loops
- tween:callback(function) - Execute function when tween completes
- tween:play() - Start the tween animation
- tween:stop() - Stop the tween animation
- tween:pause() - Pause the tween animation
- tween:resume() - Resume the tween animation
Supported Properties:
- opacity - Element transparency (0-1)
- backgroundColor - Background color (hex/color names)
- color/textColor - Text color (hex/color names)
- width/height - Element dimensions (pixels)
- x/y - Position coordinates (pixels)
- scale - Element scale factor
- rotation - Rotation angle (degrees)
Easing Functions:
- easeIn - Slow start, fast end
- easeOut - Fast start, slow end
- easeInOut - Slow start and end, fast middle
- easeOutIn - Fast start and end, slow middle