FosterFramework / Foster

A small C# game framework
MIT License
422 stars 37 forks source link

Text word wrapping #82

Closed codecat closed 2 months ago

codecat commented 5 months ago

I don't see an API for drawing word wrapped text. This might be something that can be easily achieved externally, but perhaps would be nice to have built-in to Foster.

NoelFB commented 5 months ago

Yeah, this is probably something that could either be part of SpriteFont (give it a string plus width, and get a wrapped string back) or part of the Sprite Batcher (just draw the given string but wrapped to a given width)...

NoelFB commented 2 months ago

I've implemented various methods for calculating and rendering word-wrapping inside of SpriteFont! I think it could use some improvements but the basics work!