old game engines designate the first color of an image's palette as a transparent color. is there a way to do the same with libGDX?
i tried loading the picture and replacing the palete's first color with 0x00000000. however since the pixels are either opaque or transparent i dont need alpha values so i could save a lot of memory by using RGB888 instead of RGBA8888. i lookes through the gdx and opengl documentary for other blending options and found Gdx.gl20.glBlendColor and the SpriteBatch's setBlendFunction function. but they only change the values used in the blending equations.
thanks in advance :)
to draw a textureRegion transparently use the routine like this:
Color c = batch.getColor();
batch.setColor(1, 1, 1, alpha);
batch.draw(....);
batch.setColor(c);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With