Change the font of the text objects while your game is running.

Hi,
As the title of this thread’s mentioned, I wanna ask that is there any way to change the font of a text object while your game is running? Please let me know if it’s possible, I’d really appreciate that.
Thank you!

Hi,

You can’t change the font unless you do something such as replacing the text object with another text object of a different font (which isn’t really changing, but rather, replacing it).

Here are some things you can normally do with a text object, given you are running a recent version of Blender, etc.:
https://pythonapi.upbge.org/bge.types.KX_FontObject.html

1 Like

Like what Mirror said, the best way would be to replace the object. Just make a bunch of objects in a difference layer, each with the different font setting. When you want your font to be changed, delete the current object and add the object with the preferred font. You could make a system that does this with python.

1 Like