org.jrabbit.base.graphics.skins.animation
Interface AnimationListener

All Known Implementing Classes:
AnimatedSprite

public interface AnimationListener

An AnimationListener listens to an AnimatedSkin and receives updates as its animation progresses. It is alerted both on every frame change and at the end of every cycle.

Author:
Chris Molini

Method Summary
 void onCycleEnd(int cycle)
          Alerts the Listener that a complete cycle of animation has finished.
 void onFrame(int cycle, int frame)
          Alerts the Listener that the frame has advanced its animation.
 

Method Detail

onFrame

void onFrame(int cycle,
             int frame)
Alerts the Listener that the frame has advanced its animation. An AnimatedSkin uses this alert after alerting end-of-cycle (if necessary). This allows the developer to use onCycleEnd to switch to a different animation cycle; afterwards, this will be called with the new cycle and frame data in place.

Parameters:
cycle - The current active cycle that is active.
frame - The new frame of the cycle.

onCycleEnd

void onCycleEnd(int cycle)
Alerts the Listener that a complete cycle of animation has finished. With this method, the developer can make one cycle seamlessly transition into another, cause a game effect to occur at the completion of an action, etc.

Parameters:
cycle - The cycle that has finished.