public class GGToggleButton extends GGButtonBase
Constructor and Description |
---|
GGToggleButton(java.lang.String buttonImage)
Same as GGToggleButton(String buttonImage, false, false) (no rollover, untoggled).
|
GGToggleButton(java.lang.String buttonImage,
boolean isRollover)
Same as GGToggleButton(String buttonImage, boolean isRollover, false) (untoggled).
|
GGToggleButton(java.lang.String buttonImage,
boolean isRollover,
boolean isToggled)
Creates a button from the given sprite images.
|
Modifier and Type | Method and Description |
---|---|
void |
addButtonOverListener(GGButtonOverListener listener)
Registers a GGOverButtonListener to get notifications when the mouse cursor
enters the active mouse area.
|
void |
addToggleButtonListener(GGToggleButtonListener listener)
Registers a GGToggleButtonListener to get notifications when the button is manipulated.
|
boolean |
isToggled()
Returns the current state of the button.
|
void |
reset()
Overrides the actor's reset() called when the button is added to the game grid.
|
void |
setToggled(boolean b)
Sets the button in the toggled/untoggled state.
|
isEnabled, setEnabled, setHotspotArea, setRefreshEnabled
act, addActorCollisionListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionTile, addCollisionTiles, addMouseTouchListener, addMouseTouchListener, addTileCollisionListener, collide, collide, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocation, getLocationOffset, getLocationStart, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getX, getXStart, getY, getYStart, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isTileCollisionEnabled, isVertMirror, isVisible, move, move, nearBorder, removeSelf, rotate, rotate, setActEnabled, setActorCollisionEnabled, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocation, setLocationOffset, setLocationOffset, setMouseTouchCircle, setMouseTouchCircle, setMouseTouchEnabled, setMouseTouchImage, setMouseTouchImage, setMouseTouchRectangle, setMouseTouchRectangle, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setTileCollisionEnabled, setVertMirror, setX, setY, show, show, showNextSprite, showPreviousSprite, turn
public GGToggleButton(java.lang.String buttonImage, boolean isRollover, boolean isToggled)
buttonImage
- the filename or URL of the 2 or 4 button spritesisRollover
- if true, rollover imaged are usedisToggled
- if true, the button is initially toggled; otherwise it is untoggledpublic GGToggleButton(java.lang.String buttonImage, boolean isRollover)
buttonImage
- the filename or URL of the 2 or 4 button spritespublic GGToggleButton(java.lang.String buttonImage)
buttonImage
- the filename or URL of the 2 button spritespublic void reset()
public boolean isToggled()
public void setToggled(boolean b)
b
- if true, the button is toggled; otherwise it is untoggledpublic void addToggleButtonListener(GGToggleButtonListener listener)
listener
- the GGToggleButtonListener to registerpublic void addButtonOverListener(GGButtonOverListener listener)
listener
- the GGButtonOverListener to register