jaevelgames Posted April 24, 2015 Share Posted April 24, 2015 I'm in the process of turning my current project into V3, when I get this error regarding my bitmap text: "Uncaught TypeError: Cannot read property 'size' of undefined". The error occurs in BitmapText.js, and more specifically here: " var scale = this._font.size / data.size;". I'm declaring the font size in a variable like this: "textStyle = {font: '12px Minecraftia', align: 'center'}", which worked well in V2. Since I'm a noob, and cant find any help from examples or such, I'm thankful for any help here Have a great day! Quote Link to comment Share on other sites More sharing options...
xerver Posted April 25, 2015 Share Posted April 25, 2015 Can you post a running example? I have no idea what is wrong without that Thanks! Quote Link to comment Share on other sites More sharing options...
jaevelgames Posted April 27, 2015 Author Share Posted April 27, 2015 Er, well i would, but I accidentally spilled a glass of water over my laptop this weekend, which killed it. So I guess this post is dead until i manage a recovery Sorry about that.. Quote Link to comment Share on other sites More sharing options...
jcdiprose Posted May 7, 2015 Share Posted May 7, 2015 I'm having the exact same issue. I have fnt & tga files and am loading the files with the asset loader//removed other assets for simplicitythis.allAssets = ['fonts/indieflower.fnt', 'fonts/itckabel.fnt', 'fonts/indieflower.tga', 'fonts/itckabel.tga'];I am trying to create the text with this code ..this.finalScore = new PIXI.extras.BitmapText("testing", {font: 'bold itcKabel', align: 'center', fill: '#aa2821'});and am getting the same error as jaevelgames. I'd really appreciate some assistance, cheers xerver! Nearly finished my first canvas, javascript app/game. Looking forward to sharing. Quote Link to comment Share on other sites More sharing options...
xerver Posted May 7, 2015 Share Posted May 7, 2015 Same question to you as I did to him: > Can you post a running example? I have no idea what is wrong without that Quote Link to comment Share on other sites More sharing options...
jcdiprose Posted May 7, 2015 Share Posted May 7, 2015 http://www.feref.com/jonTest/dumb_remake/ Thanks, and this is not a commercial project. I am using assets from my company to rebuild it for my own educational use! The film has already been released Cheers! Jon Quote Link to comment Share on other sites More sharing options...
xerver Posted May 8, 2015 Share Posted May 8, 2015 Oh this already has a workaround, and a fix for the next release of pixi: https://github.com/GoodBoyDigital/pixi.js/issues/1708 **EDIT**: Looks like you are using 3.0.2 and this still doesn't work...hmm.. looking into some more. TGA isn't getting recognized as an image which could be contributing to this, I patched resource-loader to add support in v1.5.4 so you could do a custom build with that version (or wait for the next pixi release). Not 100% sure that is the cause of your issue yet though. Still investigating. **EDIT 2**: Ok, found the core of your issue here. .fnt files are expected to be an XML font. The files you are loading, I have no idea what those are but its definitely not the XML font format we expect http://www.feref.com/jonTest/dumb_remake/fonts/indieFlower.fnt Quote Link to comment Share on other sites More sharing options...
jcdiprose Posted May 8, 2015 Share Posted May 8, 2015 Ahh, okay, I used the bitmap font generator you advised in the documentation. *EDIT* In BM Font under export options, the font descriptor was set as text I have changed this to XML and loaded the png's and xml files and now is ThanksJon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.