rydit-anim
Animation module for RyDit - Easing functions, Squash & Stretch, Disney principles
Overview
rydit-anim provides animation functions for the RyDit game engine, implementing easing functions and classic animation principles.
Installation
[]
= "0.7.3"
Usage
use AnimModule;
use RyditModule;
use json;
let module = AnimModule;
// Easing functions
let ease_in = module.execute;
// Returns: 0.25 (quadratic ease in)
let ease_out = module.execute;
// Returns: 0.75 (quadratic ease out)
// Squash & Stretch
let squash = module.execute;
// Returns: scale factors for squash effect
// Anticipation
let anticipate = module.execute;
// Returns: anticipation movement value
Features
Easing Functions
anim::ease_in- Quadratic ease in (slow start)anim::ease_out- Quadratic ease out (slow end)anim::ease_in_out- Quadratic ease in-out (slow start and end)
Squash & Stretch
anim::squash- Squash effect for impact- Parameters:
factor(e.g., 2.0 for 2x squash) - Returns: scale factors [scale_x, scale_y]
- Parameters:
Anticipation
anim::anticipate- Anticipation movement- Parameters:
start, end, anticipation_amount - Returns: anticipated starting position
- Parameters:
LAZOS Protocol
Use with RyDit's LAZOS protocol:
# Easing
|
# Squash & Stretch
|
# Anticipation
|
Examples
Smooth Animation with Easing
// Animate from 0 to 100 over 60 frames
for frame in 0..60
Ball Bounce with Squash
// When ball hits ground, apply squash
let squash_factor = 2.0;
let result = module.execute;
// Apply returned scale factors to sprite
License
MIT License - See LICENSE for details.
Contributing
Contributions are welcome! Please open an issue or submit a PR at: https://github.com/lapumlbb18-blip/Rydit_Engine