phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Text cut at the end of the line when using addColor

Open TadejZupancic opened this issue 10 years ago • 1 comments

This Issue is about

  • A bug in the API
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { create: create });

function create() {
    var txt = "LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. ETIAM VULPUTATE EST AC LECTUS FRINGILLA, SED VULPUTATE LEO MOLESTIE. PHASELLUS ELEMENTUM ACCUMSAN FERMENTUM. DONEC MAXIMUS NULLA A LACUS ULTRICES PHARETRA. DONEC ERAT LIGULA, PRETIUM NON MAGNA QUIS, RHONCUS TRISTIQUE LIBERO. MAURIS LOBORTIS TORTOR NEC ERAT PULVINAR TEMPOR.";
    var text = new Phaser.Text(this.game, 100, 100, txt, { fill: '#ffffff', wordWrap: true, wordWrapWidth: 403 });
    text.fontSize = '14pt';
    text.addColor("#FFFF00", 0);
    text.addColor("#FFFFFF", 11);

    game.stage.addChild(text);
}

The letter T at the end of the line is cut and the right part of it is missing. If the addColor is not used, the problem does not appear to happen.

TadejZupancic avatar May 30 '16 12:05 TadejZupancic

Thanks, your fix is now merged into the dev branch.

photonstorm avatar Jun 02 '16 13:06 photonstorm