Package com.jme3.cinematic.events
Interface CinematicEvent
- All Superinterfaces:
Savable
- All Known Implementing Classes:
AbstractCinematicEvent
,AnimationEvent
,AnimationTrack
,AnimEvent
,CameraEvent
,Cinematic
,GuiEvent
,GuiTrack
,MotionEvent
,MotionTrack
,SoundEvent
,SoundTrack
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
method called when an event is removed from a cinematic this method should remove any reference to any external objects.void
this method can be implemented if the event needs different handling when stopped naturally (when the event reach its end) or when it was forced stopped during playback otherwise it just calls regular stop()float
Returns the actual duration of the animationfloat
returns the initial duration of the animation at speed = 1 in seconds.returns the PlayState of the animationfloat
getSpeed()
returns the speed of the animationfloat
getTime()
returns the current time of the cinematic eventvoid
initEvent
(Application app, Cinematic cinematic) initialize this eventvoid
internalUpdate
(float tpf) called internally in the update method, place here anything you want to run in the update loopvoid
pause()
Pauses the animationvoid
play()
Starts the animationvoid
setInitialDuration
(float initialDuration) Sets the duration of the animation at speed = 1, in seconds.void
setLoopMode
(LoopMode loop) void
setSpeed
(float speed) Sets the speed of the animation (1 is normal speed, 2 is twice faster)void
setTime
(float time) Fast-forwards to the given time, where time=0 is the start of the event.void
stop()
Stops the animation
-
Method Details
-
play
void play()Starts the animation -
stop
void stop()Stops the animation -
forceStop
void forceStop()this method can be implemented if the event needs different handling when stopped naturally (when the event reach its end) or when it was forced stopped during playback otherwise it just calls regular stop() -
pause
void pause()Pauses the animation -
getDuration
float getDuration()Returns the actual duration of the animation- Returns:
- the duration
-
setSpeed
void setSpeed(float speed) Sets the speed of the animation (1 is normal speed, 2 is twice faster)- Parameters:
speed
- the desired speed (default=1)
-
getSpeed
float getSpeed()returns the speed of the animation- Returns:
- the speed
-
getPlayState
PlayState getPlayState()returns the PlayState of the animation- Returns:
- the plat state
-
setLoopMode
- Parameters:
loop
- Set the loop mode for the channel. The loop mode determines what will happen to the animation once it finishes playing. For more information, see the LoopMode enum class.- See Also:
-
getLoopMode
LoopMode getLoopMode()- Returns:
- The loop mode currently set for the animation. The loop mode determines what will happen to the animation once it finishes playing. For more information, see the LoopMode enum class.
- See Also:
-
getInitialDuration
float getInitialDuration()returns the initial duration of the animation at speed = 1 in seconds.- Returns:
- the initial duration
-
setInitialDuration
void setInitialDuration(float initialDuration) Sets the duration of the animation at speed = 1, in seconds.- Parameters:
initialDuration
- the desired duration (in de-scaled seconds)
-
internalUpdate
void internalUpdate(float tpf) called internally in the update method, place here anything you want to run in the update loop- Parameters:
tpf
- time per frame
-
initEvent
initialize this event- Parameters:
app
- the applicationcinematic
- the cinematic
-
setTime
void setTime(float time) Fast-forwards to the given time, where time=0 is the start of the event.- Parameters:
time
- the time to fast-forward to
-
getTime
float getTime()returns the current time of the cinematic event- Returns:
- the time
-
dispose
void dispose()method called when an event is removed from a cinematic this method should remove any reference to any external objects.
-