Transparent Textures

I am a new in JME. Currently i am working on a 2.5D game.

I am using quad with textures to represent objects (this is only way to make sprites i know). Is it possibile to import texture with a transparent color in order to not display this color.









i want to get such result as shown above.

Thanks for help.

did you try a png with transparency?

  1. my PNG texture file was corupted.
  2. found wrking code:

    [java]

    box = new Box(new Vector3f(x,y,z), 0f,0.0f,0f);

    box_geom = new Geometry("abc", box);

    Material mat_tt = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");

    animation = assetManager.loadTexture("Textures/1.png");

    mat_tt.setTexture("ColorMap",animation);

    mat_tt.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

    boxgeom.setQueueBucket(Bucket.Transparent);

    box_geom.setMaterial(mat_tt);





    [/java]
1 Like