Skip to content

Instantly share code, notes, and snippets.

@4poc
Created December 1, 2012 23:58
Show Gist options
  • Save 4poc/4186006 to your computer and use it in GitHub Desktop.
Save 4poc/4186006 to your computer and use it in GitHub Desktop.
LOLActivity.java
final AssetBitmapTextureAtlasSource sourceAtlas = AssetBitmapTextureAtlasSource.create(getAssets(), path);
int width = sourceAtlas.getTextureWidth();
int height = sourceAtlas.getTextureHeight();
BitmapTextureAtlas atlas = new BitmapTextureAtlas(getTextureManager(), width, height);
TiledTextureRegion texture = BitmapTextureAtlasTextureRegionFactory.createTiledFromSource(
atlas,
new ColorKeyBitmapTextureAtlasSourceDecorator(sourceAtlas, RectangleBitmapTextureAtlasSourceDecoratorShape
.getDefaultInstance(), android.graphics.Color.rgb(255, 0, 255)), 0, 0, width / tileWidth, height / tileHeight);
atlas.load();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment