Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 2D Text in 3D - How To?????

Author
Message
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 21st Nov 2009 10:53
Ok, im a little stuck or more just stuck on how do i draw 2d text in 3d at a position say something like 11,22,33 (x,y,z).
im fairly new to this forum so still working my place out.

so here the story, for my little game im working on i need to draw a players name above his object position, becuase you can see who the player is.
the game is multilayer across LAN. but i still cant work out how to draw 2D text in 3D.

is there a way to do this so i can see the text in 3d?
all help is welcome.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 21st Nov 2009 11:23
try this:


ID is the target object ID, value is the y offset for drawing the text.

Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 21st Nov 2009 11:33
Well, not what i was after but i can use this still so that is a big help. thank you, i might use this after all. but is there a way to draw 2d text in the 3d area?

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Nov 2009 19:48
this might help there's

dbObjectScreenX(object_number)
and
dbObjectScreenY(object_number)

which will give you the x,y text position of a 3D object.



Dark Physics makes any hot drink go cold.
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 21st Nov 2009 23:09
.......Ok. i might be making this clear, what im after is to draw text in the actual game 3d area of 2d text. but i guess that this method will do. problem is that it draw two text?

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd Nov 2009 04:08
So you want a 3d Text model? or do you want to know how to scale the text so it looks like it's out in 3d space?

New Site! Check it out \/
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 22nd Nov 2009 07:22
well using the code

i will stick with that as i like it.
ok scaleing it would be nice so i looks like it out in 3d space. also with the code i notice it draw the text twice. so at the given point it draws and then when i turn 180 it appears on that side too.
would i have to check if the camera is facing the point?

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 22nd Nov 2009 13:00
check if the object is in screen:


Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Nov 2009 14:47
Wow! They're just not getting it! Lol. He simply wants text within the 3D space. When you use text without any graphics, the text shows up. BUT, once you add something (image, model, etc) where the text is positioned, the text is essentially "covered" by it, thus, you aren't able to view the text. He's basically asking, "How do you print text to the screen without it being "covered up".
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Nov 2009 14:52
Oh yeah! lol. I guess the answer would be useful too In order to draw text to the screen, you must have the text being drawn every time the loop is executed. Otherwise, it'll be erased on the next iteration of the loop. Also, make sure to call dbDrawToFront() before writing text.
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 22nd Nov 2009 21:41
thank you, this solves the problem. thank you very much, one step close into finishing my game.

Thanks to all who helped

Problem Solution That Never Fails: "Build A Bridge And Get Over It"

Login to post a reply

Server time is: 2024-10-01 18:41:46
Your offset time is: 2024-10-01 18:41:46