|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.Actor ch.aplu.jgamegrid.GGButtonBase ch.aplu.jgamegrid.GGButton
public class GGButton
Class that implements a button actor with standard behavior. Button events
'left entered', 'left exited', 'left pressed', 'left released' and 'left clicked' are
reported by a registered GGButtonListener.
The button is centered in the middle of a cell. Use Actor.setLocationOffset() to fine tune
the button location.
3 sprites are used: one for the released state, one
for the pressed state and one for the rollover state.
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.Actor |
---|
gameGrid, nbCycles |
Constructor Summary | |
---|---|
GGButton(java.lang.String buttonImage)
Same as GGButton(String buttonImage, false) (no rollover). |
|
GGButton(java.lang.String buttonImage,
boolean isRollover)
Creates a button from the given sprite images. |
Method Summary | |
---|---|
void |
addButtonListener(GGButtonListener listener)
Registers a GGButtonListener to get notifications when the button is manipulated. |
void |
addButtonOverListener(GGButtonOverListener listener)
Registers a GGOverButtonListener to get notifications when the mouse cursor enters the active mouse area. |
boolean |
isPressed()
Returns the current state of the ButtonA. |
Methods inherited from class ch.aplu.jgamegrid.GGButtonBase |
---|
isEnabled, setEnabled, setHotspotArea, setRefreshEnabled |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GGButton(java.lang.String buttonImage, boolean isRollover)
buttonImage
- the filename or URL of the 2 or 3 button spritesisRollover
- if true, a rollover image is usedpublic GGButton(java.lang.String buttonImage)
buttonImage
- the filename or URL of the 2 button spritesMethod Detail |
---|
public boolean isPressed()
public void addButtonListener(GGButtonListener listener)
listener
- the GGButtonListener to registerpublic void addButtonOverListener(GGButtonOverListener listener)
listener
- the GGButtonOverListener to register
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |