public class GuiGlobals
extends java.lang.Object
When initialized, GuiGlobals will keep a reference to the AssetManager for use in creating materials, loading fonts, and so on. It will also:
For applications that wish to customize the behavior of GuiGlobals, it is possible to set a custom subclass instead of initializing the default implemenation. Examples of reasons do do this might include using custom materials instead of the default JME materials or otherwise customizing the initialization setup.
Modifier | Constructor and Description |
---|---|
protected |
GuiGlobals(com.jme3.app.Application app) |
Modifier and Type | Method and Description |
---|---|
void |
addKeyListener(KeyListener l) |
GuiMaterial |
createMaterial(boolean lit) |
GuiMaterial |
createMaterial(com.jme3.math.ColorRGBA color,
boolean lit) |
GuiMaterial |
createMaterial(com.jme3.texture.Texture texture,
boolean lit) |
void |
fixFont(com.jme3.font.BitmapFont font)
Goes through all of the font page materials and sets
alpha test and alpha fall-off.
|
AnimationState |
getAnimationState() |
protected com.jme3.asset.AssetManager |
getAssetManager() |
com.jme3.renderer.ViewPort |
getCollisionViewPort(com.jme3.scene.Spatial s)
Deprecated.
|
com.jme3.scene.Spatial |
getCurrentFocus() |
FocusManagerState |
getFocusManagerState() |
FocusNavigationState |
getFocusNavigationState() |
protected java.lang.String |
getIconBase() |
InputMapper |
getInputMapper() |
static GuiGlobals |
getInstance() |
PopupState |
getPopupState() |
com.jme3.math.Vector3f |
getScreenCoordinates(com.jme3.scene.Spatial relativeTo,
com.jme3.math.Vector3f pos)
Deprecated.
|
Styles |
getStyles() |
boolean |
hasRequestedCursorEnabled(java.lang.Object owner)
Returns true if the specified owner has an active cursor
enabled request pending.
|
static void |
initialize(com.jme3.app.Application app) |
boolean |
isCursorEventsEnabled() |
protected boolean |
isHeadless(com.jme3.app.Application app) |
boolean |
isMouseEventsEnabled()
Deprecated.
Use isCursorEventsEnabled() instead.
|
void |
lightFont(com.jme3.font.BitmapFont font) |
com.jme3.texture.Texture |
loadDefaultIcon(java.lang.String name) |
com.jme3.font.BitmapFont |
loadFont(java.lang.String path) |
com.jme3.texture.Texture |
loadTexture(java.lang.String path,
boolean repeat,
boolean generateMips) |
protected void |
logBuildInfo() |
boolean |
releaseCursorEnabled(java.lang.Object owner)
Releases a previous cursor request for the specified
sowner.
|
void |
releaseFocus(com.jme3.scene.Spatial s) |
void |
removeKeyListener(KeyListener l) |
void |
requestCursorEnabled(java.lang.Object owner)
Indicates that the specified owner requires the cursor
to be enabled.
|
void |
requestFocus(com.jme3.scene.Spatial s) |
void |
setCursorEventsEnabled(boolean f) |
void |
setCursorEventsEnabled(boolean f,
boolean force)
The same as setCursorEventsEnabled(f) except that this will force
the cursor enabled state even if there are pending requests otherwise.
|
protected void |
setDefaultStyles() |
static void |
setInstance(GuiGlobals globals) |
void |
setMouseEventsEnabled(boolean f)
Deprecated.
Use setCursorEventsEnabled() instead.
|
void |
setupGuiComparators(com.jme3.renderer.ViewPort view) |
com.jme3.math.ColorRGBA |
srgbaColor(com.jme3.math.ColorRGBA srgbColor)
Creates a color from the specified RGBA values as if they were in SRGB space,
depending on whether gamma correction is enabled or disabled.
|
com.jme3.math.ColorRGBA |
srgbaColor(float r,
float g,
float b,
float a)
Creates a color from the specified RGBA values as if they were in SRGB space,
depending on whether gamma correction is enabled or disabled.
|
public static void initialize(com.jme3.app.Application app)
public static void setInstance(GuiGlobals globals)
public static GuiGlobals getInstance()
protected boolean isHeadless(com.jme3.app.Application app)
protected com.jme3.asset.AssetManager getAssetManager()
protected java.lang.String getIconBase()
protected void logBuildInfo()
public void setupGuiComparators(com.jme3.renderer.ViewPort view)
protected void setDefaultStyles()
public Styles getStyles()
public InputMapper getInputMapper()
public AnimationState getAnimationState()
public PopupState getPopupState()
public FocusManagerState getFocusManagerState()
public FocusNavigationState getFocusNavigationState()
public void fixFont(com.jme3.font.BitmapFont font)
public void lightFont(com.jme3.font.BitmapFont font)
public com.jme3.font.BitmapFont loadFont(java.lang.String path)
public GuiMaterial createMaterial(boolean lit)
public GuiMaterial createMaterial(com.jme3.math.ColorRGBA color, boolean lit)
public GuiMaterial createMaterial(com.jme3.texture.Texture texture, boolean lit)
public com.jme3.texture.Texture loadDefaultIcon(java.lang.String name)
public com.jme3.texture.Texture loadTexture(java.lang.String path, boolean repeat, boolean generateMips)
public com.jme3.math.ColorRGBA srgbaColor(float r, float g, float b, float a)
public com.jme3.math.ColorRGBA srgbaColor(com.jme3.math.ColorRGBA srgbColor)
public void requestFocus(com.jme3.scene.Spatial s)
public void releaseFocus(com.jme3.scene.Spatial s)
public com.jme3.scene.Spatial getCurrentFocus()
public void addKeyListener(KeyListener l)
public void removeKeyListener(KeyListener l)
@Deprecated public com.jme3.renderer.ViewPort getCollisionViewPort(com.jme3.scene.Spatial s)
public void requestCursorEnabled(java.lang.Object owner)
public boolean releaseCursorEnabled(java.lang.Object owner)
public boolean hasRequestedCursorEnabled(java.lang.Object owner)
@Deprecated public void setMouseEventsEnabled(boolean f)
public void setCursorEventsEnabled(boolean f)
public void setCursorEventsEnabled(boolean f, boolean force)
@Deprecated public boolean isMouseEventsEnabled()
public boolean isCursorEventsEnabled()
@Deprecated public com.jme3.math.Vector3f getScreenCoordinates(com.jme3.scene.Spatial relativeTo, com.jme3.math.Vector3f pos)