Page 1 of 1

TmxParser

Posted: Sat Dec 03, 2016 1:34 am
by yamahara
Hi.
parsing Tiled Map Editor file (TMX)
http://www.mapeditor.org/
(Tiled v0.17.0)

I referred to this site.
https://github.com/Kadoba/Advanced-Tiled-Loader

It's minimum sample code.

Code: Select all

 local TmxParser = require("lib.tmxparser")    -- require
 local tmxparser = TmxParser:create()          -- create
 local	 map = tmxparser:parse("XXX.tmx")     -- parsing and get tmx map(table)
 local	 node = tmxparser:getNode()           -- get xml node(table)
 map = tmxparser:getMap()                      -- get tmx map (table)
 tmxparser:printNode()                         -- print console xml table
 tmxparser:printMap()                          -- print console tmx table
And, Attachment is STI (v0.16.0.3) sample.
viewtopic.php?f=5&t=76983
(But, You need to remake sti/init.lua)

Thank you.

Re: TmxParser

Posted: Sat Dec 03, 2016 3:55 am
by pgimeno
The best of two worlds, awesome!

What's the license of your code? Also, XmlParser doesn't come with a license. Is it easy to replace with one with a license?

Re: TmxParser

Posted: Sat Dec 03, 2016 11:27 pm
by yamahara
Hi, pgimeno!
Thank you, debug my source.

TmxParser is MIT license.

Re: TmxParser

Posted: Mon Dec 05, 2016 4:09 pm
by bobbyjones
Hello. Not to discredit your work, but a tmxparser isn't needed. Tiled can export lua files

Re: TmxParser

Posted: Tue Dec 06, 2016 2:17 am
by Karai17
I am so confused.

Re: TmxParser

Posted: Tue Dec 06, 2016 12:57 pm
by Sir_Silver
I'm right there with you Karai.