Jump to content

bitmapText load error


Recommended Posts

Hello everybody!


I am attempting to use a bitmapFont I generated using Littera and am receiving some errors. Littera outputs a .png bitmap and a .fnt in xml format. When I attempt to load it with the following code...



STATES.Preloader = function(game) {this.preloadBar = null;}; STATES.Preloader.prototype = {preload: function() {this.preloadBar = this.game.add.sprite(this.game.world.centerX - 100, this.game.world.centerY, 'preloadBar');this.load.setPreloadSprite(this.preloadBar); this.load.spritesheet('buttons', 'assets/buttonSheet.png', 360, 50); this.load.bitmapFont('shortStack', 'assets/shortStack.png', 'assets/shortStack.fnt');}, update: function() {this.game.state.start('MainMenu');}};
I receive this error...

  1. Uncaught Error: Phaser.Loader. Invalid XML given phaser.min.js:10

    1. c.Loader.xmlLoadCompletephaser.min.js:10

    2. b.xmlURL._xhr.onloadphaser.min.js:10


I thought maybe the .fnt extension is what was causing the issue so I just changed it to .xml and then got this error...


  1. Uncaught Error: Texture Error: frame does not fit inside the base Texture dimensions [object Object] phaser.min.js:4

    1. b.Texture.setFramephaser.min.js:4

    2. c.LoaderParser.bitmapFontphaser.min.js:11

    3. c.Cache.addBitmapFontphaser.min.js:10

    4. c.Loader.xmlLoadCompletephaser.min.js:11

    5. b.xmlURL._xhr.onloadphaser.min.js:10

Any help would be appreciated! I've included the archive Littera produced if anyone would like to take a closer look at those files.


Link to comment
Share on other sites


  • Recently Browsing   0 members

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