how to use CEGUI (0.5)FONT TEXTURE render 3d effect?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

skydog
Just popping in
Just popping in
Posts: 4
Joined: Tue Jul 04, 2006 07:31

how to use CEGUI (0.5)FONT TEXTURE render 3d effect?

Postby skydog » Mon Aug 21, 2006 15:18

use cegui create font (freetype or pixel )

how to easy use font texture map to make 3d render effects??

font class not direct read image map data...

thanks...

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

Postby Turtle » Wed Aug 23, 2006 08:55

Hi skydog,

Do you want to be able to use a texture that contains a set of characters like, say this?:

Image

To do this you need to define:
    - your image (a square, power of 2 length and sides)
    - an .imageset file that defines the location of each character
    - a .font file that defines which .imageset file to use, and which maps images within the .imageset file to "codepoints" (characters)
    - finally, you put a reference to your new .font file into your .scheme file

I personally use Gimp to create my fonts with along with a (very rough) program I wrote that converts a line of character images into the square texture you see above.

If this is what you're trying to do, I can give you example files that I've generated, you can even have my dodgey program :)

It seems like a lot of effort, but it gets easy quite fast - it only takes me about 15 minutes to create a new font.

Or are you trying to create a font that uses a dynamic texture?

Cheers.

skydog
Just popping in
Just popping in
Posts: 4
Joined: Tue Jul 04, 2006 07:31

Postby skydog » Tue Aug 29, 2006 02:38

not create font problem !
is use the same font texture map
use CEGUI font texture map in 3d world or other effect...

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

Postby Turtle » Tue Sep 05, 2006 08:36

Hi skydog,

So did you want to use a CEGUI font within your 3d scene? If that's the case, it's dependent on the 3d engine you're using.

It can be done in Ogre - you can use the same font texture to write text in the 3d scene, although you'll need to use an Ogre font definition file to kind of detail similar information that is contained in the CEGUI .imageset file.

Cheers.

silenttree
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Nov 01, 2006 05:59
Contact:

Postby silenttree » Tue Nov 14, 2006 17:17

Turtle wrote:Hi skydog,

So did you want to use a CEGUI font within your 3d scene? If that's the case, it's dependent on the 3d engine you're using.

It can be done in Ogre - you can use the same font texture to write text in the 3d scene, although you'll need to use an Ogre font definition file to kind of detail similar information that is contained in the CEGUI .imageset file.

Cheers.


i have same problem. Turtle, how can i display a CEGUI font within my 3d scene?

is there any example?

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

Postby Turtle » Fri Nov 24, 2006 21:39

Hi silenttree,

Sorry for the delay - I haven't been on the Internet much of late.

I personally use MoveableText from the Ogre Wiki:
http://www.ogre3d.org/wiki/index.php/MovableText

Of course, this means you'll need to give Ogre a .fontdef file so that Ogre knows how to define the font. Details of this format are found in the Ogre Manual at:
http://www.ogre3d.org/docs/manual/manual_36.html#SEC222
It's kind of a combination of the CEGUI .imageset and .font files.

I wrote my own utility for generating font files for both Ogre and CEGUI from the one source font out of an image file. You're welcome to a copy if you want it, but it's very rough.

If you didn't want to use MoveableText, I guess you could project your 3d coord back into your screens space and put your CEGUI text at that point. This would work well except (1) the text would appear on top of all your scene (but this could be a good thing) and (2) the font would always be the same size - it wouldn't scale with distance (which could also be a good thing).

I use MoveableText to place labels over objects in my program and it works well for me in this situation. The only problem is that it doesn't support the CEGUI feature of a "HorzAdvance", so each character is rendered at the width of the image.

Cheers.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests