Class AbstractGui
java.lang.Object
gaiasky.gui.main.AbstractGui
- Direct Known Subclasses:
DebugGui, FrameOutputGui, GamepadGui, LoadingGui, MainGui, SpacecraftGui, StereoGui, TimeGui, WelcomeGui, WelcomeGuiVR
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected com.badlogic.gdx.GraphicsGraphics instance.protected com.badlogic.gdx.utils.Array<IGuiInterface> The GUI interfaces, if any.protected final ObjectLock for sync.protected StringThe name of this GUI.static final com.badlogic.gdx.utils.PoolManagerprotected com.badlogic.gdx.scenes.scene2d.ui.SkinThe skin to use.protected com.badlogic.gdx.scenes.scene2d.StageThe user interface stage.protected floatUnits per pixel, 1/uiScale.protected booleanWhether we're in VR mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanRemoves the focus from this GUI and returns true if the focus was in the GUI, false otherwise.protected voidvoiddispose()com.badlogic.gdx.scenes.scene2d.ActorReturns the first actor found with the specified name.intintcom.badlogic.gdx.scenes.scene2d.StageReturns the stagegetName()floatGets the units per pixel of this GUI.booleanisVR()Returns whether this GUI is a VR gui.booleanmustDraw()Returns whether this GUI must be drawn or notvoidEvent notification call.protected abstract voidAdds the already created GUI objects to the stage.voidrender(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 class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IGui
doneLoading, initializeModifier and TypeMethodDescriptionvoiddoneLoading(com.badlogic.gdx.assets.AssetManager assetManager) Hook that runs after the assets have been loaded.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 loading
-
Field Details
-
POOLS
public static final com.badlogic.gdx.utils.PoolManager POOLS -
graphics
protected com.badlogic.gdx.Graphics graphicsGraphics instance. -
stage
protected com.badlogic.gdx.scenes.scene2d.Stage stageThe user interface stage. -
skin
protected com.badlogic.gdx.scenes.scene2d.ui.Skin skinThe skin to use. -
interfaces
The GUI interfaces, if any. -
name
The name of this GUI. -
vr
protected boolean vrWhether we're in VR mode. -
unitsPerPixel
protected float unitsPerPixelUnits per pixel, 1/uiScale. This only works with a screen viewport. -
lock
Lock for sync. -
backBufferWidth
protected int backBufferWidth -
backBufferHeight
protected int backBufferHeight
-
-
Constructor Details
-
AbstractGui
-
-
Method Details
-
update
-
render
-
clearScreen
protected void clearScreen() -
getGuiStage
public com.badlogic.gdx.scenes.scene2d.Stage getGuiStage()Description copied from interface:IGuiReturns the stage- Specified by:
getGuiStagein interfaceIGui- Returns:
- The stage
-
getName
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
resize
-
resizeImmediate
public void resizeImmediate(int width, int height) Description copied from interface:IGuiResizes without waiting for the current loop to finish- Specified by:
resizeImmediatein interfaceIGui- Parameters:
width- The new widthheight- The new height
-
rebuildGui
protected abstract void rebuildGui()Adds the already created GUI objects to the stage. -
cancelTouchFocus
public boolean cancelTouchFocus()Description copied from interface:IGuiRemoves the focus from this GUI and returns true if the focus was in the GUI, false otherwise.- Specified by:
cancelTouchFocusin interfaceIGui- Returns:
- true if the focus was in the GUI, false otherwise.
-
findActor
Description copied from interface:IGuiReturns the first actor found with the specified name. Note this recursively compares the name of every actor in the GUI. -
setVisibilityToggles
Description copied from interface:IGuiSets the visibility state of the component entities- Specified by:
setVisibilityTogglesin interfaceIGui- Parameters:
entities- The entitiesvisible- The states
-
notify
-
setVR
-
isVR
-
mustDraw
-
updateUnitsPerPixel
public boolean updateUnitsPerPixel(float upp) Description copied from interface:IGuiUpdates the units-per-pixel value of this GUI. This defines the size of the GUI.- Specified by:
updateUnitsPerPixelin interfaceIGui
-
getUnitsPerPixel
public float getUnitsPerPixel()Description copied from interface:IGuiGets the units per pixel of this GUI.- Specified by:
getUnitsPerPixelin interfaceIGui- Returns:
- The units per pixel value.
-
setBackBufferSize
public void setBackBufferSize(int width, int height) Description copied from interface:IGuiSets the back buffer size.- Specified by:
setBackBufferSizein interfaceIGui
-
getBackBufferWidth
public int getBackBufferWidth() -
getBackBufferHeight
public int getBackBufferHeight()
-