Text Objects in the Game Engine (doubts)

I’ve been messing around with Text objects in the Game Engine only to realize that 99% of text features are not supported in the GE. I still have questions.

  1. Is there a pythonic way to access text “properties” other then “KX_FontObject.text” and “KX_FontObject.resolution” ?
    The reason why I ask is that KX_FontObject.resolution seems not documented. Nevertheless it’s there…

  2. Why does my Text object deforms a little when entering preview mode §? Typically, it slightly changes its shape and moves a little bit to the right.

Thx

for your first question of course:

just an example:



from bge import logic

def some():
    
    scene = logic.getCurrentScene()
    
    for textobj in scene.objects:
        if "Text" in textobj:
            textobj.resolution = 12.0


some times I doing it like the example by getting an “text” object by the property “Text”

by getting an “text” object you can directly set the resolution. (.resolution = n)

for you second question:

“The textures for text objects are generated at scene start. Unfortunately they do not match what you see in the preview window.”
from this post: (click)

sorry forgot if you want the text property you can do it also with the code above and that extension:


textobj["Text"] = somevalue

Thank you the_cannibal xD, but I was looking for other properties than “Text” and “resolution”.
These are actually the only ones I already know about, but since “resolution” is not documented I thought maybe others exist…

for you second question:

“The textures for text objects are generated at scene start. Unfortunately they do not match what you see in the preview window.”
from this post: (click)

I see.
Unfortunately I get visible differences even with single characters.

use


print( dir( objectToInvestigate ))

You are right, I feel dumb :smiley: