LibGDX - Sprite to Pixmap

I use LibGDX for a small application project, and I need to somehow take a series of sprites and put them (or their pixels) in the Pixmap. The main idea is to accept random sprites that are generated by various means while the application is running, and only at a certain time combine some of them into one background sprite.

I believe that most of this can be done easily, but the step of getting sprite images in Pixmap is not so obvious to me. Sprites also have various transparent and translucent pixels, so just capturing the color on each pixel while it is on the same screen is also not applicable, since it obviously should not accept the background color with it.

If there is a suitable alternative to this to accomplish what I am looking for, I would also like to hear it. Any help is appreciated.

+4
source share
1 answer

I think you want to make your sprites an off-screen buffer (called "FBO" or FrameBuffer in libgdx) (mixing them as you add them), and then render this screen buffer on screen as a single call call? If so, this question should help: libgdx SpriteBatch script for texture

This requires OpenGL ES 2.0, which will eliminate support for some older devices.

+3
source

All Articles