public class

Sprite

extends RectangularShape
java.lang.Object
   ↳ org.andengine.entity.Entity
     ↳ org.andengine.entity.shape.Shape
       ↳ org.andengine.entity.shape.RectangularShape
         ↳ org.andengine.entity.sprite.Sprite
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

(c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.

Summary

Nested Classes
class Sprite.HighPerformanceSpriteVertexBufferObject  
interface Sprite.ISpriteVertexBufferObject  
class Sprite.LowMemorySpriteVertexBufferObject  
Constants
int COLOR_INDEX
int SPRITE_SIZE
int TEXTURECOORDINATES_INDEX_U
int TEXTURECOORDINATES_INDEX_V
int VERTEX_INDEX_X
int VERTEX_INDEX_Y
int VERTEX_SIZE
int VERTICES_PER_SPRITE
[Expand]
Inherited Constants
From interface org.andengine.entity.shape.IShape
Fields
public static final VertexBufferObjectAttributes VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT
protected boolean mFlippedHorizontal
protected boolean mFlippedVertical
protected final Sprite.ISpriteVertexBufferObject mSpriteVertexBufferObject
protected final ITextureRegion mTextureRegion
[Expand]
Inherited Fields
From class org.andengine.entity.shape.RectangularShape
From class org.andengine.entity.shape.Shape
From class org.andengine.entity.Entity
Public Constructors
Sprite(float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager)
Sprite(float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, ShaderProgram pShaderProgram)
Sprite(float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)
Sprite(float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType, ShaderProgram pShaderProgram)
Sprite(float pX, float pY, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pVertexBufferObject)
Sprite(float pX, float pY, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pVertexBufferObject, ShaderProgram pShaderProgram)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, ShaderProgram pShaderProgram)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType, ShaderProgram pShaderProgram)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pSpriteVertexBufferObject)
Sprite(float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pSpriteVertexBufferObject, ShaderProgram pShaderProgram)
Public Methods
ITextureRegion getTextureRegion()
Sprite.ISpriteVertexBufferObject getVertexBufferObject()
boolean isFlippedHorizontal()
boolean isFlippedVertical()
void reset()
void setFlippedHorizontal(boolean pFlippedHorizontal)
void setFlippedVertical(boolean pFlippedVertical)
Protected Methods
void draw(GLState pGLState, Camera pCamera)
void onUpdateColor()
void onUpdateTextureCoordinates()
void onUpdateVertices()
void postDraw(GLState pGLState, Camera pCamera)
void preDraw(GLState pGLState, Camera pCamera)
[Expand]
Inherited Methods
From class org.andengine.entity.shape.RectangularShape
From class org.andengine.entity.shape.Shape
From class org.andengine.entity.Entity
From class java.lang.Object
From interface org.andengine.engine.handler.IDrawHandler
From interface org.andengine.engine.handler.IUpdateHandler
From interface org.andengine.entity.IEntity
From interface org.andengine.entity.scene.Scene.ITouchArea
From interface org.andengine.entity.shape.IAreaShape
From interface org.andengine.entity.shape.IShape
From interface org.andengine.util.IDisposable

Constants

public static final int COLOR_INDEX

Constant Value: 2 (0x00000002)

public static final int SPRITE_SIZE

Constant Value: 20 (0x00000014)

public static final int TEXTURECOORDINATES_INDEX_U

Constant Value: 3 (0x00000003)

public static final int TEXTURECOORDINATES_INDEX_V

Constant Value: 4 (0x00000004)

public static final int VERTEX_INDEX_X

Constant Value: 0 (0x00000000)

public static final int VERTEX_INDEX_Y

Constant Value: 1 (0x00000001)

public static final int VERTEX_SIZE

Constant Value: 5 (0x00000005)

public static final int VERTICES_PER_SPRITE

Constant Value: 4 (0x00000004)

Fields

public static final VertexBufferObjectAttributes VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT

protected boolean mFlippedHorizontal

protected boolean mFlippedVertical

protected final Sprite.ISpriteVertexBufferObject mSpriteVertexBufferObject

protected final ITextureRegion mTextureRegion

Public Constructors

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager)

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, ShaderProgram pShaderProgram)

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType, ShaderProgram pShaderProgram)

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pVertexBufferObject)

public Sprite (float pX, float pY, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pVertexBufferObject, ShaderProgram pShaderProgram)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, ShaderProgram pShaderProgram)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType, ShaderProgram pShaderProgram)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pSpriteVertexBufferObject)

public Sprite (float pX, float pY, float pWidth, float pHeight, ITextureRegion pTextureRegion, Sprite.ISpriteVertexBufferObject pSpriteVertexBufferObject, ShaderProgram pShaderProgram)

Public Methods

public ITextureRegion getTextureRegion ()

public Sprite.ISpriteVertexBufferObject getVertexBufferObject ()

public boolean isFlippedHorizontal ()

public boolean isFlippedVertical ()

public void reset ()

public void setFlippedHorizontal (boolean pFlippedHorizontal)

public void setFlippedVertical (boolean pFlippedVertical)

Protected Methods

protected void draw (GLState pGLState, Camera pCamera)

Parameters
pGLState the currently active GLState i.e. to apply transformations to.
pCamera the currently active Camera i.e. to be used for culling.

protected void onUpdateColor ()

protected void onUpdateTextureCoordinates ()

protected void onUpdateVertices ()

protected void postDraw (GLState pGLState, Camera pCamera)

Parameters
pGLState the currently active GLState i.e. to apply transformations to.
pCamera the currently active Camera i.e. to be used for culling.

protected void preDraw (GLState pGLState, Camera pCamera)

Parameters
pGLState the currently active GLState i.e. to apply transformations to.
pCamera the currently active Camera i.e. to be used for culling.