PulpCore

pulpcore.animation
Class Timeline

java.lang.Object
  extended by pulpcore.animation.Animation
      extended by pulpcore.animation.Timeline

public final class Timeline
extends Animation

A Timeline is a list of Animations.


Field Summary
 
Fields inherited from class pulpcore.animation.Animation
LOOP_FOREVER
 
Constructor Summary
Timeline()
           
Timeline(Easing easing)
           
Timeline(Easing easing, int startDelay)
           
Timeline(int startDelay)
           
 
Method Summary
 void add(Animation animation)
           
 void add(Property property, Animation animation)
           
 void addEvent(TimelineEvent event)
          Adds an event to the timeline.
 Timeline after()
          Creates a child timeline that starts at end of this timeline.
 Timeline after(int time)
          Creates a child timeline that starts at the specified time relative to the end of this timeline.
 void animate(Color property, int fromARGB, int toARGB, int duration)
           
 void animate(Color property, int fromARGB, int toARGB, int duration, Easing easing)
           
 void animate(Color property, int fromARGB, int toARGB, int duration, Easing easing, int startDelay)
           
 void animate(Fixed property, double fromValue, double toValue, int duration)
           
 void animate(Fixed property, double fromValue, double toValue, int duration, Easing easing)
           
 void animate(Fixed property, double fromValue, double toValue, int duration, Easing easing, int startDelay)
           
 void animate(Fixed property, int fromValue, int toValue, int duration)
           
 void animate(Fixed property, int fromValue, int toValue, int duration, Easing easing)
           
 void animate(Fixed property, int fromValue, int toValue, int duration, Easing easing, int startDelay)
           
 void animate(Int property, int fromValue, int toValue, int duration)
           
 void animate(Int property, int fromValue, int toValue, int duration, Easing easing)
           
 void animate(Int property, int fromValue, int toValue, int duration, Easing easing, int startDelay)
           
 void animate(Property property, Animation animation)
          Deprecated. Replaced by add(Property, Animation)
 void animateAsFixed(Fixed property, int fFromValue, int fToValue, int duration)
           
 void animateAsFixed(Fixed property, int fFromValue, int fToValue, int duration, Easing easing)
           
 void animateAsFixed(Fixed property, int fFromValue, int fToValue, int duration, Easing easing, int startDelay)
           
 void animateTo(Color property, int toARGB, int duration)
           
 void animateTo(Color property, int toARGB, int duration, Easing easing)
           
 void animateTo(Color property, int toARGB, int duration, Easing easing, int startDelay)
           
 void animateTo(Fixed property, double toValue, int duration)
           
 void animateTo(Fixed property, double toValue, int duration, Easing easing)
           
 void animateTo(Fixed property, double toValue, int duration, Easing easing, int startDelay)
           
 void animateTo(Fixed property, int toValue, int duration)
           
 void animateTo(Fixed property, int toValue, int duration, Easing easing)
           
 void animateTo(Fixed property, int toValue, int duration, Easing easing, int startDelay)
           
 void animateTo(Int property, int toValue, int duration)
           
 void animateTo(Int property, int toValue, int duration, Easing easing)
           
 void animateTo(Int property, int toValue, int duration, Easing easing, int startDelay)
           
 void animateToFixed(Fixed property, int fToValue, int duration)
           
 void animateToFixed(Fixed property, int fToValue, int duration, Easing easing)
           
 void animateToFixed(Fixed property, int fToValue, int duration, Easing easing, int startDelay)
           
 Timeline at(int time)
          Creates a child timeline that starts at the specified time relative to the start of this timeline.
 double getPlaySpeed()
           
 void interruptScene(Scene scene, int delay)
           
 boolean isPlaying()
           
 void move(Sprite sprite, double x1, double y1, double x2, double y2, int duration)
           
 void move(Sprite sprite, double x1, double y1, double x2, double y2, int duration, Easing easing)
           
 void move(Sprite sprite, double x1, double y1, double x2, double y2, int duration, Easing easing, int startDelay)
           
 void move(Sprite sprite, int x1, int y1, int x2, int y2, int duration)
           
 void move(Sprite sprite, int x1, int y1, int x2, int y2, int duration, Easing easing)
           
 void move(Sprite sprite, int x1, int y1, int x2, int y2, int duration, Easing easing, int startDelay)
           
 void move(Sprite sprite, Path path, double startP, double endP, int duration)
           
 void move(Sprite sprite, Path path, double startP, double endP, int duration, Easing easing)
           
 void move(Sprite sprite, Path path, double startP, double endP, int duration, Easing easing, int startDelay)
           
 void moveAndRotate(Sprite sprite, Path path, double startP, double endP, int duration)
           
 void moveAndRotate(Sprite sprite, Path path, double startP, double endP, int duration, Easing easing)
           
 void moveAndRotate(Sprite sprite, Path path, double startP, double endP, int duration, Easing easing, int startDelay)
           
 void moveTo(Sprite sprite, double x, double y, int duration)
           
 void moveTo(Sprite sprite, double x, double y, int duration, Easing easing)
           
 void moveTo(Sprite sprite, double x, double y, int duration, Easing easing, int startDelay)
           
 void moveTo(Sprite sprite, int x, int y, int duration)
           
 void moveTo(Sprite sprite, int x, int y, int duration, Easing easing)
           
 void moveTo(Sprite sprite, int x, int y, int duration, Easing easing, int startDelay)
           
 void notifyChildren()
          Calls notifyAll() on all child TimelineEvents, waking any threads that are waiting for them to execute.
 void pause()
           
 void play()
           
 void playSound(Sound sound, int delay)
           
 void scale(Sprite sprite, double width1, double height1, double width2, double height2, int duration)
           
 void scale(Sprite sprite, double width1, double height1, double width2, double height2, int duration, Easing easing)
           
 void scale(Sprite sprite, double width1, double height1, double width2, double height2, int duration, Easing easing, int startDelay)
           
 void scale(Sprite sprite, int width1, int height1, int width2, int height2, int duration)
           
 void scale(Sprite sprite, int width1, int height1, int width2, int height2, int duration, Easing easing)
           
 void scale(Sprite sprite, int width1, int height1, int width2, int height2, int duration, Easing easing, int startDelay)
           
 void scaleTo(Sprite sprite, double width, double height, int duration)
           
 void scaleTo(Sprite sprite, double width, double height, int duration, Easing easing)
           
 void scaleTo(Sprite sprite, double width, double height, int duration, Easing easing, int startDelay)
           
 void scaleTo(Sprite sprite, int width, int height, int duration)
           
 void scaleTo(Sprite sprite, int width, int height, int duration, Easing easing)
           
 void scaleTo(Sprite sprite, int width, int height, int duration, Easing easing, int startDelay)
           
 void set(Bool property, boolean value)
           
 void set(Bool property, boolean value, int delay)
           
 void set(Color property, int value)
           
 void set(Color property, int value, int delay)
           
 void set(Fixed property, double value)
           
 void set(Fixed property, double value, int delay)
           
 void set(Fixed property, int value)
           
 void set(Fixed property, int value, int delay)
           
 void set(Int property, int value)
           
 void set(Int property, int value, int delay)
           
 void setAsFixed(Fixed property, int value)
           
 void setAsFixed(Fixed property, int fValue, int delay)
           
 void setLocation(Sprite sprite, double x, double y)
           
 void setLocation(Sprite sprite, double x, double y, int delay)
           
 void setLocation(Sprite sprite, int x, int y)
           
 void setLocation(Sprite sprite, int x, int y, int delay)
           
 void setPlaySpeed(double speed)
          Sets the play speed.
 void setScene(Scene scene, int delay)
           
 void setSize(Sprite sprite, double width, double height)
           
 void setSize(Sprite sprite, double width, double height, int delay)
           
 void setSize(Sprite sprite, int width, int height)
           
 void setSize(Sprite sprite, int width, int height, int delay)
           
 void stop()
           
protected  void updateState(int animTime)
          Updates the state based on the animation time, typically from 0 to Animation.getDuration().
 
Methods inherited from class pulpcore.animation.Animation
fastForward, getDuration, getEasing, getLoopDelay, getNumLoops, getStartDelay, getTime, getTotalDuration, isFinished, loop, loop, loopForever, loopForever, rewind, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timeline

public Timeline()

Timeline

public Timeline(int startDelay)

Timeline

public Timeline(Easing easing)

Timeline

public Timeline(Easing easing,
                int startDelay)
Method Detail

setPlaySpeed

public void setPlaySpeed(double speed)
Sets the play speed. A speed of '1' is normal, '.5' is half speed, '2' is twice normal speed, and '-1' is reverse speed. Note: play speed only affects top-level Timelines - child Timelines play at their parent's speed.


getPlaySpeed

public double getPlaySpeed()

pause

public void pause()

play

public void play()

stop

public void stop()

isPlaying

public boolean isPlaying()

updateState

protected void updateState(int animTime)
Description copied from class: Animation
Updates the state based on the animation time, typically from 0 to Animation.getDuration(). Note that the duration can be zero.

Specified by:
updateState in class Animation
Parameters:
animTime - The animation time, typically from 0 to Animation.getDuration(), although an Easing can cause the value to be outside those bounds.

at

public Timeline at(int time)
Creates a child timeline that starts at the specified time relative to the start of this timeline.

This method provides an alternative syntax for delayed animations:

        timeline.at(500).animate(sprite.alpha, 0, 255, 500);
        

Parameters:
time - Time in milliseconds.
Returns:
the child timeline.

after

public Timeline after()
Creates a child timeline that starts at end of this timeline.

This method provides an alternative syntax for delayed animations:

        timeline.animate(sprite.alpha, 0, 255, 500);
        timeline.after().set(sprite.enabled, true);
        

Returns:
the child timeline.

after

public Timeline after(int time)
Creates a child timeline that starts at the specified time relative to the end of this timeline.

This method provides an alternative syntax for delayed animations. This code animates a sprite from x1 to x2, waits one second, then animates back from x2 to x1.

        timeline.animate(sprite.x, x1, x2, 500);
        timeline.after(1000).animate(sprite.x, x2, x1, 500);
        

Parameters:
time - Time in milliseconds (after the current end of this Timeline).
Returns:
the child timeline.

addEvent

public void addEvent(TimelineEvent event)
Adds an event to the timeline.


animate

public void animate(Property property,
                    Animation animation)
Deprecated. Replaced by add(Property, Animation)


add

public void add(Animation animation)

add

public void add(Property property,
                Animation animation)

notifyChildren

public void notifyChildren()
Calls notifyAll() on all child TimelineEvents, waking any threads that are waiting for them to execute.


setScene

public void setScene(Scene scene,
                     int delay)

interruptScene

public void interruptScene(Scene scene,
                           int delay)

playSound

public void playSound(Sound sound,
                      int delay)

set

public void set(Bool property,
                boolean value)

set

public void set(Int property,
                int value)

set

public void set(Color property,
                int value)

setAsFixed

public void setAsFixed(Fixed property,
                       int value)

set

public void set(Fixed property,
                int value)

set

public void set(Fixed property,
                double value)

setLocation

public void setLocation(Sprite sprite,
                        int x,
                        int y)

setLocation

public void setLocation(Sprite sprite,
                        double x,
                        double y)

setSize

public void setSize(Sprite sprite,
                    int width,
                    int height)

setSize

public void setSize(Sprite sprite,
                    double width,
                    double height)

set

public void set(Bool property,
                boolean value,
                int delay)

set

public void set(Int property,
                int value,
                int delay)

set

public void set(Color property,
                int value,
                int delay)

setAsFixed

public void setAsFixed(Fixed property,
                       int fValue,
                       int delay)

set

public void set(Fixed property,
                int value,
                int delay)

set

public void set(Fixed property,
                double value,
                int delay)

setLocation

public void setLocation(Sprite sprite,
                        int x,
                        int y,
                        int delay)

setLocation

public void setLocation(Sprite sprite,
                        double x,
                        double y,
                        int delay)

setSize

public void setSize(Sprite sprite,
                    int width,
                    int height,
                    int delay)

setSize

public void setSize(Sprite sprite,
                    double width,
                    double height,
                    int delay)

animate

public void animate(Int property,
                    int fromValue,
                    int toValue,
                    int duration)

animate

public void animate(Int property,
                    int fromValue,
                    int toValue,
                    int duration,
                    Easing easing)

animate

public void animate(Int property,
                    int fromValue,
                    int toValue,
                    int duration,
                    Easing easing,
                    int startDelay)

animateTo

public void animateTo(Int property,
                      int toValue,
                      int duration)

animateTo

public void animateTo(Int property,
                      int toValue,
                      int duration,
                      Easing easing)

animateTo

public void animateTo(Int property,
                      int toValue,
                      int duration,
                      Easing easing,
                      int startDelay)

animate

public void animate(Color property,
                    int fromARGB,
                    int toARGB,
                    int duration)

animate

public void animate(Color property,
                    int fromARGB,
                    int toARGB,
                    int duration,
                    Easing easing)

animate

public void animate(Color property,
                    int fromARGB,
                    int toARGB,
                    int duration,
                    Easing easing,
                    int startDelay)

animateTo

public void animateTo(Color property,
                      int toARGB,
                      int duration)

animateTo

public void animateTo(Color property,
                      int toARGB,
                      int duration,
                      Easing easing)

animateTo

public void animateTo(Color property,
                      int toARGB,
                      int duration,
                      Easing easing,
                      int startDelay)

animateAsFixed

public void animateAsFixed(Fixed property,
                           int fFromValue,
                           int fToValue,
                           int duration)

animateAsFixed

public void animateAsFixed(Fixed property,
                           int fFromValue,
                           int fToValue,
                           int duration,
                           Easing easing)

animateAsFixed

public void animateAsFixed(Fixed property,
                           int fFromValue,
                           int fToValue,
                           int duration,
                           Easing easing,
                           int startDelay)

animateToFixed

public void animateToFixed(Fixed property,
                           int fToValue,
                           int duration)

animateToFixed

public void animateToFixed(Fixed property,
                           int fToValue,
                           int duration,
                           Easing easing)

animateToFixed

public void animateToFixed(Fixed property,
                           int fToValue,
                           int duration,
                           Easing easing,
                           int startDelay)

animate

public void animate(Fixed property,
                    int fromValue,
                    int toValue,
                    int duration)

animate

public void animate(Fixed property,
                    int fromValue,
                    int toValue,
                    int duration,
                    Easing easing)

animate

public void animate(Fixed property,
                    int fromValue,
                    int toValue,
                    int duration,
                    Easing easing,
                    int startDelay)

animateTo

public void animateTo(Fixed property,
                      int toValue,
                      int duration)

animateTo

public void animateTo(Fixed property,
                      int toValue,
                      int duration,
                      Easing easing)

animateTo

public void animateTo(Fixed property,
                      int toValue,
                      int duration,
                      Easing easing,
                      int startDelay)

animate

public void animate(Fixed property,
                    double fromValue,
                    double toValue,
                    int duration)

animate

public void animate(Fixed property,
                    double fromValue,
                    double toValue,
                    int duration,
                    Easing easing)

animate

public void animate(Fixed property,
                    double fromValue,
                    double toValue,
                    int duration,
                    Easing easing,
                    int startDelay)

animateTo

public void animateTo(Fixed property,
                      double toValue,
                      int duration)

animateTo

public void animateTo(Fixed property,
                      double toValue,
                      int duration,
                      Easing easing)

animateTo

public void animateTo(Fixed property,
                      double toValue,
                      int duration,
                      Easing easing,
                      int startDelay)

move

public void move(Sprite sprite,
                 int x1,
                 int y1,
                 int x2,
                 int y2,
                 int duration)

move

public void move(Sprite sprite,
                 int x1,
                 int y1,
                 int x2,
                 int y2,
                 int duration,
                 Easing easing)

move

public void move(Sprite sprite,
                 int x1,
                 int y1,
                 int x2,
                 int y2,
                 int duration,
                 Easing easing,
                 int startDelay)

moveTo

public void moveTo(Sprite sprite,
                   int x,
                   int y,
                   int duration)

moveTo

public void moveTo(Sprite sprite,
                   int x,
                   int y,
                   int duration,
                   Easing easing)

moveTo

public void moveTo(Sprite sprite,
                   int x,
                   int y,
                   int duration,
                   Easing easing,
                   int startDelay)

move

public void move(Sprite sprite,
                 double x1,
                 double y1,
                 double x2,
                 double y2,
                 int duration)

move

public void move(Sprite sprite,
                 double x1,
                 double y1,
                 double x2,
                 double y2,
                 int duration,
                 Easing easing)

move

public void move(Sprite sprite,
                 double x1,
                 double y1,
                 double x2,
                 double y2,
                 int duration,
                 Easing easing,
                 int startDelay)

moveTo

public void moveTo(Sprite sprite,
                   double x,
                   double y,
                   int duration)

moveTo

public void moveTo(Sprite sprite,
                   double x,
                   double y,
                   int duration,
                   Easing easing)

moveTo

public void moveTo(Sprite sprite,
                   double x,
                   double y,
                   int duration,
                   Easing easing,
                   int startDelay)

move

public void move(Sprite sprite,
                 Path path,
                 double startP,
                 double endP,
                 int duration)

move

public void move(Sprite sprite,
                 Path path,
                 double startP,
                 double endP,
                 int duration,
                 Easing easing)

move

public void move(Sprite sprite,
                 Path path,
                 double startP,
                 double endP,
                 int duration,
                 Easing easing,
                 int startDelay)

moveAndRotate

public void moveAndRotate(Sprite sprite,
                          Path path,
                          double startP,
                          double endP,
                          int duration)

moveAndRotate

public void moveAndRotate(Sprite sprite,
                          Path path,
                          double startP,
                          double endP,
                          int duration,
                          Easing easing)

moveAndRotate

public void moveAndRotate(Sprite sprite,
                          Path path,
                          double startP,
                          double endP,
                          int duration,
                          Easing easing,
                          int startDelay)

scale

public void scale(Sprite sprite,
                  int width1,
                  int height1,
                  int width2,
                  int height2,
                  int duration)

scale

public void scale(Sprite sprite,
                  int width1,
                  int height1,
                  int width2,
                  int height2,
                  int duration,
                  Easing easing)

scale

public void scale(Sprite sprite,
                  int width1,
                  int height1,
                  int width2,
                  int height2,
                  int duration,
                  Easing easing,
                  int startDelay)

scaleTo

public void scaleTo(Sprite sprite,
                    int width,
                    int height,
                    int duration)

scaleTo

public void scaleTo(Sprite sprite,
                    int width,
                    int height,
                    int duration,
                    Easing easing)

scaleTo

public void scaleTo(Sprite sprite,
                    int width,
                    int height,
                    int duration,
                    Easing easing,
                    int startDelay)

scale

public void scale(Sprite sprite,
                  double width1,
                  double height1,
                  double width2,
                  double height2,
                  int duration)

scale

public void scale(Sprite sprite,
                  double width1,
                  double height1,
                  double width2,
                  double height2,
                  int duration,
                  Easing easing)

scale

public void scale(Sprite sprite,
                  double width1,
                  double height1,
                  double width2,
                  double height2,
                  int duration,
                  Easing easing,
                  int startDelay)

scaleTo

public void scaleTo(Sprite sprite,
                    double width,
                    double height,
                    int duration)

scaleTo

public void scaleTo(Sprite sprite,
                    double width,
                    double height,
                    int duration,
                    Easing easing)

scaleTo

public void scaleTo(Sprite sprite,
                    double width,
                    double height,
                    int duration,
                    Easing easing,
                    int startDelay)

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.