Jump to content

centering text within a range in an image


HaLo2FrEeEk

Recommended Posts

Hey, I got help with the code for a project I was doing yesterday, and I did it and it works perfectly:

 

HaLo2FrEeEk.png

 

These are live stats from my forum, taken from my database.  As you can see, it looks ok, as long as the values are pretty uniform, but when I get a board style that is only three characters long like this one:

 

Ze+Popcorn+King.png

 

Then It starts to look weird, does anyone know how I can center the text and the avatar within a certain area?  The max size for a username is 18 characters, the max length for theme is 11 characters, the shortest is 3, the post count, join date, and last visit date still need to be centered, but length doesn't really matter with those.  Also, the max size for the avatars are 100x100, the minimum is anything less than that.  I know I could get the width of the picture and do some math to figure out where to put it, right now, at full size, the x and y coordinates of the picture are: (45, 48), so that would be the maximum, but I can't figure out how I would calculate the location for things smaller than that.

You guys are purposely ignoring this, I don't believe for a second that no one knows how to do this, and I know that it is 100% possible, I am asking for some help, please, I got excellent help yesterday, I've tried to help as many people as I could, why are you guys ignoring me?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.