Author Topic: Text on top the object3D  (Read 2199 times)

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Text on top the object3D
« on: February 17, 2011, 06:55:40 pm »
Guys

Anyone know a way to put text on top of a 3D object?

I got thinking about creating a plane and add a text in one texture and adds it as child of my 3D object. But I think there a better way.

I know how to put text on the screen using blit, but I wish it had a text object on top of him and follow him when the object moves.




I have used the method:

Code: [Select]
TextBlitter.blitText (smallFont, buffer, "Hello.", 37, 500, Color.black);
to display something on screen.

thanks for the help =)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Text on top the object3D
« Reply #1 on: February 17, 2011, 08:22:12 pm »
text is very sensitive for scaling such that it gets ugly and unreadable. that's why assigning text as a texture to a plane is not a good idea. it was my first attempt (see this image) but than i decided to blit text. this how it looks

for moving text with object, you can do that programatically. quite easy indeed. the catch is, since blitting always done after scene is rendered, there is no perfect solution to z-order text and 3d objects properly. but this problem does not happen very much. also depends on the scene


Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Text on top the object3D
« Reply #2 on: February 17, 2011, 09:37:36 pm »
Thanks for the help Raft. =) I'll try.