com.jme.ui
Class UIActiveArea
java.lang.Object
com.jme.scene.Spatial
com.jme.scene.Node
com.jme.ui.UIActiveArea
- All Implemented Interfaces:
- java.io.Serializable
- public class UIActiveArea
- extends Node
A rectangular screen area for handling mouse input and checking hit
tests.
- Author:
- schustej
- See Also:
- Serialized Form
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
|
Constructor Summary |
UIActiveArea(java.lang.String name,
int x,
int y,
int width,
int height,
InputHandler inputHandler)
Constructor, enter the x and y position (starting in lower left corner)
and width and height of the rectangle. |
|
Method Summary |
InputHandler |
getInputHandler()
Allows the developer to gain access to the inputHander that's being
used for the hitTest |
boolean |
hitTest()
Checks if the hot spot of the mouse is in the rectangle
area. |
void |
setInputHandler(InputHandler inputHandler)
Allows you to switch out the inputHandler being used for the hitTest |
| Methods inherited from class com.jme.scene.Node |
applyRenderState, attachChild, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, drawBounds, findCollisions, findPick, getChild, getChild, getChildren, getQuantity, hasChild, hasCollision, putClone, setChild, setForceView, updateCollisionTree, updateWorldBound, updateWorldData |
| Methods inherited from class com.jme.scene.Spatial |
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, isForceCulled, isForceView, onDraw, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, setZOrder, toString, updateGeometricState, updateRenderState, updateRenderState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_x
protected int _x
_y
protected int _y
_width
protected int _width
_height
protected int _height
_inputHandler
protected InputHandler _inputHandler
UIActiveArea
public UIActiveArea(java.lang.String name,
int x,
int y,
int width,
int height,
InputHandler inputHandler)
- Constructor, enter the x and y position (starting in lower left corner)
and width and height of the rectangle. The InputHandler should have
a mouse associated with it.
- Parameters:
x - y - width - height - inputHandler -
hitTest
public boolean hitTest()
- Checks if the hot spot of the mouse is in the rectangle
area. This method will always return false if the inputhandler
is null
- Returns:
- true if the hot spot of the mouse of the input handler is within the rectangle
setInputHandler
public void setInputHandler(InputHandler inputHandler)
- Allows you to switch out the inputHandler being used for the hitTest
- Parameters:
inputHandler -
getInputHandler
public InputHandler getInputHandler()
- Allows the developer to gain access to the inputHander that's being
used for the hitTest
- Returns: