Creat 3D number to show status information

As the title said, i want to show some information (here dommage) as they happen, by creating little fading number over the head of the guy who get hit. But the point is… i have no idea how :confused:

Should i simply create those numbers in something like Blender to then use them inside my game or is there a better and more productive way to do it? I guess this solution would work, but i kinda hope there would be a better way to do it, as am pretty bad in 3D design x)

Just use BitmapText and attach it to the root node instead of attaching it to the gui’s one :slight_smile:

1 Like

And if you go that route, look at BillboardControl to make it always face the camera.


Both things did work great, thanks! My only question left now is : can i give it any thick? Because i have a feeling it would look way better whit some, even if it face you all the time whit the billboardControle. So far i have found no such method, but maybie am not looking at the right place? Or is it just impossible whit the code running on the background?

BitmapText is always flat. With the billboard control, even if it were 3D then you wouldn’t be able to tell anyway.

I just have one problem right now : the bitmapText do some realy wierd stuff whit the Material. I tried to set im some transparent material, but it just creat me a blanc rectangle and don’t show the text anymore. On top of that, its not even transparent! Then i try to work whit the bucket, like setQueueBucket and the transparent stuff and it don’t have any effect… the only one that work is but… this is pretty far from what i want.

I’m only guessing from your description because there is no pic or code or anything… but if you are talking about the problem of transparent pixels still filling the z-buffer and therefore occluding stuff behind them then there are a few approaches that you can try.

From easiest to hardest:
-put the text in the translucent bucket so that it’s drawn last
-or, iterate over the materials in the BitmapFont pages and set the alphaDiscardThreshold material parameter to something like 0.5. (or turn off depth write)

No, I guess I was not clear enough: I want the text itself to be transparent. After more test I do underthant now that putting the transparent bucket on the text help, as it makes the space around the letter/numbers not interfering with anything you have on the screen, but this is not what I was talking about. I want to be able to set the color of the text whit something else, then ColorRGBA, as it only has a few options, but as I stated before, the set material just hides the text and put a big rectangle on screen. I hope this is more clear, ill put some screenshot if not.

Obviously you can’t just blindly replace the material because it won’t have the font texture.

I’m not sure why ColorRGBA won’t work for setting the color… since it is a color and has the r, the g, the b, and the a components. There aren’t too many more things that a color can have, really.

As to your description, sometimes a picture is worth 100,000 words since we work in a visual medium.