Sign in to follow this  
Insi

Multiline BitmapText with maxWidth issue

Recommended Posts

Hi.

I'm try to use BitmapText with pixi v.3.0.9 to display multiline text and I have some problems here. Just an example:
When I use just \n symbols to word wrap it works correctly:

    _bitmapFontText = new PIXI.extras.BitmapText("12\n 34\n 56\n 78\n 90\n 21\n 43\n 65\n 87\n 09", { font: '35px Desyrel', align: 'right' });
    _bitmapFontText.updateText();

When I use just maxWidth it works correctly too:

    _bitmapFontText = new PIXI.extras.BitmapText("12 34 56 78 90 21 43 65 87 09", { font: '35px Desyrel', align: 'right' });
    _bitmapFontText.maxWidth = 30;
    _bitmapFontText.updateText();

But when I've mix them.

    _bitmapFontText = new PIXI.extras.BitmapText("12\n 34\n 56\n 78\n 90\n 21\n 43\n 65\n 87\n 09", { font: '35px Desyrel', align: 'right' });
    _bitmapFontText.maxWidth = 30;
    _bitmapFontText.updateText();

The result will be so strange. Some of chars become duplicated (screenshot attached).
Mixed variant it's what I really need to have, because text which I'll set in real application could contains any number of \n symbols, but it should be placed just in specific area (which could be limited with maxWidth) 

wordwrapissue.png

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

  • Recently Browsing   0 members

    No registered users viewing this page.