New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing text property of tinted BitmapText doesn't use correct glyphs #1969
Comments
I think |
Same result with |
What about calling |
I think the fix for this is to change line 372 of BitmapText.js from this: var g = this._glyphs[t]; To this: var g = Phaser.Group.prototype.filter.call(this, function (glyph) { return glyph.name == line.text[c] }).list[0]; I don't see anywhere else in the source where a method from another class is called like this however. If this goes against convention or is just too ugly, we could put the filter method into Utils or something. It could even be made static. Another fix is to change line 374 from this: if (g) To this: if (g && g.name == line.text[c]) I don't like this because I don't think we should assume that Of course we could always use |
Actually I think it's directly related to this: 9362a2b |
This is now fixed in a dev - and didn't require anything as intense as any of the suggestions above thankfully :) |
Oh, hah. That's much simpler indeed. Thanks for the speedy fix! |
I still get it in 2.6.1 albeit not as frequent. I first had the setText outside of the phaser game loop but even after moving it into the game loop, it happens from time to time. |
Add a BitmapText to the game and give it a tint:
Once the page loads, type this in the console:
Result:
As a workaround, you can type this in the console after setting the text:
Correct result:
I'm using Phaser 2.4.2 and Chromium 43.0.2357.130 Ubuntu 14.04 (64-bit).
The text was updated successfully, but these errors were encountered: