public class SpriteFactory
extends java.lang.Object
Use the sprite factory in the sprite manager so that the manager produce
instance of a chosen subclass of Sprite
. This is useful if you intend
to have each sprite pertain to the same subclass. If you intend to have
different kinds of sprites at the same time in the same manager, use
SpriteManager.addSprite(String, Class)
instead.
Constructor and Description |
---|
SpriteFactory() |
Modifier and Type | Method and Description |
---|---|
Sprite |
newSprite(java.lang.String identifier,
SpriteManager manager,
Values position)
Create a new sprite for the given manager with the given identifier.
|
public Sprite newSprite(java.lang.String identifier, SpriteManager manager, Values position)
identifier
- Identifier of the newly created sprite.manager
- The sprite manager this sprite will pertain to.position
- The sprite initial position or null for (0,0,0,GU).