Class GuiEvent

java.lang.Object
com.jme3.cinematic.events.AbstractCinematicEvent
com.jme3.cinematic.events.GuiEvent
All Implemented Interfaces:
com.jme3.cinematic.events.CinematicEvent, com.jme3.export.Savable

public class GuiEvent extends com.jme3.cinematic.events.AbstractCinematicEvent
A CinematicEvent associated with a Nifty screen.
Author:
Nehon
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    No-argument constructor needed by SavableClassUtil.
    GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen)
    Instantiate an event with the default initial duration (10) and mode (DontLoop).
    GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, float initialDuration)
    Instantiate an event the default mode (DontLoop).
    GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, float initialDuration, com.jme3.animation.LoopMode loopMode)
    Instantiate an event with the specified initial duration and loop mode.
    GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, com.jme3.animation.LoopMode loopMode)
    Instantiate an event with the default initial duration (10).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked when the event is paused.
    void
    Invoked when the event is started.
    void
    Invoked when the event is stopped.
    void
    onUpdate(float tpf)
    Invoked once per frame, provided the event is playing.
    void
    read(com.jme3.export.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
    setScreen(String screen)
    Alter the screen for this event.
    void
    write(com.jme3.export.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • screen

      protected String screen
      name of the associated Nifty screen (not null)
    • nifty

      protected de.lessvoid.nifty.Nifty nifty
      associated Nifty instance (not null)
  • Constructor Details

    • GuiEvent

      public GuiEvent()
      No-argument constructor needed by SavableClassUtil. Do not invoke directly!
    • GuiEvent

      public GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen)
      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

      public GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, float initialDuration)
      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

      public GuiEvent(de.lessvoid.nifty.Nifty nifty, String screen, com.jme3.animation.LoopMode loopMode)
      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, com.jme3.animation.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 class com.jme3.cinematic.events.AbstractCinematicEvent
    • onStop

      public void onStop()
      Invoked when the event is stopped.
      Specified by:
      onStop in class com.jme3.cinematic.events.AbstractCinematicEvent
    • onPause

      public void onPause()
      Invoked when the event is paused.
      Specified by:
      onPause in class com.jme3.cinematic.events.AbstractCinematicEvent
    • setNifty

      public void setNifty(de.lessvoid.nifty.Nifty nifty)
      Alter the Nifty instance for this event.
      Parameters:
      nifty - the new instance (not null)
    • setScreen

      public void setScreen(String screen)
      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 class com.jme3.cinematic.events.AbstractCinematicEvent
      Parameters:
      tpf - the time interval between frames (in seconds, ≥0)
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Serialize this event, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class com.jme3.cinematic.events.AbstractCinematicEvent
      Parameters:
      ex - exporter (not null)
      Throws:
      IOException - from exporter
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      De-serialize this event, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class com.jme3.cinematic.events.AbstractCinematicEvent
      Parameters:
      im - importer (not null)
      Throws:
      IOException - from importer