public abstract class

Shape

extends Entity
implements IShape
java.lang.Object
   ↳ org.anddev.andengine.entity.Entity
     ↳ org.anddev.andengine.entity.shape.Shape
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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

Summary

Constants
int BLENDFUNCTION_DESTINATION_DEFAULT
int BLENDFUNCTION_DESTINATION_PREMULTIPLYALPHA_DEFAULT
int BLENDFUNCTION_SOURCE_DEFAULT
int BLENDFUNCTION_SOURCE_PREMULTIPLYALPHA_DEFAULT
Fields
protected int mDestinationBlendFunction
protected int mSourceBlendFunction
[Expand]
Inherited Fields
From class org.anddev.andengine.entity.Entity
Public Constructors
Shape(float pX, float pY)
Public Methods
float getHeightScaled()
float getWidthScaled()
boolean isCullingEnabled()
boolean isVertexBufferManaged()
boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)
This method only fires if this Scene.ITouchArea is registered to the Scene via registerTouchArea(ITouchArea).
void reset()
void setBlendFunction(int pSourceBlendFunction, int pDestinationBlendFunction)
void setCullingEnabled(boolean pCullingEnabled)
void setVertexBufferManaged(boolean pVertexBufferManaged)
Protected Methods
void doDraw(GL10 pGL, Camera pCamera)
abstract void drawVertices(GL10 pGL, Camera pCamera)
void finalize()
abstract VertexBuffer getVertexBuffer()
abstract boolean isCulled(Camera pCamera)
Will only be performed if isCullingEnabled() is true.
void onApplyVertices(GL10 pGL)
void onInitDraw(GL10 pGL)
void onManagedDraw(GL10 pGL, Camera pCamera)
abstract void onUpdateVertexBuffer()
void updateVertexBuffer()
[Expand]
Inherited Methods
From class org.anddev.andengine.entity.Entity
From class java.lang.Object
From interface org.anddev.andengine.engine.handler.IUpdateHandler
From interface org.anddev.andengine.entity.IEntity
From interface org.anddev.andengine.entity.scene.Scene.ITouchArea
From interface org.anddev.andengine.entity.shape.IShape
From interface org.anddev.andengine.opengl.IDrawable

Constants

public static final int BLENDFUNCTION_DESTINATION_DEFAULT

Constant Value: 771 (0x00000303)

public static final int BLENDFUNCTION_DESTINATION_PREMULTIPLYALPHA_DEFAULT

Constant Value: 771 (0x00000303)

public static final int BLENDFUNCTION_SOURCE_DEFAULT

Constant Value: 770 (0x00000302)

public static final int BLENDFUNCTION_SOURCE_PREMULTIPLYALPHA_DEFAULT

Constant Value: 1 (0x00000001)

Fields

protected int mDestinationBlendFunction

protected int mSourceBlendFunction

Public Constructors

public Shape (float pX, float pY)

Public Methods

public float getHeightScaled ()

public float getWidthScaled ()

public boolean isCullingEnabled ()

public boolean isVertexBufferManaged ()

public boolean onAreaTouched (TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)

This method only fires if this Scene.ITouchArea is registered to the Scene via registerTouchArea(ITouchArea).

Returns

public void reset ()

public void setBlendFunction (int pSourceBlendFunction, int pDestinationBlendFunction)

public void setCullingEnabled (boolean pCullingEnabled)

public void setVertexBufferManaged (boolean pVertexBufferManaged)

Parameters
pVertexBufferManaged when passing true this Shape will make its VertexBuffer unload itself from the active BufferObjectManager, when this Shape is finalized/garbage-collected. WARNING: When passing false one needs to take care of that by oneself!

Protected Methods

protected void doDraw (GL10 pGL, Camera pCamera)

Parameters
pGL the OpenGL GL1.0 Context (potentially higher than 1.0) to use for drawing.
pCamera the currently active Camera i.e. to be used for culling.

protected abstract void drawVertices (GL10 pGL, Camera pCamera)

protected void finalize ()

Throws
Throwable

protected abstract VertexBuffer getVertexBuffer ()

protected abstract boolean isCulled (Camera pCamera)

Will only be performed if isCullingEnabled() is true.

Returns
  • true when this object is visible by the Camera, false otherwise.

protected void onApplyVertices (GL10 pGL)

protected void onInitDraw (GL10 pGL)

protected void onManagedDraw (GL10 pGL, Camera pCamera)

protected abstract void onUpdateVertexBuffer ()

protected void updateVertexBuffer ()