{"action":"created","issue":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/1807","labels_url":"https://api.github.com/repos/photonstorm/phaser/issues/1807/labels{/name}","comments_url":"https://api.github.com/repos/photonstorm/phaser/issues/1807/comments","events_url":"https://api.github.com/repos/photonstorm/phaser/issues/1807/events","html_url":"https://github.com/photonstorm/phaser/issues/1807","id":78731812,"number":1807,"title":"Setting maxWidth on BitmapText throws error","user":{"login":"drhayes","id":8899,"avatar_url":"https://avatars.githubusercontent.com/u/8899?v=3","gravatar_id":"","url":"https://api.github.com/users/drhayes","html_url":"https://github.com/drhayes","followers_url":"https://api.github.com/users/drhayes/followers","following_url":"https://api.github.com/users/drhayes/following{/other_user}","gists_url":"https://api.github.com/users/drhayes/gists{/gist_id}","starred_url":"https://api.github.com/users/drhayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drhayes/subscriptions","organizations_url":"https://api.github.com/users/drhayes/orgs","repos_url":"https://api.github.com/users/drhayes/repos","events_url":"https://api.github.com/users/drhayes/events{/privacy}","received_events_url":"https://api.github.com/users/drhayes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-20T22:48:19Z","updated_at":"2015-06-03T15:32:14Z","closed_at":null,"body":"[Here's a link to a minimal test case.](http://cut-downtown.surge.sh/) I'm using Phaser 2.3.0.\r\n\r\nRepro:\r\n\r\n1. Create a new bitmap text object: `this.text = this.game.add.bitmapText(0, 0, '04b03', 'starting text', 8);`\r\n2. Set the maxWidth: `this.text.maxWidth = 100;`\r\n3. Set new text: `this.text.text = Phaser.RetroFont.TEXT_SET1;` (or otherwise get the BitmapText instance to call `updateText`)\r\n4. No rendered text, error in the console: `Uncaught ReferenceError: lastLineWidth is not defined`\r\n\r\nLooks like a PIXI bug. I [saw this](https://github.com/GoodBoyDigital/pixi.js/pull/1370) on their side. Looks like it adjusts [this line of code](https://github.com/GoodBoyDigital/pixi.js/blob/07e4e26f8fd404524a7ebaa73c210de3d8f2cf25/src/extras/BitmapText.js#L275) which Phaser doesn't have, I guess? Anyhoo."},"comment":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/comments/108485872","html_url":"https://github.com/photonstorm/phaser/issues/1807#issuecomment-108485872","issue_url":"https://api.github.com/repos/photonstorm/phaser/issues/1807","id":108485872,"user":{"login":"photonstorm","id":164476,"avatar_url":"https://avatars.githubusercontent.com/u/164476?v=3","gravatar_id":"","url":"https://api.github.com/users/photonstorm","html_url":"https://github.com/photonstorm","followers_url":"https://api.github.com/users/photonstorm/followers","following_url":"https://api.github.com/users/photonstorm/following{/other_user}","gists_url":"https://api.github.com/users/photonstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/photonstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/photonstorm/subscriptions","organizations_url":"https://api.github.com/users/photonstorm/orgs","repos_url":"https://api.github.com/users/photonstorm/repos","events_url":"https://api.github.com/users/photonstorm/events{/privacy}","received_events_url":"https://api.github.com/users/photonstorm/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T15:32:14Z","updated_at":"2015-06-03T15:32:14Z","body":"This is now fixed in dev (and then some actually, we completely recoded how Pixi handles maxWidth, which didn't take into account kerning or character widths, or correctly crop the input string)."}}