How to convert a text drawn using BitmapFont in LibGDX in an array of Sprites/TextureMapObjects?

15 Views Asked by At

I create a videogame using LibGDX and Tiled. I need to draw texts on my tiled map but the map contains only TextureMapObjects. There are no classes like TextMapObject. I don't want to render the text between layers - I need that the text will be inside the graphic layer to be sorted in according to the Y-coordinate (I create a game in Legend of Zelda: Link's awakening style and I need sort the objects on the tiled map to get the right rendering subsequence). I don't want to break the code architecture and I thought there are classes to convert a bitmap text in an array of Sprites (com.badlogic.gdx.graphics.g2d.Sprite). After that I can simple create a TextureMapObject for every glyph and add their on my tiledMap. It must be so:

ArrayList <Sprite> glyphSprites = TextConverter.convert(GlyphLayout, floatRenderCoordinateX, floatRenderCoordinateY);

It is logically but I can not find any tools. How can I convert my text in a Sprite or TextureMapObject?

0

There are 0 best solutions below