Interface IGui

All Superinterfaces:
com.badlogic.gdx.utils.Disposable
All Known Implementing Classes:
AbstractGui, ControllerGui, CrashGui, DebugGui, FullGui, HUDGui, LoadingGui, RenderGui, SpacecraftGui, StereoGui, VRControllerInfoGui, VRGui, VRInfoGui, VRSelectionGui, WelcomeGui, WelcomeGuiVR

public interface IGui extends com.badlogic.gdx.utils.Disposable
An interface to be implemented by all top-level GUIs in Gaia Sky
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Removes the focus from this GUI and returns true if the focus was in the GUI, false otherwise.
    void
    doneLoading​(com.badlogic.gdx.assets.AssetManager assetManager)
    Hook that runs after the assets have been loaded.
    com.badlogic.gdx.scenes.scene2d.Actor
    findActor​(String name)
    Returns the first actor found with the specified name.
    com.badlogic.gdx.scenes.scene2d.Stage
    Returns the stage
    void
    initialize​(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
    Initializes the GUI, adding all the resources to the asset manager queue for loading
    boolean
    Returns whether this GUI must be drawn or not
    void
    render​(int rw, int rh)
    Renders this GUI
    void
    resize​(int width, int height)
    Resizes this GUI to the given values at the end of the current loop
    void
    resizeImmediate​(int width, int height)
    Resizes without waiting for the current loop to finish
    void
    setHoffset​(int hoffset)
    Sets the horizontal offset, for VR
    void
    Sets the visibility state of the component entities
    void
    setVr​(boolean vr)
    Whether this GUI is to be used in VR mode
    void
    update​(double dt)
    Updates the GUI
    boolean
    updateUnitsPerPixel​(float upp)
    Updates the units-per-pixel value of this GUI.

    Methods inherited from interface com.badlogic.gdx.utils.Disposable

    dispose
  • Method Details

    • initialize

      void initialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Initializes the GUI, adding all the resources to the asset manager queue for loading
      Parameters:
      assetManager - The asset manager to load the resources with
      batch - The sprite batch to use for this GUI's stage
    • doneLoading

      void doneLoading(com.badlogic.gdx.assets.AssetManager assetManager)
      Hook that runs after the assets have been loaded. Completes the initialization process
      Parameters:
      assetManager - The asset manager
    • update

      void update(double dt)
      Updates the GUI
      Parameters:
      dt - Time in seconds since the last frame
    • render

      void render(int rw, int rh)
      Renders this GUI
      Parameters:
      rw - The render width
      rh - The render height
    • resize

      void resize(int width, int height)
      Resizes this GUI to the given values at the end of the current loop
      Parameters:
      width - The new width
      height - The new height
    • resizeImmediate

      void resizeImmediate(int width, int height)
      Resizes without waiting for the current loop to finish
      Parameters:
      width - The new width
      height - The new height
    • cancelTouchFocus

      boolean cancelTouchFocus()
      Removes the focus from this GUI and returns true if the focus was in the GUI, false otherwise.
      Returns:
      true if the focus was in the GUI, false otherwise.
    • getGuiStage

      com.badlogic.gdx.scenes.scene2d.Stage getGuiStage()
      Returns the stage
      Returns:
      The stage
    • setVisibilityToggles

      void setVisibilityToggles(ComponentTypes.ComponentType[] entities, ComponentTypes visible)
      Sets the visibility state of the component entities
      Parameters:
      entities - The entities
      visible - The states
    • findActor

      com.badlogic.gdx.scenes.scene2d.Actor findActor(String name)
      Returns the first actor found with the specified name. Note this recursively compares the name of every actor in the GUI.
      Returns:
      The actor if it exists, null otherwise.
    • setHoffset

      void setHoffset(int hoffset)
      Sets the horizontal offset, for VR
      Parameters:
      hoffset - The horizontal offset in pixels
    • setVr

      void setVr(boolean vr)
      Whether this GUI is to be used in VR mode
      Parameters:
      vr - Vr mode is active
    • mustDraw

      boolean mustDraw()
      Returns whether this GUI must be drawn or not
      Returns:
      Whether this is visible
    • updateUnitsPerPixel

      boolean updateUnitsPerPixel(float upp)
      Updates the units-per-pixel value of this GUI. The units-per-pixel is the same as 1/UI_SCALE.