public class PopupState
extends com.jme3.app.state.BaseAppState
Modifier and Type | Class and Description |
---|---|
static class |
PopupState.ClickMode
Controls the behavior for clicks outside the specified popup.
|
Constructor and Description |
---|
PopupState() |
PopupState(com.jme3.scene.Node guiNode) |
Modifier and Type | Method and Description |
---|---|
void |
centerInGui(com.jme3.scene.Spatial s)
Positions the specified spatial so that it is in the center of
the GUI.
|
boolean |
clampToGui(com.jme3.scene.Spatial s)
Moves the specified GUI element so that it is the most on the
screen that it can be based on the current GUI size.
|
protected void |
cleanup(com.jme3.app.Application app) |
protected void |
close(com.simsilica.lemur.event.PopupState.PopupEntry entry) |
void |
closePopup(com.jme3.scene.Spatial popup)
Closes a previously opened popup.
|
protected com.jme3.scene.Geometry |
createBlocker(float z,
com.jme3.math.ColorRGBA backgroundColor) |
protected GuiMaterial |
createBlockerMaterial(com.jme3.math.ColorRGBA color) |
protected com.simsilica.lemur.event.PopupState.PopupEntry |
getEntry(com.jme3.scene.Spatial popup) |
com.jme3.scene.Node |
getGuiNode()
Returns the GUI node that will be used to display the option
panel.
|
com.jme3.math.Vector2f |
getGuiSize()
Returns the size of the screen based on the app's main camera size
and the current scale of the guiNode.
|
protected float |
getMaxGuiZ()
Calcules that maximum Z value given the current contents of
the GUI node.
|
protected float |
getMaxZ(com.jme3.bounding.BoundingVolume bv) |
protected float |
getMinZ(com.jme3.bounding.BoundingVolume bv) |
boolean |
hasActivePopups() |
protected void |
initialize(com.jme3.app.Application app) |
boolean |
isPopup(com.jme3.scene.Spatial s)
Returns true if the specified Spatial is still an active popup.
|
protected void |
onDisable() |
protected void |
onEnable() |
void |
setGuiNode(com.jme3.scene.Node guiNode)
Sets the GUI node that will be used to display the option
panel.
|
void |
showModalPopup(com.jme3.scene.Spatial popup)
Shows the specified spatial on the GUI node with a background blocker
geometry that will consume all mouse events until the popup has been
closed.
|
void |
showModalPopup(com.jme3.scene.Spatial popup,
com.jme3.math.ColorRGBA backgroundColor)
Shows the specified spatial on the GUI node with a background blocker
geometry that will consume all mouse events until the popup has been
closed.
|
void |
showModalPopup(com.jme3.scene.Spatial popup,
Command<? super PopupState> closeCommand)
Shows the specified spatial on the GUI node with a background blocker
geometry that will consume all mouse events until the popup has been
closed.
|
void |
showModalPopup(com.jme3.scene.Spatial popup,
Command<? super PopupState> closeCommand,
com.jme3.math.ColorRGBA backgroundColor)
Shows the specified spatial on the GUI node with a background blocker
geometry that will consume all mouse events until the popup has been
closed.
|
void |
showPopup(com.jme3.scene.Spatial popup)
Shows the specified spatial on the GUI node with a background blocker
geometry that will automatically close the spatial when clicked.
|
void |
showPopup(com.jme3.scene.Spatial popup,
Command<? super PopupState> closeCommand)
Shows the specified spatial on the GUI node with a background blocker
geometry that will automatically close the spatial when clicked.
|
void |
showPopup(com.jme3.scene.Spatial popup,
PopupState.ClickMode clickMode,
Command<? super PopupState> closeCommand,
com.jme3.math.ColorRGBA backgroundColor)
Shows the specified popup on the GUI node with the specified click mode
determining how background mouse events will be handled.
|
void |
update(float tpf) |
public PopupState()
public PopupState(com.jme3.scene.Node guiNode)
public boolean hasActivePopups()
public void showPopup(com.jme3.scene.Spatial popup)
public void showPopup(com.jme3.scene.Spatial popup, Command<? super PopupState> closeCommand)
public void showModalPopup(com.jme3.scene.Spatial popup)
public void showModalPopup(com.jme3.scene.Spatial popup, Command<? super PopupState> closeCommand)
public void showModalPopup(com.jme3.scene.Spatial popup, com.jme3.math.ColorRGBA backgroundColor)
public void showModalPopup(com.jme3.scene.Spatial popup, Command<? super PopupState> closeCommand, com.jme3.math.ColorRGBA backgroundColor)
public void showPopup(com.jme3.scene.Spatial popup, PopupState.ClickMode clickMode, Command<? super PopupState> closeCommand, com.jme3.math.ColorRGBA backgroundColor)
public boolean isPopup(com.jme3.scene.Spatial s)
public void closePopup(com.jme3.scene.Spatial popup)
protected void close(com.simsilica.lemur.event.PopupState.PopupEntry entry)
protected com.simsilica.lemur.event.PopupState.PopupEntry getEntry(com.jme3.scene.Spatial popup)
protected float getMaxGuiZ()
protected float getMaxZ(com.jme3.bounding.BoundingVolume bv)
protected float getMinZ(com.jme3.bounding.BoundingVolume bv)
protected GuiMaterial createBlockerMaterial(com.jme3.math.ColorRGBA color)
protected com.jme3.scene.Geometry createBlocker(float z, com.jme3.math.ColorRGBA backgroundColor)
public com.jme3.math.Vector2f getGuiSize()
public void centerInGui(com.jme3.scene.Spatial s)
public boolean clampToGui(com.jme3.scene.Spatial s)
public void setGuiNode(com.jme3.scene.Node guiNode)
public com.jme3.scene.Node getGuiNode()
protected void initialize(com.jme3.app.Application app)
initialize
in class com.jme3.app.state.BaseAppState
protected void cleanup(com.jme3.app.Application app)
cleanup
in class com.jme3.app.state.BaseAppState
protected void onEnable()
onEnable
in class com.jme3.app.state.BaseAppState
public void update(float tpf)
update
in interface com.jme3.app.state.AppState
update
in class com.jme3.app.state.BaseAppState
protected void onDisable()
onDisable
in class com.jme3.app.state.BaseAppState