Skip to content

Redar13/FlxTimeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlxTimeline

An attempt to implement a dynamic timeline in HaxeFlixel. Features:

  • Events:
    • SetEvent - calls the specified function
    • NumTweenEvent - works like NumTween, but is bound to the timeline
    • VarTweenEvent - works like VarTween, but is bound to the timeline
  • Ability to store child timelines
  • Framerate support

Example Of Use:

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");

Installation

  1. 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
  2. Include the library in your Project.xml: <haxelib name="flxtimeline" />


TODOS (For now only for TweenEvent):

  1. Improve TweenEvent rewind
  2. Implement FlxTweenType for TweenEvent
  3. Implement Motion and its child classes

About

Dynamic animated timeline in HaxeFlixel.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages