RyanTheBoy Posted March 3, 2014 Share Posted March 3, 2014 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... Preloader.jsSTATES.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... Uncaught Error: Phaser.Loader. Invalid XML given phaser.min.js:10 c.Loader.xmlLoadCompletephaser.min.js:10 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... Uncaught Error: Texture Error: frame does not fit inside the base Texture dimensions [object Object] phaser.min.js:4 b.Texture.setFramephaser.min.js:4 b.Texturephaser.min.js:4 c.LoaderParser.bitmapFontphaser.min.js:11 c.Cache.addBitmapFontphaser.min.js:10 c.Loader.xmlLoadCompletephaser.min.js:11 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. shortStack.zip Link to comment Share on other sites More sharing options...
rich Posted March 3, 2014 Share Posted March 3, 2014 Pixi changed how it dealt with Bitmap Fonts quite a bit in the latest release (as did Phaser actually), so although it's no help for you right now I can confirm that your font works fine in Phaser 1.2 (which is only 10 days away from release). RyanTheBoy 1 Link to comment Share on other sites More sharing options...
RyanTheBoy Posted March 3, 2014 Author Share Posted March 3, 2014 Well, that is good to know. Thanks! =) Link to comment Share on other sites More sharing options...
Recommended Posts