Package com.jme3.cinematic.events
Class CameraEvent
java.lang.Object
com.jme3.cinematic.events.AbstractCinematicEvent
com.jme3.cinematic.events.CameraEvent
- All Implemented Interfaces:
CinematicEvent,Savable
A `CameraEvent` is a cinematic event that instantly sets the active camera
within a `Cinematic` sequence.
-
Field Summary
Fields inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
initialDuration, listeners, loopMode, playState, resuming, speed, time -
Constructor Summary
ConstructorsConstructorDescriptionFor serialization only.CameraEvent(Cinematic cinematic, String cameraName) Constructs a new `CameraEvent` with the specified cinematic and camera name. -
Method Summary
Modifier and TypeMethodDescriptionvoidImplement this method if the event needs different handling when stopped naturally (when the event reach its end), or when it was force-stopped during playback.Returns the name of the camera that this event will activate.Returns the `Cinematic` instance associated with this event.voidinitEvent(Application app, Cinematic cinematic) Initialize this event (called internally only).voidonPause()Implement this method with code that you want to execute when the event is paused.voidonPlay()Implement this method with code that you want to execute when the event is started.voidonStop()Implement this method with code that you want to execute when the event is stopped.voidonUpdate(float tpf) Implement this method with the code that you want to execute on update (only called when the event is playing).voidplay()Play this event.voidread(JmeImporter im) Used internally for deserialization.voidsetCameraName(String cameraName) Sets the name of the camera that this event will activate.voidsetCinematic(Cinematic cinematic) Sets the `Cinematic` instance for this event.voidsetTime(float time) Fast-forwards the event to the given timestamp.voidwrite(JmeExporter ex) Used internally for serialization.Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
addListener, dispose, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, removeListener, setInitialDuration, setLoopMode, setSpeed, stop
-
Constructor Details
-
CameraEvent
public CameraEvent()For serialization only. Do not use. -
CameraEvent
Constructs a new `CameraEvent` with the specified cinematic and camera name.- Parameters:
cinematic- The `Cinematic` instance this event belongs to (cannot be null).cameraName- The name of the camera to be activated by this event (cannot be null or empty).
-
-
Method Details
-
initEvent
Description copied from class:AbstractCinematicEventInitialize this event (called internally only).- Specified by:
initEventin interfaceCinematicEvent- Overrides:
initEventin classAbstractCinematicEvent- Parameters:
app- ignoredcinematic- ignored
-
play
public void play()Description copied from class:AbstractCinematicEventPlay this event.- Specified by:
playin interfaceCinematicEvent- Overrides:
playin classAbstractCinematicEvent
-
onPlay
public void onPlay()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is started.- Specified by:
onPlayin classAbstractCinematicEvent
-
onUpdate
public void onUpdate(float tpf) Description copied from class:AbstractCinematicEventImplement this method with the code that you want to execute on update (only called when the event is playing).- Specified by:
onUpdatein classAbstractCinematicEvent- Parameters:
tpf- time per frame
-
onStop
public void onStop()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is stopped.- Specified by:
onStopin classAbstractCinematicEvent
-
onPause
public void onPause()Description copied from class:AbstractCinematicEventImplement this method with code that you want to execute when the event is paused.- Specified by:
onPausein classAbstractCinematicEvent
-
forceStop
public void forceStop()Description copied from class:AbstractCinematicEventImplement this method if the event needs different handling when stopped naturally (when the event reach its end), or when it was force-stopped during playback. By default, this method just calls regular stop().- Specified by:
forceStopin interfaceCinematicEvent- Overrides:
forceStopin classAbstractCinematicEvent
-
setTime
public void setTime(float time) Description copied from class:AbstractCinematicEventFast-forwards the event to the given timestamp. Time=0 is the start of the event.- Specified by:
setTimein interfaceCinematicEvent- Overrides:
setTimein classAbstractCinematicEvent- Parameters:
time- the time to fast-forward to.
-
getCinematic
Returns the `Cinematic` instance associated with this event.- Returns:
- The `Cinematic` instance.
-
setCinematic
Sets the `Cinematic` instance for this event.- Parameters:
cinematic- The `Cinematic` instance to set (cannot be null).
-
getCameraName
Returns the name of the camera that this event will activate.- Returns:
- The camera name.
-
setCameraName
Sets the name of the camera that this event will activate.- Parameters:
cameraName- The new camera name (cannot be null or empty).
-
write
Used internally for serialization.- Specified by:
writein interfaceSavable- Overrides:
writein classAbstractCinematicEvent- Parameters:
ex- The exporter (not null).- Throws:
IOException- If an I/O error occurs during serialization.
-
read
Used internally for deserialization.- Specified by:
readin interfaceSavable- Overrides:
readin classAbstractCinematicEvent- Parameters:
im- The importer (not null).- Throws:
IOException- If an I/O error occurs during deserialization.
-