An attempt to implement a dynamic timeline in HaxeFlixel. Features:
- Events:
- Ability to store child timelines
- Framerate support
import flixel.timeline.FlxTimeline;
// Creates a timeline
var timeline:FlxTimeline = new FlxTimeline();
var duration = 0.5;
var startTime = 0.1;
// Add VarTweenEvent
timeline.addTweenEvent(startTime, mySprite, {angle: 45}, duration);
// Add NumTweenEvent
timeline.addNumTweenEvent(startTime, 0, 1.0, i -> trace(i), duration);
// Add SetEvent
timeline.addSetEvent(startTime, i -> trace("HelloWorld"), duration);
// Starts animation
timeline.play();
// Ability to link time to your function.
timeline.getTime = () -> return FlxG.sound.music.time;
// Create a child timeline from the previous timeline
timeline.addChild("Child Timeline");
// You can also give your timeline a name to make it easier to navigate among other timelines.
var childTimeLine:FlxTimeline = timeline.getChild("Child Timeline");
timeline.removeChild("Child Timeline");
-
First, run the following command in a terminal:
- For the latest stable version:
haxelib install flxtimeline
- For the latest development:
haxelib git flxtimeline https://github.com/Redar13/FlxTimeline
- For the latest stable version:
-
Include the library in your Project.xml:
<haxelib name="flxtimeline" />
- Improve TweenEvent rewind
- Implement FlxTweenType for TweenEvent
- Implement Motion and its child classes