cloakedninjas

Text horizontal padding, bug?

Recommended Posts

Originally posted here: http://www.html5gamedevs.com/topic/16816-text-horizontal-padding-bug/

 

 

I've spotted an issue with text being cut off I can't resolve with padding.x Here's some screenshots of the text.

 

First with 0 padding

KuSGlSj.png

 

And with 40 padding

QrcyDsd.png

 

Is there a way to add padding to the start of the text ? Or split the horizontal padding to both sides of the sprite?

 

 

FWIW - I'm using Phaser 2.4.3

 

Anyone got any tips?

Share this post


Link to post
Share on other sites

Hey cloakedninjas,

Easy solution (albeit hacky) for horizontal cutoff is to add a leading (or trailing) whitespace to the text.

That is when you create your Text, enter " jogar". Then the "j" doesn't get cutoff. I had the same issue using an italic webfont and had to add a whitespace at the end of every text string. In that case, if you must use multiple lines it's preferable to use explicit "newline"s rather than relying on wordWrap. 

 

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.