How to use texts in gameblender

If someone could please explain me ‘how to use texts in gameblender’. I have searched in the blender tutorials and demo list and there is one site but it is in some other language.

           Please help.


It’s a bit complicated, but here’s the method:

Load a Bitmap Font Texture ( if you don’t have one, downloadww some demos with text,
Unpack them, search for a new “textures” folder somewhere in your HD and locate a arial.tga or curve.tga or digital.tga or something like that)
Now that you have a font texture in the UV editor, in the 3D window, in front view add a plane, do F to enter Face Select mode and U key, and choose From window.
In the UV editor put the square shape around the @ sign (scale or move the vertices to fit)
In the paint buttons enable Text and Alpha buttons
In the Real-Time buttons add a String property with name: Text
Now, what you’ll type in the empty field will appear in the Game Engine when running

Using text in game engine decrement a lot the speed of the game?

as long as you don’t publish some novels - no :wink:

I finally got the text to work in my game - sort of. While playing the game, if the text is longer than one character, it gets spaced very far apart. In some of the demo games, the text is close together, as it normally would be. For me, instead of being “10”, it looks like “1 0”. Why is it doing this? I have done a lot of searching, and tried asking a lot of questions, but seem to get no answers.


It’s done the same to me, and what I’ve found out was that if you change the size of the plane it will do that to you so your better off changing the distance from the camera the text is. Oh there is a Demo called Jack Rack that goes through how to put text into your game.

Umm can you post a link to that tutorial Falconis? Lol, I was searching on the forum for that under Jack Rack and the only things that came up were, “jack sh*t”, “jack squat”, etc. You guys get the idea.

Jason Lin

:smiley: I uploaded the tutorial I used to make text in the game engine. It should work well. Check this online directory: 8)

Thanks JD-Multi. That was a pretty good tutorial on making text. Lol, I think you have two files in there that are the same. I have a question, so if I want to use other text I would have to make or find text that setup in that specific format?

I want to make text the way He-Blend has it. Well the same kind of setup anyways. Go to the thread and scroll down, the picture of it is about in the middle. How can I do what he did? He had 3 lines of text so the tutorial in the above link by JD-Multi, can I achieve this by using 3 planes? Or is there a better way of doing it? Thanks.

Jason Lin

3 text objects is the way to do it

Hmm, so in order to create a whole story I would have to have as many text objects as I have lines? There’s got to be a way in python to make it so that I don’t have to create that much text objects. Is there?

Jason Lin

yes, of course, python can do everything, even wash dishes (…)

it would go somthign like this, your python scripted would be linked to those three objects (actuators or sensors in those objects, it doesn’t matter), each of which given their own name (on the sensor)

then just assign to the text of the object, which you can get through the actuator or sensor

code to get started

c = GameLogic.getCurrentController()
txtobjects = c.getActuators()

# you need to sort them by name, and at the moment txtobjects is the actuator in the txt object

for o in txtobjects:
  o = o.getOwner()

i = 0
while i < len(txtobjects):
   txtobjects[i].Text = i+1 # make this refrence your text in some manner

or something, I havent’ texted that

Let me see if I got this correctly. I will create 3 planes (3 lines of text). These 3 planes will then be linked to the array of textobjects that I have? So in this way I can just create many text objects and have it displayed one after another in successions of 3.

:stuck_out_tongue: Hey, python code doesn’t seem much different then C++. I’m guessing I’ll be able to learn this over the summer, then I’ll be able to implement this. Thanks z3r0 d.

Jason Lin

the code is pretty simple, and not flexible on its own

learn python (not hard if you know most of any other programming lanugage)

lines = [
	"This is a large area of text",
	"you will have to scroll down to see it all",
	"press the SPACEBAR to scroll down",
	"Nice, notice how a whole 3 lines moved by",
	"It is also possible to move only 1 line",
	"but more fancy effects are more difficult",
	"But, they are doable, for example by a",
	"rotating cylinder of text objects..."

c = GameLogic.getCurrentController()
o = c.getOwner()

# I assume 3 text objects, replace all 3's to change the amount

if c.getSensor("scroll").isPositive() and o.linenum + 3 <= len(lines):
	o.linenum += 3

for i in range(3):
	if o.linenum + i < len(lines):
		c.getActuators()[i].getOwner().Text = lines[o.linenum+i]
		c.getActuators()[i].getOwner().Text = ""

Wow, that’s pretty cool :stuck_out_tongue: . It’s exactly what I was looking for. :smiley: Thanks so much again z3r0 d.

I guess I’ll be able to add my own fancy effects and such after I learn python. Just 2 more weeks of school and I’m off to learn python with no worries.

Jason Lin

I am still having problems with the spacing in my bitmap texts. Changing the size of the plane and moving it closer to or further from the camera has no effect. I can’t have a score board where all the digits are spaced out! Why is it doing this? I thought that it was the grid size that I had set, but that does not change anything, either. It does not do it all the time, mostly on the one game that I have half developed (and can’t start from scratch just to fix this one problem).

This is how my score board looks now: “5 0”. If I have it set to TRUE, it comes out like this" T R U E."

I have a sample file, if anyone can take a look at it and tell me why it is doing this.



scale your plane up (in edit mode) until it looks right

then scale the object down so that it appears the original size

I have tried this. Scaling the plane just makes the numbers bigger or small, and does not affect the distance between the digits. And the numbers show up far from where the plane itself is at.

I am enjoying learning how to do it badly; I now want to learn how to do it properly.

okay, I will repeat myself, slower

in edit mode, select all the verts
scale up (to start, down to increase the size of that space)

exit edit mode
if spaces are still to big relative to the text (ignore the size of the text for the moment), go back to 1

  1. scale the object down outside of edit mode to get the text to the size you like

Thank you very much, z3r0 d. I think that I finally got it. As much as I love this program, it makes me feel VERY stupid, but I am slowly getting the hang of it.

I greatly appreciate your patience and your help.