Jump to content

Ludei Cocoonjs XML / bitmap font workaround?


Rex Rhino
 Share

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,
Link to comment
Share on other sites

  • 3 months later...
  • 2 years later...

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

 

Link to comment
Share on other sites

  • 1 year later...
On 6/21/2017 at 10:08 AM, FlashyGoblin said:

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

 

 

FlashyGoblin, was this using Cocoon's 'webview' or the 'webview+'?  I'm trying to find a solution for Webview+ and nothing seems to be working.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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