Java Code Examples for org.andengine.opengl.texture.region.ITextureRegion#getTexture()

The following examples show how to use org.andengine.opengl.texture.region.ITextureRegion#getTexture() . 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: NineSliceSprite.java    From tilt-game-android with MIT License 5 votes vote down vote up
public NineSliceSprite(final float pX, final float pY, final float pWidth, final float pHeight, final ITextureRegion pTextureRegion, final float pInsetLeft, final float pInsetTop, final float pInsetRight, final float pInsetBottom, final VertexBufferObjectManager pVertexBufferObjectManager, final ShaderProgram pShaderProgram) {
	super(pX, pY, pWidth, pHeight);

	this.mTextureRegion = pTextureRegion;
	this.mInsetLeft = pInsetLeft;
	this.mInsetTop = pInsetTop;
	this.mInsetRight = pInsetRight;
	this.mInsetBottom = pInsetBottom;

	final ITexture texture = pTextureRegion.getTexture();
	this.mSpriteBatch = new SpriteBatch(texture, NINESLICESPRITE_CHILD_COUNT, pVertexBufferObjectManager, pShaderProgram);

	this.mTopLeftTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mTopCenterTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mTopRightTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mCenterLeftTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mCenterTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mCenterRightTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mBottomLeftTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mBottomCenterTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);
	this.mBottomRightTextureRegion = new TextureRegion(texture, 0, 0, 0, 0);

	this.updateTextureRegions();
	this.updateVertices();

	this.attachChild(this.mSpriteBatch);
}
 
Example 2
Source File: SpriteBatch.java    From tilt-game-android with MIT License 4 votes vote down vote up
protected void assertTexture(final ITextureRegion pTextureRegion) {
	if (pTextureRegion.getTexture() != this.mTexture) {
		throw new IllegalArgumentException("The supplied Texture does match the Texture of this " + this.getClass().getSimpleName() + "!");
	}
}
 
Example 3
Source File: ButtonSprite.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}
 
Example 4
Source File: ButtonSprite.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final ITextureRegion pPressedTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion, pPressedTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}
 
Example 5
Source File: ButtonSprite.java    From tilt-game-android with MIT License 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final ITextureRegion pPressedTextureRegion, final ITextureRegion pDisabledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion, pPressedTextureRegion, pDisabledTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}
 
Example 6
Source File: SpriteBatch.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
protected void assertTexture(final ITextureRegion pTextureRegion) {
	if(pTextureRegion.getTexture() != this.mTexture) {
		throw new IllegalArgumentException("The supplied Texture does match the Texture of this SpriteBatch!");
	}
}
 
Example 7
Source File: ButtonSprite.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}
 
Example 8
Source File: ButtonSprite.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final ITextureRegion pPressedTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion, pPressedTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}
 
Example 9
Source File: ButtonSprite.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public ButtonSprite(final float pX, final float pY, final ITextureRegion pNormalTextureRegion, final ITextureRegion pPressedTextureRegion, final ITextureRegion pDisabledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final OnClickListener pOnClickListener) {
	this(pX, pY, new TiledTextureRegion(pNormalTextureRegion.getTexture(), pNormalTextureRegion, pPressedTextureRegion, pDisabledTextureRegion), pVertexBufferObjectManager, pOnClickListener);
}