com.annahid.libs.artenus.graphics.sprites
ImageSprite
Displays an image block on the screen. It provides tools for retrieving portions of a atlas
texture and handling frames for animations.
See Also:
public class ImageSprite extends SpriteEntity
Field Summary
Fields inherited from com.annahid.libs.artenus.graphics.sprites.SpriteEntity
Constructor Summary
| Modifier and Type | Constructor and Description |
|---|---|
public | ImageSprite(int resourceId, ImageSprite.Cutout co) Creates an ImageSprite with the given texture and Cutout. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public int | getCurrentFrame() Gets the current frame for this ImageSprite. |
public Texture | getTexture() Gets the texture associated with this ImageSprite. |
public void | gotoFrame(int index) Sets the current frame for this ImageSprite. |
public void | render(RenderingContext context, int flags) Renders the visual content. |
Methods inherited from com.annahid.libs.artenus.graphics.sprites.SpriteEntity
advance, getAlpha, getAnimation, getColorFilter, getPosition, getRotation, getScale, hasBehavior, move, onAttach, onDetach, rotate, setAlpha, setAnimation, setColorFilter, setColorFilter, setPosition, setPosition, setRotation, setScale, setScaleMethods inherited from java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor Detail
| ImageSprite | ||||
|---|---|---|---|---|
public ImageSprite(
int resourceId,
ImageSprite.Cutout co
)Creates an ImageSprite with the given texture and Cutout. When
you create an ImageSprite, make sure that the corresponding texture exists
and is loaded beforehand. See TextureManager for more details.Parameters:
See Also:
|
Method Detail
| getCurrentFrame |
|---|
public int getCurrentFrame() Gets the current frame for this ImageSprite. Frames are determined by
the associated ImageSprite.Cutout. Returns:
The current frame |
| getTexture |
|---|
public Texture getTexture() Gets the texture associated with this ImageSprite. Returns:
The associated Texture |
| gotoFrame | ||
|---|---|---|
public void gotoFrame(
int index
)Sets the current frame for this ImageSprite. Frames are determined by
the associated ImageSprite.Cutout. Parameters:
|
| render |
|---|
public void render(
RenderingContext context,
int flags
)Renders the visual content. |