Hey Guys,
I am pretty new at all this and I have two question bothering me.
About my Project: It may sounds silly, but I am realizing a 2D Game in JME. I managed that with disabling the FlyCam and setting the z-Values of my Shapes to 0.
It worked just fine until now, but I have one question and one problem right now.
Problem:
I have two Geometrys which Materials are PNG-Textures. Both Materials are declared like this, just with two different PNGs
obstacle = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
obstacle.setTexture("ColorMap", app.getAssetManager().loadTexture("Obstacle-01.png"));
After that, I set the Translation of the two Geos like this
obstacleGeo.setLocalTranslation(6 , 1.75f, -2);
groundGeo.setLocalTranslation(6, 1.75f, -3);
The obstacleGeo lays on the groundGeo, like it was planed. The Texture of the obstacleGeo is transparent at some points (why I used PNGs), but at the Transparent parts of the obstacleGeo I don’t see the underlaying groundGeo, I am just seeing black (like the Background).
Soo, where is my mistake? Does JME not accept transparent Textures? Do I have to declare the Material in a special way so it becomes transparent?
My second question is a bit easier I guess: How can I set the Visual Background. It is black all the time, and I thought about setting a Geo with the screen Size in a node behind all nodes with a PNG-Texture, but I guess there is a more elegant way to do that.
I am sorry that I post two questions at once, but I thought maybe the transparent problem is somehow related to the background question.
Thank you guys for the help, cheers!