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 / DGDK.net: Putting Text on 3d Plane

Author
Message
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 9th Apr 2007 23:08 Edited at: 9th Apr 2007 23:10
Hi,
I'm trying to work out the best way of displaying text passed into a routine on a Plain primitive.

The idea being a message window popping up a bit like windows in vista, (from a distance fully transparent to close up fully opaque). The main thing I'm unsure of is the most officiant way getting the text onto the primitive.

Thanks for any help,

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Apr 2007 15:17
One way of doing this is to draw your text onto an image and then use this as the texture for your object.

Here some code taken from a program I was working on the other day that demonstrates how it can be done:

jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 11th Apr 2007 15:56
Cheers mike,
That is exactly the sort of thing I'm after. Once I've knocked something up I'll post it here as a VB.net example.

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 11th Apr 2007 19:09
I have made it in DarkEngine



Niels Henriksen
Working on a (MMO)RPG right now in DarkEngine
http://www.tigernet.dk - Send SMS to mobile online (will come in english soon)
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 12th Apr 2007 00:27 Edited at: 12th Apr 2007 00:27
I've just finished the text chopping routine to make sure the text fits on the width of the text box. It is multiple routines:

TextWidth routine to work out how many pixels wide the text is (I plan to modify this with a flag to say remember current font and pitch):



ChopText the routine that chops up the text:



So the following string as Arial 16



Produces:



----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 15th Apr 2007 02:08
Here is a link to see something of what I was trying to achieve in action. I am currently experementing in having all the UI etc ingame to be based on 3d blocks/plains with textured surfaces containing the required info.

http://www.tyranntrpg.org/dgdk/all3dExample/all3dExample.html

The video is a reduceds resolution and created on a slower PC so looks much better without fraps running .

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"

Login to post a reply

Server time is: 2024-11-19 13:37:27
Your offset time is: 2024-11-19 13:37:27