Jump to content
  • Advertisement
  • entries
    359
  • comments
    237
  • views
    189162

Moe updates.

Sign in to follow this  
Telastyn

104 views

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!