PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Drawing text

I want to create a surface that is just the size of the text I wite in it.
The only way I found is to do DrawText twice, one with GDDRAWTEXT_CALCWIDTH set, the next without.

Not very useful...

You have to create a larger surface, draw the text in it to calculate the size and then create the surface with the right size...

jul'
Hi,

Um. You don't need a larger surface to use GDDRAWTEXT_CALCWIDTH . Just use any surface (like the display or back buffer). And then create your new surface.

/Johan
You say "you don't need a larger surface", then you say "use any surface (like the display or back buffer)"
so I need another larger surface... ;-)

That's what I did before (writing in the display), but now I want to draw text in a surface without the knowledge of the display or backbuffer...
I want to create a class which is independant from the display...