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.

DarkBASIC Professional Discussion / [SOLVED] Print object names over objects

Author
Message
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 16th Apr 2019 07:24
So I wish to print all my game players names over each player object on screen in a 3d setting, How can I do this?

I have a array set up for each name type on each object.

thisObject(206).name = "Qine"

I know how to print it to screen, but how do I print it over each object?

Thanks in advance.

The author of this post has marked a post as an answer.

Go to answer

Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Apr 2019 22:35 Edited at: 16th Apr 2019 22:35
You can texture a plane in 3d space positioned over the character, you can use 2d text and figure the position and scale by transforming world space to screen space, or you can dig up cloggy's d3dfunc plugin on these boards (dll talk or program announcements probably)
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 17th Apr 2019 01:19
Draw To Back
Draw To Front
Draw Sprites First
Draw Sprites Last
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 17th Apr 2019 05:14
Ortu, ok thanks, I will look into it.

WickedX, Yes, I know this, this is not what I am after, thank you any how.
Derek Darkly
7
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 17th Apr 2019 18:34
This post has been marked by the post author as the answer.

I think you want

OBJECT SCREEN X
OBJECT SCREEN Y


Send your parents to noisy sprite demo hell... enter the D-Zone
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 18th Apr 2019 10:14
Derek Darkly

Yes, this worked, thank you.

But now the names are under each player.
Derek Darkly
7
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 18th Apr 2019 14:53

What I'm doing in that code is positioning a plain object sized 0,0 above the player's head.

So, (object size y(1)*.8) may not work for your objects. You'll have to adjust that.
Send your parents to noisy sprite demo hell... enter the D-Zone
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 18th Apr 2019 16:40
Ok, I see, thank you very much
Derek Darkly
7
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 19th Apr 2019 22:53

No problem.

Also, (object screen y(2)-30) may need to be adjusted too.
Send your parents to noisy sprite demo hell... enter the D-Zone
Derek Darkly
7
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 19th Apr 2019 23:00

And I just noticed Ortu posted the same answer before me , minus the code. LoL
At first I tried to glue an object to the main, but the position coords weren't taking, then I said, "what the hell am I doing, i just need a paste point!" so then I did exactly what he said! Awesome.

Common sense is brilliant when you can grab hold of it. LMAO!!
Send your parents to noisy sprite demo hell... enter the D-Zone
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 20th Apr 2019 00:14
@Derek Darkly

Yes lol, me also on the Common sense is brilliant

If I was so smart I would not be asking for help lol.

Thank you.

Derek Darkly
7
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 23rd Apr 2019 01:09

Happy to help, locecode!

I have enjoyed a lot of years on these forums. All the regulars here are some of the coolest people you could meet. Ortu and WickedX being 2 of them!

Yo, I did notice on my code that if you back the player object off the screen (downkey) the name will pop up in the middle of a blank screen. Yikes!

You can use the OBJECT IN SCREEN command to avoid this. I'm sure you'll figure it out.


Send your parents to noisy sprite demo hell... enter the D-Zone
locecode
User Offline
Joined: 11th Apr 2019
Location:
Posted: 23rd Apr 2019 03:21
@Derek Darkly

Yes, I noticed this lol, I just hide the objects at that point.

I am creating a pretty big project and will need a lot of help here and there I am sure, so I do appreciate the help.

So far everything works good and I'm pretty excided about it.

I have a three level space ship to create and have the first level finished.

Just started working on setting up all the players fonts, and the scarry thing is you can not use the fonts in any array so all the code has to be just for each player lol.

Login to post a reply

Server time is: 2019-05-26 13:57:20
Your offset time is: 2019-05-26 13:57:20