Class StandaloneVRGui<T extends IGui>
java.lang.Object
gaiasky.gui.vr.StandaloneVRGui<T>
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IGui, XrRenderer
-
Constructor Summary
ConstructorsConstructorDescriptionStandaloneVRGui(XrDriver xrDriver, Class<T> guiClass, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, XrInputListener listener) -
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 stagefloatGets the units per pixel of this GUI.voidinitialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) 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 GUIvoidrenderMirrorToDesktop(int textureHandle) Render to the desktop.voidrenderOpenXRView(org.lwjgl.openxr.XrCompositionLayerProjectionView layerView, org.lwjgl.openxr.XrSwapchainImageOpenGLKHR swapchainImage, com.badlogic.gdx.graphics.glutils.FrameBuffer frameBuffer, int viewIndex) Executed for each eye every cycle.voidresize(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.voidsetRenderToScreen(boolean renderToScreen) 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.
-
Constructor Details
-
StandaloneVRGui
public StandaloneVRGui(XrDriver xrDriver, Class<T> guiClass, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, XrInputListener listener)
-
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) 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 withspriteBatch- 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
-
render
-
renderOpenXRView
public void renderOpenXRView(org.lwjgl.openxr.XrCompositionLayerProjectionView layerView, org.lwjgl.openxr.XrSwapchainImageOpenGLKHR swapchainImage, com.badlogic.gdx.graphics.glutils.FrameBuffer frameBuffer, int viewIndex) Description copied from interface:XrRendererExecuted for each eye every cycle.- Specified by:
renderOpenXRViewin interfaceXrRenderer- Parameters:
layerView- The layer view.swapchainImage- The swap-chain image.frameBuffer- The frame buffer to draw to.viewIndex- The view index.
-
renderMirrorToDesktop
public void renderMirrorToDesktop(int textureHandle) Description copied from interface:XrRendererRender to the desktop.- Specified by:
renderMirrorToDesktopin interfaceXrRenderer- Parameters:
textureHandle- The texture handle
-
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
-
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. -
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
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
setRenderToScreen
public void setRenderToScreen(boolean renderToScreen)
-