Jump to content

Phaser BitmapFont Errors


Tarion
 Share

Recommended Posts

I used the font from the example (just to be sure, after mine had the same error)

preload() {  this.load.bitmapFont('desyrel', 'fonts/desyrel.png', 'fonts/desyrel.xml');}create() {  var text = this.add.bitmapText(this.world.centerX, this.world.centerY, 'xx', { font: '64px desyrel', align: 'center' });}

 

%c %c %c  Phaser v1.1.3 - Renderer: Canvas - Audio: WebAudio  %c %c  background: #00bff3 background: #0072bc color: #ffffff; background: #003471 background: #0072bc background: #00bff3 phaser.js:13074:29

 

Uncaught TypeError: Cannot read property 'size' of undefined phaser.js:7181:41

  PIXI.BitmapText.updateText phaser.js:7181:41
  PIXI.BitmapText phaser.js:7124:14
  Phaser.BitmapText phaser.js:20364:25
  Phaser.GameObjectFactory.bitmapText phaser.js:17613:35
  PhaserGameState.create app.ts:68:37
  Phaser.StateManager.loadComplete phaser.js:9324:39
  Phaser.Game.loadComplete phaser.js:13134:24
  Phaser.SignalBinding.execute phaser.js:9996:48
  Phaser.Signal.dispatch phaser.js:9871:84
  dispatch phaser.js:9638:46
  Phaser.Loader.nextFile phaser.js:32194:37
  Phaser.Loader.xmlLoadComplete phaser.js:32146:18
  _xhr.onload phaser.js:31961:42
Uncaught TypeError: Cannot read property 'Sprite' of undefined app.ts:111:43
  PhaserGameState.update app.ts:111:43
  Phaser.StateManager.update phaser.js:9367:39
  Phaser.Game.update phaser.js:13166:28
  Phaser.RequestAnimationFrame.updateRAF phaser.js:23204:23
  _onLoop phaser.js:23189:34

 

 

Any idea? Struggeling for a while with it now.

 

Debugging the code:

 

Error line:

var data = PIXI.BitmapText.fonts[this.fontName];

- data is undefined.

- this.fontName is desyrel

Link to comment
Share on other sites

  • 4 weeks later...
 Share

  • Recently Browsing   0 members

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