Rex Rhino

Ludei Cocoonjs XML / bitmap font workaround?

Recommended Posts

Btw I just noticed something weird when I load a BitmapFont using a json file instead of xml. When the xoffset=0 the letter is placed all the way at the beginning of the text no matter what.
 
2w66lie.png
 
For example a letter in my font was like this:
{    "id": 120,    "x": 67,    "y": 808,    "width": 36,    "height": 38,    "xoffset": 0, // <-    "yoffset": 36,    "xadvance": 29,    "page": 0,    "chnl": 15},

I don't know the cause though, but it can easily be fixed by changing it to 1.. 

    "xoffset": 1,

Share this post


Link to post
Share on other sites

FIXED: I was trying to get several of the solutions discussed in this thread to work, but no luck. But then realized that the docs explains it well. It assumes that the conversion of the XML to JSON is formatted to the specs of Code Beautify's XML to JSON Converter. No hacks needed, just swap out your XML for the new JSON.

Explanation in the description here. http://phaser.io/docs/2.6.2/Phaser.BitmapText.html

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.