Reading XML tile editor info

0 favourites
  • 5 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • I was trying to use Ogmo to make levels in XML and import them on C2. But i'm not sure how to read it...

    This an example of the XML it creates:

    <level>

    <NewLayer0 exportMode="Bitstring">

    0000000000000000000000000000000000000000

    0000000000011110000000000000000000000000

    0000000000111110000000000000000000000000

    0000000000101000000000000000000000000000

    0000000001101000000110000000000000000000

    0000000000101100111111111000000000000000

    0000000111101110100001000000000000000000

    0000000100000110100001000000000000000000

    </NewLayer0>

    </level>

    I can load the file, but I don't know which XPath string I need to read this. Can I convert this information to an array?

  • assuming you read the entire string inside the tags youd have to split it at linebreaks and 0s and 1s to get it in an array the hardest part after that would be makin sure it gets in the array in the right order after the splits

  • I've managed to take a string of ones and zeroes and put them on an array, then I output the array values to a Text, just to check if it worked, and the text displays the ones and zeroes as expected. But when I check for numbers 1 in the array, it never returns true

    Here's a screen and the capx:

    (the string value doesn't show up in the editor cuz it's too long, but its there)

    <img src="http://i.imgur.com/Ci1Rc.png" border="0">

    http://dl.dropbox.com/u/3954039/auto-tiling.capx

  • I've managed to take a string of ones and zeroes and put them on an array, then I output the array values to a Text, just to check if it worked, and the text displays the ones and zeroes as expected. But when I check for numbers 1 in the array, it never returns true

    Here's a screen and the capx:

    (the string value doesn't show up in the editor cuz it's too long, but its there)

    <img src="http://i.imgur.com/Ci1Rc.png" border="0">

    http://dl.dropbox.com/u/3954039/auto-tiling.capx

    The returned value is a string try "1"!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 00Rez duuuuude, I love you! Thx :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)