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 / Text in 3d game - how to?

Author
Message
m2design
16
Years of Service
User Offline
Joined: 25th Mar 2010
Location: Seattle area
Posted: 8th Apr 2010 19:14
I need to display text in a 3d layout but all of my attempts have failed.

Problem: I need to display a messages like "You pegged 15 for 2"
in a 3d program. The message needs to display for a pre-determined time with out affecting the 3d enviorment already displayed.
After the pre-set time it needs to go away. I can figure out
everyting except the message display.Can I even display messages in a 3d environment using the DBP provided text commands?

Thanks
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 8th Apr 2010 19:19 Edited at: 8th Apr 2010 19:22
Yeap, just: Text posX, posY, "You pegged 15 for 2"

But since your using result values and not something that's constant, you need to convert the values to strings by using 'STR$()'. So you write it like this:

Text PosX, PosY, "You pegged "+str$(Value1)+" for "+str$(Value2)

Quote: "I need to display text in a 3d layout but all of my attempts have failed."


I would love to know what you tried...

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 8th Apr 2010 19:31
Quote: "I would love to know what you tried..."


Print?

Rawwrr. Sig Fail.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 8th Apr 2010 19:56
Quote: "Print?"


Nope, that would of worked. So what else could you do since there's no other ways of producing text other than bitmap font or pre render text.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 8th Apr 2010 20:04
Quote: "Nope, that would of worked."

It kind of works... It drops to the bottom the screen and leaves a black gap on my computer though. So maybe that's happening to him too.

Rawwrr. Sig Fail.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 8th Apr 2010 20:12 Edited at: 8th Apr 2010 20:13
That's because you need to set the cursor position first before using it. So:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 8th Apr 2010 20:18
Ahh, I see, Thanks man!

Rawwrr. Sig Fail.
m2design
16
Years of Service
User Offline
Joined: 25th Mar 2010
Location: Seattle area
Posted: 8th Apr 2010 22:40
This what I came up with:

draw to front
do
text 40,30,"You pegged "+str$(numberofpoints)+" points"
text 40,50,"You have a total of "+str$(count)+" points"
if mouseclick()=4 then end://exit program
if mouseclick()=1 then exit://continue program
sync
loop
It does what I want to do.I only need to print a message in my program when I am waiting for user input (such as continue or end)

Could also do a do loop with a timer for momentary message.

Login to post a reply

Server time is: 2026-07-26 15:31:42
Your offset time is: 2026-07-26 15:31:42