Should I create texture atlases for HUD elements or JME3 makes it "behind the loading process"?

I am porting my 2D videogame in 3D and I thought I should pack all my sprites for UI-elements in a single texture atlas and select specific regions of the texture to be used on the HUD. But I have not found any methods in the class Picture to set the bounds where the specific sprite is located in the PNG-file.

Is the packing all the UI elements in a single texture atlas (spritesheet) a good solution? Or I should forget this - JME can make all the conversions itself? If so - should I use dimensions like: 32x32, 64x64, 128x128,512x512 and so on for UI elements?

The Picture class is more of a “quick for demos” type of class. It’s not doing much and probably it’s whole job could have been one utility method somewhere. It’s just a Quad + Texture in a Geometry at the end of the day.

JME doesn’t do any magic here. Each Geometry is a separate object and will result in a separate draw call. If you only have a few thousand sprites then this is probably “good enough”.

Nothing stops you from going the slightly extra step of giving all of those Geometry the same material and putting them under a BatchNode… then some ‘magic’ will be done to turn them into one geometry per material for actual rendering. At that point, sharing textures can be useful for improving the batching. (Though note that 20,000 objects in a single batch is going to have its own performance problems.)

If you look at the source code for Quad.java you can see that setting the texture coordinates can be a one line call.

Excuse me, I didn’t understand your advice. I made before only 2D games. In 2D games it is important to pack all the game sprites in a single sprite sheet and render separate areas of the spritesheet. Using of separate PNG-textures for every sprite downgrades the framerate. What is about JME3? I’m new in 3D graphic programming

Yes, if you have a LOT of sprites then it can cause a performance issue. I gave advice in my post on how you can mitigate that. (Where “a LOT” is many many thousands.)

…the advice might be clearer after you are more familiar with JME. If you have not gone through the tutorials then I highly recommend them.