Using the Lua export from Tiled

I’m playing with Tiled and I’m wondering if there is any information about using this with Corona?

The file is basically formatted as:

[lua]return {…}[/lua]

How would you import this using Corona? Parsing the returned table is not so much trouble. How to import a file in this format is not clear to me. [import]uid: 98652 topic_id: 20531 reply_id: 320531[/import]

@soggybag what do You mean? You want to import your tiled map into the Corona Simulator is that what you want to do? [import]uid: 17058 topic_id: 20531 reply_id: 80611[/import]

A third party module called “Lime” does this for you

http://www.justaddli.me

[import]uid: 84637 topic_id: 20531 reply_id: 80692[/import]

@sebitttas, Tiled gives you a pretty good description of your tile map in Lua. The code generated looks like this:

[lua]return {…}[/lua]

How would I go about importing this? return without a function wrapper seems a little strange to me.

@Danny, I don’t really feel up to investing in Lime at this point.

Here’s a full code listing of some Tiled Lua output.

[lua]return {
version = “1.1”,
luaversion = “5.1”,
orientation = “orthogonal”,
width = 15,
height = 10,
tilewidth = 32,
tileheight = 32,
properties = {},
tilesets = {
{
name = “Scenery”,
firstgid = 1,
tilewidth = 32,
tileheight = 32,
spacing = 0,
margin = 0,
image = “…/Documents/X-Code/TileMappApp_1/Resources/Scenery.png”,
imagewidth = 192,
imageheight = 192,
properties = {},
tiles = {}
}
},
layers = {
{
type = “tilelayer”,
name = “Background”,
x = 0,
y = 0,
width = 15,
height = 10,
visible = true,
opacity = 1,
properties = {},
encoding = “lua”,
data = {
1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1
}
},
{
type = “objectgroup”,
name = “Objects”,
visible = true,
opacity = 1,
properties = {},
objects = {
{
name = “SpawnPoint”,
type = “”,
x = 237,
y = 172,
width = 0,
height = 0,
properties = {}
}
}
}
}
}[/lua] [import]uid: 98652 topic_id: 20531 reply_id: 80695[/import]