|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpulpcore.sprite.Sprite
pulpcore.sprite.Group
public class Group
A container of Sprites.
| Field Summary |
|---|
| Fields inherited from class pulpcore.sprite.Sprite |
|---|
alpha, angle, CENTER, DEFAULT, EAST, enabled, height, NORTH, NORTH_EAST, NORTH_WEST, pixelSnapping, SOUTH, SOUTH_EAST, SOUTH_WEST, visible, WEST, width, x, y |
| Constructor Summary | |
|---|---|
Group()
|
|
Group(double x,
double y)
|
|
Group(double x,
double y,
double width,
double height)
|
|
Group(int x,
int y)
|
|
Group(int x,
int y,
int width,
int height)
|
|
| Method Summary | |
|---|---|
void |
add(Sprite sprite)
Adds a Sprite to this Group. |
boolean |
contains(Sprite sprite)
Returns true if this Group contains the specified Sprite. |
void |
createBackBuffer()
Creates a back buffer for this Group. |
void |
createBackBuffer(BlendMode blendMode)
Creates a back buffer for this Group, and sets the blend mode for rendering onto the back buffer. |
protected void |
drawSprite(CoreGraphics g)
Draws the sprite. |
Sprite |
get(int index)
Returns the sprite at the specified position in this group. |
protected int |
getAnchorX()
|
protected int |
getAnchorY()
|
BlendMode |
getBackBufferBlendMode()
Gets this Group's blend mode for rendering onto its back buffer. |
protected int |
getNaturalHeight()
|
protected int |
getNaturalWidth()
|
int |
getNumSprites()
Returns the number of sprites in this group and all child groups (not counting child Groups themselves). |
int |
getNumVisibleSprites()
Returns the number of visible sprites in this group and all child groups (not counting child Groups themselves). |
ArrayList |
getRemovedSprites()
Gets a list of all of the Sprites in this Group that were removed since the last call to this method. |
boolean |
hasBackBuffer()
Checks if this Group has a back buffer. |
Iterator |
iterator()
Returns an Iterator of the Sprites in this Group (in proper sequence). |
void |
moveDown(Sprite sprite)
Moves the specified Sprite down in z-order, swapping places with the first Sprite that appears below it. |
void |
moveToBottom(Sprite sprite)
Moves the specified Sprite to the bottom of the z-order, so that all the other Sprites currently in this Group appear above it. |
void |
moveToTop(Sprite sprite)
Moves the specified Sprite to the top of the z-order, so that all the other Sprites currently in this Group appear underneath it. |
void |
moveUp(Sprite sprite)
Moves the specified Sprite up in z-order, swapping places with the first Sprite that appears above it. |
void |
pack()
Packs this group so that its dimensions match the area covered by its children. |
Sprite |
pick(int viewX,
int viewY)
Finds the top-most sprite at the specified location, or null if none is found. |
Sprite |
pickEnabledAndVisible(int viewX,
int viewY)
Finds the top-most sprite that is enabled and visible at the specified location, or null if none is found. |
void |
remove(Sprite sprite)
Removes a Sprite from this Group. |
void |
removeAll()
Removes all Sprites from this Group. |
void |
removeBackBuffer()
Removes this Group's back buffer. |
void |
setBackBufferBlendMode(BlendMode backBufferBlendMode)
Sets this Group's blend mode for rendering onto its back buffer. |
int |
size()
Returns the number of sprites in this group. |
void |
update(int elapsedTime)
Updates all of this Sprite's properties. |
| Methods inherited from class pulpcore.sprite.Sprite |
|---|
bindLocationTo, bindSizeTo, clearCursor, clearDirtyRect, contains, draw, getAnchor, getBlendMode, getCursor, getDirtyRect, getLocalX, getLocalY, getParent, getPixelLevelChecks, getRoot, getScene2D, getViewX, getViewX, getViewY, getViewY, intersects, isDirty, isEnabled, isEnabledAndVisible, isMouseDoubleClicked, isMouseDown, isMouseHover, isMouseOver, isMousePressed, isMouseReleased, isMouseTripleClicked, isMouseWheelRotated, isPick, isPickEnabledAndVisible, isTransparent, move, move, move, move, move, move, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, propertyChange, scale, scale, scale, scale, scale, scale, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, setAnchor, setBlendMode, setCursor, setDirty, setLocation, setLocation, setSize, setSize, translate, translate, updateDirtyRect |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Group()
public Group(int x,
int y)
public Group(int x,
int y,
int width,
int height)
public Group(double x,
double y)
public Group(double x,
double y,
double width,
double height)
| Method Detail |
|---|
public Iterator iterator()
remove method.
public int size()
public Sprite get(int index)
null if
the index is out of range (index < 0 || index >= size()).
public boolean contains(Sprite sprite)
true if this Group contains the specified Sprite.
public Sprite pick(int viewX,
int viewY)
viewX - x-coordinate in view space.viewY - y-coordinate in view space.
public Sprite pickEnabledAndVisible(int viewX,
int viewY)
This Group or it's ancestors (if any) are not checked if they are enabled or visible.
This method is useful for finding a sprite to use to set the cursor or take mouse input from.
viewX - x-coordinate in view spaceviewY - y-coordinate in view space
public int getNumSprites()
public int getNumVisibleSprites()
public void add(Sprite sprite)
public void remove(Sprite sprite)
public void removeAll()
public void moveToTop(Sprite sprite)
public void moveToBottom(Sprite sprite)
public void moveUp(Sprite sprite)
public void moveDown(Sprite sprite)
public ArrayList getRemovedSprites()
This method is used by Scene2D to implement dirty rectangles.
public void pack()
public void createBackBuffer()
If this Group was created with a dimension (constructors Group(int,int,int,int)
or Group(double,double,double,double) or has a dimension after calling
pack(), then the back buffer has the same dimensions of this Group. Otherwise,
the back buffer has the same dimensions of the Stage.
public void createBackBuffer(BlendMode blendMode)
If this Group was created with a dimension (constructors Group(int,int,int,int)
or Group(double,double,double,double) or has a dimension after calling
pack(), then the back buffer has the same dimensions of this Group. Otherwise,
the back buffer has the same dimensions of the Stage.
public boolean hasBackBuffer()
public void removeBackBuffer()
public void setBackBufferBlendMode(BlendMode backBufferBlendMode)
backBufferBlendMode - the blend mode.public BlendMode getBackBufferBlendMode()
protected int getNaturalWidth()
getNaturalWidth in class Spriteprotected int getNaturalHeight()
getNaturalHeight in class Spriteprotected int getAnchorX()
getAnchorX in class Spriteprotected int getAnchorY()
getAnchorY in class Spritepublic void update(int elapsedTime)
Sprite
update in class Spriteprotected void drawSprite(CoreGraphics g)
Sprite
drawSprite in class Sprite
|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||