foxblock / penjin

Penjin game engine - C++, cross-platform, powerful, simple to use
http://projectinfinity.org.uk/doku.php?id=homebrew:engines:penjin
GNU Lesser General Public License v3.0
0 stars 1 forks source link

Request for a TextBox class #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Have you ever had the hassle of manually creating line breaks, because
rendered text was to wide and reached out of the screen?

If the answer to the above question is "yes" then this is for you!

I hereby request a TextBox class, which is given a position and size and
then renders passed text automatically wrapping in the given bounds.
This would remove the hassle of rendering a text, checking whether it fits,
manually inserting a line break, rendering the second line at another
position (which has to be determined of course) and completely freaking out
over this process!

Also: Profit!!!

Original issue reported on code.google.com by foxbl...@gmail.com on 10 Dec 2009 at 9:07

GoogleCodeExporter commented 9 years ago
Now doable with Text class (use the bounding box functionality which will
automatically wrap text inside of it).

Original comment by foxbl...@gmail.com on 26 Dec 2009 at 7:53

GoogleCodeExporter commented 9 years ago
A TextBox class could still be done, by combing a Rectangle object with a Text 
object.
Rectangle colour could match the background colour of the BOXED colour setting 
to
have nice fast font rendering!

Original comment by pokeparadox@gmail.com on 28 Dec 2009 at 12:47

GoogleCodeExporter commented 9 years ago
Hmm, but I don't think we need a whole new class for that...
maybe add a function like copyProperties which takes a Rectangle and then 
copies the
properties (Position, colour) over to the text class...
Or create a pointer to the Rectangle so settings are automatically read and 
applied
on rendering

Original comment by foxbl...@gmail.com on 28 Dec 2009 at 3:16