Java Code Examples for org.andengine.entity.IEntity#isVisible()

The following examples show how to use org.andengine.entity.IEntity#isVisible() . 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: SpriteBatch.java    From tilt-game-android with MIT License 6 votes vote down vote up
/**
 * @see {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, float, float, float, float, float, float)} {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, Transformation, float, float, float, float)}.
 */
public void draw(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pRed, final float pGreen, final float pBlue, final float pAlpha) {
	if (pEntity.isVisible()) {
		this.assertCapacity();

		this.assertTexture(pTextureRegion);

		if (pEntity.isRotatedOrScaledOrSkewed()) {
			this.add(pTextureRegion, pEntity.getWidth(), pEntity.getHeight(), pEntity.getLocalToParentTransformation(), pRed, pGreen, pBlue, pAlpha);
		} else {
			this.add(pTextureRegion, pEntity.getX(), pEntity.getY(), pEntity.getWidth(), pEntity.getHeight(), pRed, pGreen, pBlue, pAlpha);
		}

		this.mIndex++;
	}
}
 
Example 2
Source File: SpriteBatch.java    From tilt-game-android with MIT License 6 votes vote down vote up
/**
 * @see {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, float, float, float)} {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, Transformation, float, float, float, float)}.
 */
public void draw(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pColorABGRPackedInt) {
	if (pEntity.isVisible()) {
		this.assertCapacity();

		this.assertTexture(pTextureRegion);

		if (pEntity.isRotatedOrScaledOrSkewed()) {
			this.addWithPackedColor(pTextureRegion, pEntity.getWidth(), pEntity.getHeight(), pEntity.getLocalToParentTransformation(), pColorABGRPackedInt);
		} else {
			this.addWithPackedColor(pTextureRegion, pEntity.getX(), pEntity.getY(), pEntity.getWidth(), pEntity.getHeight(), pColorABGRPackedInt);
		}

		this.mIndex++;
	}
}
 
Example 3
Source File: SpriteBatch.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
/**
 * @see {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, float, float, float, float, float, float)} {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, Transformation, float, float, float, float)}.
 */
public void draw(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pWidth, final float pHeight, final float pRed, final float pGreen, final float pBlue, final float pAlpha) {
	if(pEntity.isVisible()) {
		this.assertCapacity();

		this.assertTexture(pTextureRegion);

		if(pEntity.isRotatedOrScaledOrSkewed()) {
			this.add(pTextureRegion, pWidth, pHeight, pEntity.getLocalToParentTransformation(), pRed, pGreen, pBlue, pAlpha);
		} else {
			this.add(pTextureRegion, pEntity.getX(), pEntity.getY(), pWidth, pHeight, pRed, pGreen, pBlue, pAlpha);
		}

		this.mIndex++;
	}
}
 
Example 4
Source File: SpriteBatch.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
/**
 * @see {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, float, float, float)} {@link SpriteBatchVertexBufferObject#add(ITextureRegion, float, float, Transformation, float, float, float, float)}.
 */
public void draw(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pWidth, final float pHeight, final float pColorABGRPackedInt) {
	if(pEntity.isVisible()) {
		this.assertCapacity();

		this.assertTexture(pTextureRegion);

		if(pEntity.isRotatedOrScaledOrSkewed()) {
			this.addWithPackedColor(pTextureRegion, pWidth, pHeight, pEntity.getLocalToParentTransformation(), pColorABGRPackedInt);
		} else {
			this.addWithPackedColor(pTextureRegion, pEntity.getX(), pEntity.getY(), pWidth, pHeight, pColorABGRPackedInt);
		}

		this.mIndex++;
	}
}
 
Example 5
Source File: SpriteBatch.java    From tilt-game-android with MIT License 5 votes vote down vote up
public void drawWithoutChecks(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pRed, final float pGreen, final float pBlue, final float pAlpha) {
	if (pEntity.isVisible()) {
		if (pEntity.isRotatedOrScaledOrSkewed()) {
			this.add(pTextureRegion, pEntity.getWidth(), pEntity.getHeight(), pEntity.getLocalToParentTransformation(), pRed, pGreen, pBlue, pAlpha);
		} else {
			this.add(pTextureRegion, pEntity.getX(), pEntity.getY(), pEntity.getWidth(), pEntity.getHeight(), pRed, pGreen, pBlue, pAlpha);
		}

		this.mIndex++;
	}
}
 
Example 6
Source File: SpriteBatch.java    From tilt-game-android with MIT License 5 votes vote down vote up
public void drawWithoutChecks(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pColorABGRPackedInt) {
	if (pEntity.isVisible()) {
		if (pEntity.isRotatedOrScaledOrSkewed()) {
			this.addWithPackedColor(pTextureRegion, pEntity.getWidth(), pEntity.getHeight(), pEntity.getLocalToParentTransformation(), pColorABGRPackedInt);
		} else {
			this.addWithPackedColor(pTextureRegion, pEntity.getX(), pEntity.getY(), pEntity.getWidth(), pEntity.getHeight(), pColorABGRPackedInt);
		}

		this.mIndex++;
	}
}
 
Example 7
Source File: SpriteBatch.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
public void drawWithoutChecks(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pWidth, final float pHeight, final float pRed, final float pGreen, final float pBlue, final float pAlpha) {
	if(pEntity.isVisible()) {
		if(pEntity.isRotatedOrScaledOrSkewed()) {
			this.add(pTextureRegion, pWidth, pHeight, pEntity.getLocalToParentTransformation(), pRed, pGreen, pBlue, pAlpha);
		} else {
			this.add(pTextureRegion, pEntity.getX(), pEntity.getY(), pWidth, pHeight, pRed, pGreen, pBlue, pAlpha);
		}

		this.mIndex++;
	}
}
 
Example 8
Source File: SpriteBatch.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
public void drawWithoutChecks(final ITextureRegion pTextureRegion, final IEntity pEntity, final float pWidth, final float pHeight, final float pColorABGRPackedInt) {
	if(pEntity.isVisible()) {
		if(pEntity.isRotatedOrScaledOrSkewed()) {
			this.addWithPackedColor(pTextureRegion, pWidth, pHeight, pEntity.getLocalToParentTransformation(), pColorABGRPackedInt);
		} else {
			this.addWithPackedColor(pTextureRegion, pEntity.getX(), pEntity.getY(), pWidth, pHeight, pColorABGRPackedInt);
		}

		this.mIndex++;
	}
}