Font issue

0 favourites
  • 3 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I'm having a minor problem trying to get a font to vertically center itself in a button. On the editor it's centered fine, but when I do some adjustments to it, I can't get the vertical centering correct. Here's how it looks after I've adjusted it...

    The adjustments I've made are as follows....

    Set size of text box to the same size as the button.

    Alignment set to center (both)

    Origin is top-left (it matches the size and is centered, so that should be correct?)

    Font size is 24

    Font is Arial but it's the same in other fonts.

    The button is cropped correctly, i.e no spaces around it's edges or anything. It is a 9-patch.

    It doesn't look too bad in this post, but if you zoom in, you can see that it's some way off.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think it will be better if you set text Orgin to left of center, and align it with the center of the 9patch. Still, it may shift up or down on different browsers/devices.

    If you want a perfect placement, you should use SpriteFont.

  • The problem seems to be with the 9patch. I changed it to a sprite and it's nicely centered, but then the stretched image looks blurry.

    I might be able to get by by just adjusting it up a pixel or two, but I'll have a look at the 9patch to see if I can see what's happening with it's origin.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)