Java Code Examples for org.andengine.entity.primitive.Rectangle#COLOR_INDEX

The following examples show how to use org.andengine.entity.primitive.Rectangle#COLOR_INDEX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HighPerformanceRectangleVertexBufferObject.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
public void onUpdateColor(final Rectangle pRectangle) {
	final float[] bufferData = this.mBufferData;

	final float packedColor = pRectangle.getColor().getABGRPackedFloat();

	bufferData[(0 * Rectangle.VERTEX_SIZE) + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[(1 * Rectangle.VERTEX_SIZE) + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[(2 * Rectangle.VERTEX_SIZE) + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[(3 * Rectangle.VERTEX_SIZE) + Rectangle.COLOR_INDEX] = packedColor;

	this.setDirtyOnHardware();
}
 
Example 2
Source File: HighPerformanceRectangleVertexBufferObject.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public void onUpdateColor(final Rectangle pRectangle) {
	final float[] bufferData = this.mBufferData;

	final float packedColor = pRectangle.getColor().getABGRPackedFloat();

	bufferData[0 * Rectangle.VERTEX_SIZE + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[1 * Rectangle.VERTEX_SIZE + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[2 * Rectangle.VERTEX_SIZE + Rectangle.COLOR_INDEX] = packedColor;
	bufferData[3 * Rectangle.VERTEX_SIZE + Rectangle.COLOR_INDEX] = packedColor;

	this.setDirtyOnHardware();
}