Interface IGui
- All Superinterfaces:
com.badlogic.gdx.utils.Disposable
- All Known Implementing Classes:
AbstractGui, DebugGui, FrameOutputGui, GamepadGui, LoadingGui, MainGui, MainVRGui, SpacecraftGui, StandaloneVRGui, StereoGui, TimeGui, WelcomeGui, WelcomeGuiVR
public interface IGui
extends com.badlogic.gdx.utils.Disposable
-
Method Summary
Modifier and TypeMethodDescriptionbooleanRemoves the focus from this GUI and returns true if the focus was in the GUI, false otherwise.voiddoneLoading(com.badlogic.gdx.assets.AssetManager assetManager) Hook that runs after the assets have been loaded.com.badlogic.gdx.scenes.scene2d.ActorReturns the first actor found with the specified name.com.badlogic.gdx.scenes.scene2d.StageReturns the stagefloatGets the units per pixel of this GUI.voidinitialize(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 loadingbooleanisVR()Returns whether this GUI is a VR gui.booleanmustDraw()Returns whether this GUI must be drawn or notvoidrender(int rw, int rh) Renders this GUIvoidresize(int width, int height) Resizes this GUI to the given values at the end of the current loopvoidresizeImmediate(int width, int height) Resizes without waiting for the current loop to finishvoidsetBackBufferSize(int width, int height) Sets the back buffer size.voidsetVisibilityToggles(ComponentTypes.ComponentType[] entities, ComponentTypes visible) Sets the visibility state of the component entitiesvoidsetVR(boolean vr) Whether this GUI is to be used in VR modevoidupdate(double dt) Updates the GUIbooleanupdateUnitsPerPixel(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 withbatch- 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 widthrh- 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 widthheight- The new height
-
resizeImmediate
void resizeImmediate(int width, int height) Resizes without waiting for the current loop to finish- Parameters:
width- The new widthheight- 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
Sets the visibility state of the component entities- Parameters:
entities- The entitiesvisible- The states
-
findActor
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.
-
setVR
void setVR(boolean vr) Whether this GUI is to be used in VR mode- Parameters:
vr- Vr mode is active
-
isVR
boolean isVR()Returns whether this GUI is a VR gui.- Returns:
- Is this a VR gui?
-
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. This defines the size of the GUI. -
getUnitsPerPixel
float getUnitsPerPixel()Gets the units per pixel of this GUI.- Returns:
- The units per pixel value.
-
setBackBufferSize
void setBackBufferSize(int width, int height) Sets the back buffer size.
-