Showcase your libraries, tools and other projects that help your fellow love users.
yamahara
Prole
Posts: 5 Joined: Sun May 15, 2016 3:35 am
Contact:
Post
by yamahara » Sat Dec 03, 2016 1:34 am
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.
Attachments
tmxparser.love
(504.55 KiB) Downloaded 136 times
pgimeno
Party member
Posts: 3674 Joined: Sun Oct 18, 2015 2:58 pm
Post
by pgimeno » Sat Dec 03, 2016 3:55 am
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?
yamahara
Prole
Posts: 5 Joined: Sun May 15, 2016 3:35 am
Contact:
Post
by yamahara » Sat Dec 03, 2016 11:27 pm
Hi, pgimeno!
Thank you, debug my source.
TmxParser is MIT license.
bobbyjones
Party member
Posts: 730 Joined: Sat Apr 26, 2014 7:46 pm
Post
by bobbyjones » Mon Dec 05, 2016 4:09 pm
Hello. Not to discredit your work, but a tmxparser isn't needed. Tiled can export lua files
Karai17
Party member
Posts: 930 Joined: Sun Sep 02, 2012 10:46 pm
Post
by Karai17 » Tue Dec 06, 2016 2:17 am
I am so confused.
Sir_Silver
Party member
Posts: 286 Joined: Mon Aug 22, 2016 2:25 pm
Contact:
Post
by Sir_Silver » Tue Dec 06, 2016 12:57 pm
I'm right there with you Karai.
Users browsing this forum: Semrush [Bot] and 1 guest