public class SpriteManager extends AbstractMediaManager
ALL, BACK, FRONT| Constructor and Description |
|---|
SpriteManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSprite(Sprite sprite)
Add a sprite to the set of sprites managed by this manager.
|
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.
|
createGraphics, fastForward, getRegionManager, init, isManaged, paint, queueNotification, renderOrderDidChange, tick, viewLocationDidChange, willPaintpublic 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 checkedpublic 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.Copyright © 2015. All rights reserved.