Jump to content

Bitmap Font from shared atlas


richpixel
 Share

Recommended Posts

I have a very similar question to this topic but didn't understand the answer and figured no one would read it since the post is marked as 'answered' :unsure:

http://www.html5gamedevs.com/topic/4682-bitmapfont-atlas/

 

What I'd like to do is

1- Load the font data xml file in my preloader

2- Adjust the font 'char' data so the x,y offsets map into a texture atlas that i've already loaded that contains the actual font bitmap data

3- Set the texture on the font so it points to the texture atlas

 

In Phaser.LoaderParser.bitmapFont(), I can see it doing #3... but does Phaser have a util to load just an xml file?

 

Also, is this worth it? In Starling it's good to use as few texture atlases as possible because there's a performance penalty to switching textures, but I have no idea if that applies here to Canvas/WebGL.

 

Thanks

 

 

Link to comment
Share on other sites

You can use load.text and then parse the string as XML directly.

 

It's worth doing if you have loads of textures (enough to fill up GPU ram for example), but if you're talking just a handful then no, it won't make any difference.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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