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, stop
public 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 CinematicEvent
initEvent
in class AbstractCinematicEvent
app
- the Application that contains this eventcinematic
- the Cinematic that contains this eventpublic void onPause()
onPause
in class AbstractCinematicEvent
public void onPlay()
onPlay
in class AbstractCinematicEvent
public void onStop()
onStop
in class AbstractCinematicEvent
public void onUpdate(float tpf)
onUpdate
in class AbstractCinematicEvent
tpf
- time per frame (in seconds)public void read(JmeImporter importer) throws java.io.IOException
read
in interface Savable
read
in class AbstractCinematicEvent
importer
- (not null)java.io.IOException
- from the importerpublic void setSpeed(float speed)
setSpeed
in interface CinematicEvent
setSpeed
in class AbstractCinematicEvent
speed
- the relative speed (default=1)public void setTime(float time)
setTime
in interface CinematicEvent
setTime
in class AbstractCinematicEvent
time
- 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 Savable
write
in class AbstractCinematicEvent
exporter
- (not null)java.io.IOException
- from the exporter