Skip to content

JoeCreates/MacroTween

Repository files navigation

MacroTween

License Build Status Badge

MacroTween is a Haxe library for concise tweening and timelines.

WARNING: Currently in development and incomplete, we haven't used it for any big projects yet!

Run the demo in your browser.

Usage

// Concise arrow syntax
// Tween myObject.x to 100
Tween.tween(myObject.x => 100, Ease.quadInOut);

// Specify ranges
Tween.tween(myObject.x => 10...20);

// Tween local variables
var x:Float = 10;
Tween.tween(x => 100);

// Tween multiple objects at once
Tween.tween([object1.x => 100, object2.x => 200]);

// Compound expressions
Tween.tween(obj => [x => 100, y => 100]);
Tween.tween([objA, objB] => [x => 100, y => 100]);
Tween.tween( mySprite.scale => [[x, y] => 100]]);

// Implicit start or end values
// A reverse tween from t=1...0 would tween from whatever the initial value is to 10
Tween.tween( myObject.x => 10..._);

// Repeatedly call function with tweening parameters
Tween.tween(myFunc(10...20));

//TODO
// Tween from timeline
timeline.tween(...);

// Chaining
timeline.tween(...).tween(...);

See more usage examples in the unit tests and demo code

Graphs Tween Demo

Notes

  • Got an idea or request? Open an issue on GitHub or contact Joe and Sam.
  • Read the documentation here.

About

Concise tweening

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published