This repository contains code that has not been properly tested yet, continue at the risk of doing stupid things while discovering parts of this library don't work.
Games and other applications often have a need to change values smoothly, without the need for a fully-blown physics system. This is where Tweening (Inbe tween ing) comes in. It allows to interpolate between numerical values in a lightweight way.
This YouTube video is an interesting example of how the addition of animations (via tweens) can change the feeling of a game.
See the examples.
Compiling and running images.rs
should create .ppm
files of all basic
variations of tweens in the current directory.
More complex examples will (might) follow.
- Allows tweening of any type (via traits)
- Multiple easing equations:
- Linear
- Quad
- Cubic
- Quart
- Quint
- Sine
- Circular
- Back
- Elastic
- Bounce
- Easy to add own equations
- Easing modes
In
,Out
andInOut
- Tween organization:
- Sequential execution
- Parallel execution
- Pauses
- Function execution
- Repeated execution
- Three value access modes:
- via unsafe pointers
- via
Cell
- via callback functions
- Direct
task
launching - Making tweens
Send
able?
Feedback in any form is strongly desired. Either email me at
ubrccare.gvyy@tznvy.pbz
(rot-13 that), create an issue or ping me
on IRC (nick: flan3002).
Many thanks to eddyb, cmr, bjz, kimundi, mindslight, hoverbear, sfackler, and
others from mozilla/#rust! Also thanks to lifthrasiir from reddit for
helping me with a 'static
problem.
For preview of the easing equations you may visit easings.net for
an overview of different easings. Note that Expo
is not implemented at time
of writing.