public class

Line

extends Shape
java.lang.Object
   ↳ org.andengine.entity.Entity
     ↳ org.andengine.entity.shape.Shape
       ↳ org.andengine.entity.primitive.Line

Class Overview

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

Summary

Nested Classes
class Line.HighPerformanceLineVertexBufferObject  
interface Line.ILineVertexBufferObject  
class Line.LowMemoryLineVertexBufferObject  
Constants
int COLOR_INDEX
int LINE_SIZE
float LINE_WIDTH_DEFAULT
int VERTEX_INDEX_X
int VERTEX_INDEX_Y
int VERTEX_SIZE
int VERTICES_PER_LINE
[Expand]
Inherited Constants
From interface org.andengine.entity.shape.IShape
Fields
public static final VertexBufferObjectAttributes VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT
protected final Line.ILineVertexBufferObject mLineVertexBufferObject
protected float mLineWidth
protected float mX2
protected float mY2
[Expand]
Inherited Fields
From class org.andengine.entity.shape.Shape
From class org.andengine.entity.Entity
Public Constructors
Line(float pX1, float pY1, float pX2, float pY2, VertexBufferObjectManager pVertexBufferObjectManager)
Line(float pX1, float pY1, float pX2, float pY2, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)
Line(float pX1, float pY1, float pX2, float pY2, float pLineWidth, VertexBufferObjectManager pVertexBufferObjectManager)
Line(float pX1, float pY1, float pX2, float pY2, float pLineWidth, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)
Line(float pX1, float pY1, float pX2, float pY2, float pLineWidth, Line.ILineVertexBufferObject pLineVertexBufferObject)
Public Methods
boolean collidesWith(IShape pOtherShape)
boolean contains(float pX, float pY)
float getLineWidth()
float[] getSceneCenterCoordinates()
Line.ILineVertexBufferObject getVertexBufferObject()
float getX()
This method is deprecated. Instead use getX1() or getX2().
float getX1()
float getX2()
float getY()
float getY1()
float getY2()
boolean isCulled(Camera pCamera)
Will only be performed if isCullingEnabled() is true.
void setLineWidth(float pLineWidth)
void setPosition(float pX, float pY)
This method is deprecated. Instead use setPosition(float, float, float, float).
void setPosition(float pX1, float pY1, float pX2, float pY2)
Protected Methods
void draw(GLState pGLState, Camera pCamera)
void onUpdateColor()
void onUpdateVertices()
void postDraw(GLState pGLState, Camera pCamera)
void preDraw(GLState pGLState, Camera pCamera)
[Expand]
Inherited Methods
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.IShape
From interface org.andengine.util.IDisposable

Constants

public static final int COLOR_INDEX

Constant Value: 2 (0x00000002)

public static final int LINE_SIZE

Constant Value: 6 (0x00000006)

public static final float LINE_WIDTH_DEFAULT

Constant Value: 1.0

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: 3 (0x00000003)

public static final int VERTICES_PER_LINE

Constant Value: 2 (0x00000002)

Fields

public static final VertexBufferObjectAttributes VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT

protected final Line.ILineVertexBufferObject mLineVertexBufferObject

protected float mLineWidth

protected float mX2

protected float mY2

Public Constructors

public Line (float pX1, float pY1, float pX2, float pY2, VertexBufferObjectManager pVertexBufferObjectManager)

public Line (float pX1, float pY1, float pX2, float pY2, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)

public Line (float pX1, float pY1, float pX2, float pY2, float pLineWidth, VertexBufferObjectManager pVertexBufferObjectManager)

public Line (float pX1, float pY1, float pX2, float pY2, float pLineWidth, VertexBufferObjectManager pVertexBufferObjectManager, VertexBufferObject.DrawType pDrawType)

public Line (float pX1, float pY1, float pX2, float pY2, float pLineWidth, Line.ILineVertexBufferObject pLineVertexBufferObject)

Public Methods

public boolean collidesWith (IShape pOtherShape)

public boolean contains (float pX, float pY)

public float getLineWidth ()

public float[] getSceneCenterCoordinates ()

public Line.ILineVertexBufferObject getVertexBufferObject ()

public float getX ()

This method is deprecated.
Instead use getX1() or getX2().

public float getX1 ()

public float getX2 ()

public float getY ()

public float getY1 ()

public float getY2 ()

public boolean isCulled (Camera pCamera)

Will only be performed if isCullingEnabled() is true.

Parameters
pCamera the currently active camera to perform culling checks against.
Returns
  • true when this object is visible by the Camera, false otherwise.

public void setLineWidth (float pLineWidth)

public void setPosition (float pX, float pY)

This method is deprecated.
Instead use setPosition(float, float, float, float).

public void setPosition (float pX1, float pY1, float pX2, float pY2)

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 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.