Package com.jme3.cinematic.events
Class GuiEvent
java.lang.Object
com.jme3.cinematic.events.AbstractCinematicEvent
com.jme3.cinematic.events.GuiEvent
- All Implemented Interfaces:
CinematicEvent
,Savable
A CinematicEvent associated with a Nifty screen.
-
Field Summary
Modifier and TypeFieldDescriptionprotected de.lessvoid.nifty.Nifty
associated Nifty instance (not null)protected String
name of the associated Nifty screen (not null)Fields inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
initialDuration, listeners, loopMode, playState, resuming, speed, time
-
Constructor Summary
ConstructorDescriptionGuiEvent()
No-argument constructor needed by SavableClassUtil.Instantiate an event with the default initial duration (10) and mode (DontLoop).Instantiate an event the default mode (DontLoop).Instantiate an event with the specified initial duration and loop mode.Instantiate an event with the default initial duration (10). -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPause()
Invoked when the event is paused.void
onPlay()
Invoked when the event is started.void
onStop()
Invoked when the event is stopped.void
onUpdate
(float tpf) Invoked once per frame, provided the event is playing.void
read
(JmeImporter im) De-serialize this event, for example when loading from a J3O file.void
setNifty
(de.lessvoid.nifty.Nifty nifty) Alter the Nifty instance for this event.void
Alter the screen for this event.void
write
(JmeExporter ex) Serialize this event, for example when saving to a J3O file.Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
addListener, dispose, forceStop, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, initEvent, internalUpdate, pause, play, removeListener, setInitialDuration, setLoopMode, setSpeed, setTime, stop
-
Field Details
-
screen
name of the associated Nifty screen (not null) -
nifty
protected de.lessvoid.nifty.Nifty niftyassociated Nifty instance (not null)
-
-
Constructor Details
-
GuiEvent
public GuiEvent()No-argument constructor needed by SavableClassUtil. Do not invoke directly! -
GuiEvent
Instantiate an event with the default initial duration (10) and mode (DontLoop).- Parameters:
nifty
- the Nifty instance (not null, alias created)screen
- the name of the Nifty screen (not null)
-
GuiEvent
Instantiate an event the default mode (DontLoop).- Parameters:
nifty
- the Nifty instance (not null, alias created)screen
- the name of the Nifty screen (not null)initialDuration
- the initial duration (in seconds, ≥0)
-
GuiEvent
Instantiate an event with the default initial duration (10).- Parameters:
nifty
- the Nifty instance (not null, alias created)screen
- the name of the Nifty screen (not null)loopMode
- the loop mode (not null)
-
GuiEvent
public GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, float initialDuration, LoopMode loopMode) Instantiate an event with the specified initial duration and loop mode.- Parameters:
nifty
- the Nifty instance (not null, alias created)screen
- the name of the Nifty screen (not null)initialDuration
- the initial duration (in seconds, ≥0)loopMode
- the loop mode (not null)
-
-
Method Details
-
onPlay
public void onPlay()Invoked when the event is started.- Specified by:
onPlay
in classAbstractCinematicEvent
-
onStop
public void onStop()Invoked when the event is stopped.- Specified by:
onStop
in classAbstractCinematicEvent
-
onPause
public void onPause()Invoked when the event is paused.- Specified by:
onPause
in classAbstractCinematicEvent
-
setNifty
public void setNifty(de.lessvoid.nifty.Nifty nifty) Alter the Nifty instance for this event.- Parameters:
nifty
- the new instance (not null)
-
setScreen
Alter the screen for this event.- Parameters:
screen
- the name of the new screen (not null)
-
onUpdate
public void onUpdate(float tpf) Invoked once per frame, provided the event is playing.- Specified by:
onUpdate
in classAbstractCinematicEvent
- Parameters:
tpf
- the time interval between frames (in seconds, ≥0)
-
write
Serialize this event, for example when saving to a J3O file.- Specified by:
write
in interfaceSavable
- Overrides:
write
in classAbstractCinematicEvent
- Parameters:
ex
- exporter (not null)- Throws:
IOException
- from exporter
-
read
De-serialize this event, for example when loading from a J3O file.- Specified by:
read
in interfaceSavable
- Overrides:
read
in classAbstractCinematicEvent
- Parameters:
im
- importer (not null)- Throws:
IOException
- from importer
-