Jump to content

How to align text based on background size?


707
 Share

Recommended Posts

I need align the text align horizontal and vertical center based on the background. The background is a graphics object.

My code is not work properly.

text = this.add.text(0, 0, ['2asdfasdf', '/nasdfn/', 'ndfdf'], {
                fontFamily: 'sans-serif',
                color: '#776e65',
                align: 'center',
                fontSize: 55,
                fontStyle: 'bold',
                padding: 0,
            });

It result is the picture, it just align based on the most longest text not the background.

 

Screenshot from 2018-07-28 15-14-40.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...