Game Development Community

Text Effect Question

by Tom Cassiotis · in Torque Game Builder · 12/28/2007 (8:44 pm) · 3 replies

I'm trying to come up with a specific effect where text appears on screen enlarges then quickly fades away. I can get the effect working with an image but I would like to dynamically create the text that appears at run-time.

I'm not sure if I explained it correctly but think of the fighting games that come up with "+14 Combo"

What would be the best way to do this?

#1
12/29/2007 (4:44 pm)
I am not aware of everything TGB can do, but I don't think it has native support for anything like this. I suggest you create a sheet of sprites with all the letters, numbers, and symbols you will need. Create an array that hold the sprites, maybe use indices that match ASCII numbers. Then dynamically build a composite image which you can then scale from smaller to larger and even move it around while doing so (like in a circle) using the standard image functions.
#2
12/29/2007 (5:42 pm)
Tom, I am doing something similar in a user selection screen. The username (dynamic text) will grow as you hover over it. Actually, I haven't done the hovering part yet, but I have it working if you left-click and hold the mouse button down. I'll do the hover part later, just was trying a proof-of-concept to know if I could grow text, just as you are trying to do.

Here is what I do.

1) Create a t2dTextObject in the TGB Editor and place it in your level.
2) Give the t2dTextObject a name. (I use 'Name1', 'Name2', etc.)
3) To set the text value use: $YourTextObject.text = "+14 Combo"
4) From there, I used the mouseGrowOver behavior. Rather than describing the steps to grow your text, it's probably best to just look over the behavior and see what it does.
5) You can do other cool things like spin it and set the location to match up with a specific point of interest.
#3
12/29/2007 (10:26 pm)
I think the t2dTextObject with a behaviour to implement the grow/fade out is what I'm going to give a try.

I was hoping to use particle effects due to the number of built in features and a nice gui to manipulate them. It would have been a lot easier to tweak it using the interface rather than through code :)

Thanks for the ideas.