Jump to content

Very annoying bitmap font problem.


nmindiedev
 Share

Recommended Posts

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) but

Phaser keeps saying that error on adding that damn font when I'm trying to place it on the scene:

  1. Uncaught TypeError: Cannot read property 'size' of undefined phaser.js:2806
    1. PIXI.BitmapText.updateTextphaser.js:2806
    2. PIXI.BitmapTextphaser.js:2749
    3. Phaser.BitmapTextphaser.js:31321
    4. Phaser.GameObjectFactory.bitmapTextphaser.js:26296
    5. SetupGUIpopulo.js:93
    6. StartGameplaypopulo.js:290
    7. Preloader.createpreloader.js:146
    8. Phaser.StateManager.loadCompletephaser.js:14388
    9. Phaser.SignalBinding.executephaser.js:15296
    10. Phaser.Signal.dispatchphaser.js:15174
    11. Phaser.Loader.nextFilephaser.js:44211
    12. Phaser.Loader.xmlLoadCompletephaser.js:44162
    13. _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

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

 Share

  • Recently Browsing   0 members

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