🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Moe updates.

Published April 08, 2007
Advertisement
More moe work this evening. I finally got around to making a widget I've been looking to make for a few iterations to get to. Mainly because it's a pain in the ass. I wanted a decorator which would automatically resize a font to fit the rectangle and text it was given. (optionally within some range)

Maybe it's just how I have things organized but this is a major pain. Partly because there's so many things that can modify the result, partly because the font is hidden by the api-independent abstraction, partly because I wasn't a CS major so the binary partition to find the 'best fit' font size doesn't roll right off my fingers...

Anyways, it's all done. Should be useful for icons where a character is used rather than an image (since images stretch to fit the rect, and chars didn't), generic MessageBox sorta things resizing the font to fit, auto-sizing text buttons due to internationalization concerns, resizing things independent of the user's font choice (if I get around to that)... mostly though it'll allow me to not think about making the font the right size in UI construction. I can just specify the font face, a rectangle and fuggedeboutit.
Previous Entry Meh. Holidays
Next Entry Zzz Zzz
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement