Package gaiasky.gui
Class VRGui<T extends IGui>
java.lang.Object
gaiasky.gui.VRGui<T>
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IGui
-
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.voiddispose()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 stagevoidinitialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch sb) Initializes the GUI, adding all the resources to the asset manager queue for loadingleft()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 finishright()voidsethOffset(int hOffset) Sets the horizontal offset, for VRvoidsetVisibilityToggles(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.voidupdateViewportSize(int w, int h, boolean centerCamera)
-
Constructor Details
-
VRGui
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch sb) Description copied from interface:IGuiInitializes the GUI, adding all the resources to the asset manager queue for loading- Specified by:
initializein interfaceIGui- Parameters:
assetManager- The asset manager to load the resources withsb- The sprite batch to use for this GUI's stage
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager assetManager) Description copied from interface:IGuiHook that runs after the assets have been loaded. Completes the initialization process- Specified by:
doneLoadingin interfaceIGui- Parameters:
assetManager- The asset manager
-
update
public void update(double dt) Description copied from interface:IGuiUpdates the GUI -
right
-
left
-
render
public void render(int rw, int rh) Description copied from interface:IGuiRenders this GUI -
resize
public void resize(int width, int height) Description copied from interface:IGuiResizes this GUI to the given values at the end of the current loop -
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
-
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.
-
getGuiStage
public com.badlogic.gdx.scenes.scene2d.Stage getGuiStage()Description copied from interface:IGuiReturns the stage- Specified by:
getGuiStagein interfaceIGui- Returns:
- The stage
-
setVisibilityToggles
Description copied from interface:IGuiSets the visibility state of the component entities- Specified by:
setVisibilityTogglesin interfaceIGui- Parameters:
entities- The entitiesvisible- The states
-
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. -
sethOffset
public void sethOffset(int hOffset) Description copied from interface:IGuiSets the horizontal offset, for VR- Specified by:
sethOffsetin interfaceIGui- Parameters:
hOffset- The horizontal offset in pixels
-
setVr
public void setVr(boolean vr) Description copied from interface:IGuiWhether this GUI is to be used in VR mode -
updateViewportSize
public void updateViewportSize(int w, int h, boolean centerCamera) -
mustDraw
public boolean mustDraw()Description copied from interface:IGuiReturns whether this GUI must be drawn or not -
updateUnitsPerPixel
public boolean updateUnitsPerPixel(float upp) Description copied from interface:IGuiUpdates the units-per-pixel value of this GUI. The units-per-pixel is the same as 1/UI_SCALE.- Specified by:
updateUnitsPerPixelin interfaceIGui
-