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 Discussion / Help with text?

Author
Message
ScottyB
17
Years of Service
User Offline
Joined: 26th Jul 2007
Location:
Posted: 29th Aug 2007 19:38
How do I display text over a 3d-scene?
Like regular text and bitmap fonts
to display score ect...
Are the certain commmands to do this
and what might they be and how are they used?

Thanks
Scott B.
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 29th Aug 2007 19:41 Edited at: 29th Aug 2007 19:42
just use the text command and position it accordinly..

this is actual code if you want to try it....
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 29th Aug 2007 19:48
Wait wait wait wait wait. Do do it over 3D, text needs to be in a loop. The moment you make an object 3D is turned on, and everything is automatically cleared off the screen every loop, but if you constantly print the text, it will stay. Bitmaps too I think, but sprites update automatically, so it's OK to have them just the once over 3D.

Acording to Grandma, I am now enemy of the evil republic, who captured Paris Hilton and couldn't manage it.
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 29th Aug 2007 19:50
oh.....
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 20:46
Yep, INH is totally right
I've had to write the same on two other threads

Your signature has been erased by a mod because it was rubbish.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Aug 2007 21:58
I usually make each letter into a texture, and put it on a plain. Then you need to convert strings into each letter of the alphabet, or number. You use commands like Val(Mid$...etc) to change each letter into a number, and each number into a texture.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Aug 2007 22:03
If you just want to use plain text with the Text command, just make sure that the Text lines are AFTER the Sync command at the end of the main program loop. Eg:



You put all Text commands after the Sync because in DBC, the Sync command refreshes the 3D window and naturally wipes off the text you've just drawn.

TDK_Man

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Aug 2007 23:00
@TDK
Huh? But it's a loop, it doesn't matter where you put the sync because it will loop round anyway. If you have the TEXT at the beginning of the loop and the SYNC at the end, then the TEXT is right after the SYNC.
I've tested it out and it works the same both ways, if you can prove otherwise then I'll shut up

Your signature has been erased by a mod because it was rubbish.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Aug 2007 23:15
Quote: "it doesn't matter where you put the sync because it will loop round anyway If you have the TEXT at the beginning of the loop and the SYNC at the end, then the TEXT is right after the SYNC"


However, a lot of users put the text commands at the end of their main program code just before the Sync.

Putting the Text commands immediately after the Sync (I agree that a text command at the start and the Sync at the end of the same loop is the same) makes sure that the text is on the screen for the longest possible time before the next Sync wipes it.

Quote: "if you can prove otherwise then I'll shut up"


No need - we are both right!

TDK_Man

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Aug 2007 00:05 Edited at: 30th Aug 2007 00:05
hmm... maybe I should add this to my Code Structure tutorial (Still unfinished ) would you agree on this as a good layout?



Your signature has been erased by a mod because it was rubbish.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 31st Aug 2007 00:49
Here's the layout web page off my old web site. It includes a skeleton program of what I think is a good structure for a program.

Others may or may not agree though as it's always a matter of choice.

http://www.computechtenerife.com/layout.htm

TDK_Man

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Aug 2007 01:05 Edited at: 31st Aug 2007 01:07
Thanks TDK, seems exactly the same as mine
but you have Functions and Gosubs the other way round; I used to do it like that but ran into a problem when one of my gosubs called a function. For some reason it worked fine when I re-positioned the function above the gosub.

You remind me of the episode of South Park where Butters/Professor Chaos is trying to come up with evil schemes, except now it's "TDK did it"

Owww I thought I'd found something that everyone else had overlooked
Have you had a look at my tutorial, I would like your feedback as you have written so many

Your signature has been erased by a mod because it was rubbish.

Login to post a reply

Server time is: 2025-06-02 06:03:45
Your offset time is: 2025-06-02 06:03:45