Loading From Bitmap

Problem

How do you use a Bitmap in your game as Sprite?

Solution

As Sprites basically just use TextureRegions we just need to create one. There is a fine method called TextureRegionFactory.createFromSource(final Texture pTexture, final ITextureSource pTextureSource, final int pTexturePositionX, final int pTexturePositionY) which takes object that implements ITextureSource.

You could use this implementation that uses your Bitmap objects for texture source.

implementation should be here

Based on forum thread.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License