|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.AbstractMediaManager
com.threerings.media.sprite.SpriteManager
public class SpriteManager
The sprite manager manages the sprites running about in the game.
| Field Summary | |
|---|---|
protected SortableArrayList<Sprite> |
_sprites
|
| Fields inherited from class com.threerings.media.AbstractMediaManager |
|---|
_host, _media, _notify, _remgr, _tickpos, _tickStamp, RENDER_ORDER |
| Fields inherited from interface com.threerings.media.MediaConstants |
|---|
ALL, BACK, FRONT |
| Constructor Summary | |
|---|---|
SpriteManager()
|
|
| Method Summary | |
|---|---|
void |
addSprite(Sprite sprite)
Add a sprite to the set of sprites managed by this manager. |
protected SortableArrayList<? extends AbstractMedia> |
createMediaList()
Type safety jockeying. |
Iterator<Sprite> |
enumerateSprites()
Returns an iterator over our managed sprites. |
Sprite |
getHighestHitSprite(int x,
int y)
Finds the sprite with the highest render order that hits the specified pixel. |
void |
getHitSprites(List<Sprite> list,
int x,
int y)
When an animated view is determining what entity in its view is under the mouse pointer, it may require a list of sprites that are "hit" by a particular pixel. |
void |
getIntersectingSprites(List<Sprite> list,
Shape shape)
When an animated view processes its dirty rectangles, it may require an expansion of the dirty region which may in turn require the invalidation of more sprites than were originally invalid. |
List<Sprite> |
getSprites()
Returns a list of all sprites registered with the sprite manager. |
void |
removeSprite(Sprite sprite)
Removes the specified sprite from the set of sprites managed by this manager. |
void |
removeSprites(Predicate<Sprite> pred)
Removes all sprites that match the supplied predicate. |
void |
renderSpritePaths(Graphics2D gfx)
Render the sprite paths to the given graphics context. |
| Methods inherited from class com.threerings.media.AbstractMediaManager |
|---|
clearMedia, createGraphics, dispatchNotifications, fastForward, getRegionManager, init, insertMedia, isManaged, paint, queueNotification, removeMedia, renderOrderDidChange, tick, tickAllMedia, tickMedia, viewLocationDidChange, willPaint |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SortableArrayList<Sprite> _sprites
| Constructor Detail |
|---|
public SpriteManager()
| Method Detail |
|---|
public void getIntersectingSprites(List<Sprite> list,
Shape shape)
list - the list to fill with any intersecting sprites.shape - the shape in which we have interest.
public void getHitSprites(List<Sprite> list,
int x,
int y)
list - the list to fill with any intersecting sprites, the sprites with the highest
render order provided first.x - the x (screen) coordinate to be checked.y - the y (screen) coordinate to be checked.
public Sprite getHighestHitSprite(int x,
int y)
x - the x (screen) coordinate to be checkedy - the y (screen) coordinate to be checked
public void addSprite(Sprite sprite)
sprite - the sprite to add.public List<Sprite> getSprites()
addSprite(com.threerings.media.sprite.Sprite) or removeSprite(com.threerings.media.sprite.Sprite).
public Iterator<Sprite> enumerateSprites()
Iterator.remove().
public void removeSprite(Sprite sprite)
sprite - the sprite to remove.public void removeSprites(Predicate<Sprite> pred)
public void renderSpritePaths(Graphics2D gfx)
gfx - the graphics context.protected SortableArrayList<? extends AbstractMedia> createMediaList()
AbstractMediaManager
createMediaList in class AbstractMediaManager
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||