0
\$\begingroup\$

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);
        mypic.setHeight(settings.getHeight());
        mypic.setWidth(settings.getWidth());

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

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ It doesn't work. \$\endgroup\$
    – Fab
    Mar 7, 2014 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .