How is Text exported from Blender to BGE?

How is text drawn in BGE? How does Blender export Text into BGE (given that it’s a type of curve).

Are there specific places in the source I can look at?

BGE rasterizes it to a texture and then displays a bunch of planes. The resolition can be adjusted and is in units of 100px/bu. The texture is regenerated if the object is scaled.

Interesting. It’s definitely a texture during runtime.

Out of curiosity I just gave a text object a scaling action and ran it in the bge… blender almost immediately crashed, and I could definitely see it trying to create a new texture each frame from smaller chunks. (I wouldn’t advise trying to replicate it, I couldn’t even move my mouse for a good minute.)

How difficult would it be to keep text as a vector? It seems extraneous for the game engine to go back and forth between vector curves and textures.

Ahh, that’s close to what I thought.

Do you know where in the code this happens? Do you know if it’s possible for me to use the rasterizer separately?

Uh, I did a grep for it through the game engine source a month or so ago, but can’t remember where I ended up. You could possibly work backwards from the python interface which is in blender/source/gameengine/Kestji/KX_FontObject.cpp

Hmm, I spent some time looking, I couldn’t find the exact place where the export happens.

I started in KX_FontObject, I tried looking in DrawFont2D for a hint of where the data was being taken from, but that didn’t really lead me anymore. I spent some time looking at the BLF_api stuff, but didn’t find anything significant there either.

check this out.

make a object that is a bunch of faces
assign them to a

dictionary= { str(index) = [4 vertex] }

and in the ge, to make text, you move faces around and scale them, and set the uv?

so all text, even multiple font, get rendered to a font atlas and mapped?

‘Letter_font’:[4 uv cord]


‘a_bfont’ = [uv for bfont letter a lowercase]

this way all text in a scene could be 1 object eh?

so we automate this process behind the scenes, and uage it replace the text object eventually?

Hey BPR, I’m understanding your idea, would you mind going into more detail?

What I want to know, basically, is if I can use the same exporter for text in BGE for another game engine, specifically, BDX.