nmindiedev Posted April 30, 2014 Share Posted April 30, 2014 Phaser ver 2.0.3-2.0.4 ____________________________________________________________________________________________________________NOT SOLVED YET____________________________________________________________________________________________________________Firstly, I'd like to ask whether bitmap fonts are faster than webfonts when rendering with strokes. ____________________________________________________________________________________________________________QUESTION IS SOLVED____________________________________________________________________________________________________________Secondly, I cannot load my bitmap font. I've tried http://kvazars.com/littera/ and FontBuilder for generating the xml and atlas (also converted *.fnt to *.xml) butPhaser keeps saying that error on adding that damn font when I'm trying to place it on the scene:Uncaught TypeError: Cannot read property 'size' of undefined phaser.js:2806 PIXI.BitmapText.updateTextphaser.js:2806 PIXI.BitmapTextphaser.js:2749 Phaser.BitmapTextphaser.js:31321 Phaser.GameObjectFactory.bitmapTextphaser.js:26296 SetupGUIpopulo.js:93 StartGameplaypopulo.js:290 mainmain.js:79 Preloader.createpreloader.js:146 Phaser.StateManager.loadCompletephaser.js:14388 Phaser.SignalBinding.executephaser.js:15296 Phaser.Signal.dispatchphaser.js:15174 dispatchphaser.js:14941 Phaser.Loader.nextFilephaser.js:44211 Phaser.Loader.xmlLoadCompletephaser.js:44162 _xhr.onload That trouble almost stopped my development process. It is really annoying. I guess the font was not really loaded.But why there was no Phaser log error that says what is really wrong?I've found similar topics:http://www.html5gamedevs.com/topic/3688-how-to-make-bitmap-fonts-from-regular-fonts/,http://www.html5gamedevs.com/topic/1923-how-to-generate-xml-png-for-bitmaptext/,but none of them contain the real solution that worked for me.____________________________________________________________________________________________________________ Sorry for my stupidness, the second question is solved. I was adding the bitmapText with the different font key. Link to comment Share on other sites More sharing options...
rich Posted April 30, 2014 Share Posted April 30, 2014 Firstly, I'd like to ask whether bitmap fonts are faster than webfonts when rendering with strokes. If the font is constantly updating, for example a score or a timer, then BitmapFonts will be faster as the texture is ready on the GPU and just re-used. If the Text is just set once and then doesn't change, or doesn't change very often, then I would say the rendering difference between the two is next to nothing and if anything the Text will use slightly less overhead as it doesn't contain 1 sprite for every single letter of the text. Link to comment Share on other sites More sharing options...
Recommended Posts