|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtgl.gaming.SpriteGroup
public final class SpriteGroup
Represents a group of independent Sprites that can be managed as one.
This class is an optimized vector of Sprites that manages group drawing,animation,action,visibility,etc.
The api used is similar to java.util.Vector
*
Constructor Summary | |
---|---|
SpriteGroup()
Creates a new instance of IntVector |
|
SpriteGroup(int initialSize)
Creates a new instance of IntVector |
Method Summary | |
---|---|
void |
action(long currentTime)
|
void |
add(Sprite sprite)
|
void |
animate(long currentTime)
|
void |
clear()
|
void |
draw(JTGLGraphics gc)
|
void |
drawFB(JTGLGraphics gc)
Draw from Front to Background |
int |
getCapacity()
|
int |
getSize()
|
Sprite |
getSprite(int index)
|
int |
indexOf(Sprite sprite)
|
int |
indexOf(Sprite sprite,
int index)
|
void |
insertSpriteAt(Sprite sprite,
int index)
|
boolean |
isEmpty()
|
void |
move()
|
void |
move(int dx,
int dy)
|
void |
moveRefTo(int x,
int y,
boolean doValidate)
|
boolean |
remove(Sprite sprite)
|
void |
removeSpriteAt(int index)
|
void |
setMove(int moveX,
int moveY)
|
void |
setSize(int newSize)
|
void |
setSprite(int index,
Sprite sprite)
|
void |
setVisible(boolean visible)
|
java.lang.String |
toString()
|
void |
trimToSize()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpriteGroup()
public SpriteGroup(int initialSize)
Method Detail |
---|
public void action(long currentTime)
public void animate(long currentTime)
public void setVisible(boolean visible)
public void setMove(int moveX, int moveY)
public void move()
public void move(int dx, int dy)
public void moveRefTo(int x, int y, boolean doValidate)
public void draw(JTGLGraphics gc)
public void drawFB(JTGLGraphics gc)
public int getCapacity()
public int getSize()
public Sprite getSprite(int index)
public void setSprite(int index, Sprite sprite)
public void add(Sprite sprite)
public void insertSpriteAt(Sprite sprite, int index)
public void removeSpriteAt(int index)
public boolean remove(Sprite sprite)
public void clear()
public void trimToSize()
public void setSize(int newSize)
public boolean isEmpty()
public int indexOf(Sprite sprite, int index)
public int indexOf(Sprite sprite)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |