This code loads a picture into the game:

Picture mypic= new Picture("mypic");
        Texture2D tex = (Texture2D) assetManager.loadTexture("Textures/mypic.png");
        mypic.setTexture(assetManager, tex, false);

What have to be modified or add to show properly a picture with an alpha channel?


You should change this:

mypic.setTexture(assetManager, tex, false);

to this:

mypic.setTexture(assetManager, tex, true);

to show a picture with an alpha channel.

The third parameter is useAlpha, which, if set to false will just render your transparent/translucent pixels as black.

| improve this answer | |
  • \$\begingroup\$ It doesn't work. \$\endgroup\$ – Fab Mar 7 '14 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.