Problems with text mode for texture

Hello everyone.
I decided to make the text in the game using the old technique - and it does not work.
Here is an example, can anyone tell me please what is wrong in it - text_TEST01.blend (510 KB)

Thank you for attention.

+1

Had/have the same problem, could not get it to work anymore.

  • to make a report to the developers?

+1 as in another user with the same problem.

I know that UPbge has removed this feature, but never read/heard that BGE has removed it.
If it is a bug then yup, we should fill in a report, but lets hear from others first.

The normal text objects are just annoying/ridiculous to work with, what is the point to… need to run a python script to set all text objects resolution, so you actually have some nice text to look at.

  • what script, what to do?

def set_text_resolution(cont):
    
    own = cont.owner
    scene = own.scene
    
    if not own.get('text_objects', False):
        own['text_objects'] = [obj for obj in scene.objects if 'Text' in obj]
        
    for obj in own['text_objects']:
        obj.resolution = 5

  • obj has no attribute ‘resolution’ - this function is for text, not for a plane. With the standard text, I have already figured out, but wanted to understand this function - the text from the texture.
    Alas, the script does not work.
    With the classical text, I thought there were problems in a lot of polygons, but on the surface, you can set the minimum resolution of the text in the window, and after running the BGE it converts it into a simple texture. That is - there are no problems with a large number of polyligones.
import bge

cont = bge.logic.getCurrentController()
own = cont.owner

own.text = 'blender'
own.color = (0.0, 0.0, 0.5, 1.0)
own.size = 0.5
own.resolution = 10

Here is such a simple code for a text object …

Here is such a simple code for a text object …

Yes that is simple, and just for 1 object.

My example sets every object with ‘Text’ property to the right resolution. At start it grabs all the text objects and places it in a property, then we loop trough the property to set the text resolution, you only have to run this once at start and/or whenever you need to update the resolution.

this function is for text, not for a plane

  • what script, what to do?

yes indeed, it is for normal text objects, i thought you asked for this? (i mentioned normal text objects in post #4)

  • everything is normal, probably the problem of translation, or … understanding:eek:.
    Thank you for your help, but the problem with the texture text is not solved, and with the texture, you can do more …

i know that’s why i want it as well. i have been looking and guess what? It still works in blender, so maybe it’s the image type?
try .jpg image else try .png.

Anyway i found this tutorial:

It has a working example at the bottom, tested and works (put engine on game engine instead of render)

Not sure I understand correctly . . but, try targa for the old stlye of TEXT, IE Arial.tga. If you want color or a gradient, I always used photoshop to create a color image 32 x 32 tga, and used “multiply”, (instead of mix) along with the arial.tga, or whatever. sorry If I misunderstood.
P.S. the old style text was unstable for me in the newer builds, and caused a lot of crashes.

EDITED: I said overlay, I meant Multiply, sorry.

  • I thank you for the information, but I have already made a project I have conceived with the text, based on new technology - link

Yeah I like the “new technology”. I’m playing around with scripts to change the color, and stuff. Something “new” for me to play with.
:slight_smile:

i had problem with this as well so i cooked up my own solution, it has a few drawbacks like not working well if the textspawner is rotated.


here is a blend if you want to check it out.
http://15b.dk/blendfiles/texture-font1.blend

Pretty cool. So you can use a PNG for the font sheet, I did not know that, I thought it had to be TGA. Can you use a texture so it isn’t a solid color. With the old method, i could use texture so the text wasn’t a solid color. (unstable, and won’t work in UPBGE 2.78 or BF 2.78 or newer)

Like this, open in 2.76b or UPBGE 2.77 to get the dynamic text to work. change the message to a keyboard. http://pasteall.org/blend/index.php?id=49057