public class AnimEvent extends AbstractCinematicEvent
AnimComposer.
Inspired by Nehon's AnimationEvent.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger |
initialDuration, listeners, loopMode, playState, resuming, speed, time| Modifier | Constructor and Description |
|---|---|
protected |
AnimEvent()
No-argument constructor needed by SavableClassUtil.
|
|
AnimEvent(AnimComposer composer,
java.lang.String actionName,
java.lang.String layerName)
Instantiate a non-looping event to play the named action on the named
layer of the specified AnimComposer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
initEvent(Application app,
Cinematic cinematic)
Initialize this event.
|
void |
onPause()
Callback when the event is paused.
|
void |
onPlay()
Callback when the event is started.
|
void |
onStop()
Callback when the event is stopped.
|
void |
onUpdate(float tpf)
Callback on each render pass while the event is playing.
|
void |
read(JmeImporter importer)
De-serialize this event from the specified importer, for example when
loading from a J3O file.
|
void |
setSpeed(float speed)
Alter the speed of the animation.
|
void |
setTime(float time)
Jump to the specified time.
|
void |
write(JmeExporter exporter)
Serialize this event to the specified exporter, for example when saving
to a J3O file.
|
addListener, dispose, forceStop, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, play, removeListener, setInitialDuration, setLoopMode, stoppublic AnimEvent(AnimComposer composer, java.lang.String actionName, java.lang.String layerName)
composer - the Control that will play the animation (not null)actionName - the name of the animation action to be playedlayerName - the name of the animation layer on which the action will
be playedprotected AnimEvent()
public void initEvent(Application app, Cinematic cinematic)
initEvent in interface CinematicEventinitEvent in class AbstractCinematicEventapp - the Application that contains this eventcinematic - the Cinematic that contains this eventpublic void onPause()
onPause in class AbstractCinematicEventpublic void onPlay()
onPlay in class AbstractCinematicEventpublic void onStop()
onStop in class AbstractCinematicEventpublic void onUpdate(float tpf)
onUpdate in class AbstractCinematicEventtpf - time per frame (in seconds)public void read(JmeImporter importer) throws java.io.IOException
read in interface Savableread in class AbstractCinematicEventimporter - (not null)java.io.IOException - from the importerpublic void setSpeed(float speed)
setSpeed in interface CinematicEventsetSpeed in class AbstractCinematicEventspeed - the relative speed (default=1)public void setTime(float time)
setTime in interface CinematicEventsetTime in class AbstractCinematicEventtime - the desired time (in seconds, time=0 is the start of the
event)public void write(JmeExporter exporter) throws java.io.IOException
write in interface Savablewrite in class AbstractCinematicEventexporter - (not null)java.io.IOException - from the exporter