# How can I load a picture with alpha channel in JME?

This code loads a picture into the game:

Picture mypic= new Picture("mypic");
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?

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.

• It doesn't work. – Fab Mar 7 '14 at 16:18