Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLES2 - TexturePacker with rotated TiledSprite bug correction #206

Open
wants to merge 1 commit into
base: GLES2
Choose a base branch
from

Conversation

flomin
Copy link

@flomin flomin commented Apr 10, 2013

I am using Texture packs with rotated TiledSprites (last up-to-date version of AndEngine-GLES2) and noticed that the TiledTextureRegion.create method is bugged in case the tiled texture is rotated.

Here is my way to create the TiledTexture:

final TexturePack lTexturePack = new TexturePackLoader(getAssets(), getEngine().getTextureManager()).loadFromAsset(TEXTURE_PACK_PATH_TO_XML_FILE, TEXTURE_PACKED_FOLDER);
lTexturePack.loadTexture();

final TexturePackTextureRegion lTexturePackerTextureRegion = lTexturePack.getTexturePackTextureRegionLibrary().get(IMAGE_ID_IN_PACK);
final TiledTextureRegion.create(lTexturePack.getTexture(), (int) lTexturePackerTextureRegion.getTextureX(), (int) lTexturePackerTextureRegion.getTextureY(),
                                (int) lTexturePackerTextureRegion.getWidth(), (int) lTexturePackerTextureRegion.getHeight(),
                                NB_COLS, NB_ROWS, lTexturePackerTextureRegion.isRotated());

You can find a proposal for correction in the pull request (TiledTextureRegion.create method).

Regards,
~ Florian Minjat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants