Arcane
Arcane

Reputation: 33

Issue when loading Tiled map with STI for love2d game

I've been working on a small Love2D game for a while, and have ran into an issue with my Tiled file that I've exported in a Lua format for Simple Tiled Imp. Attempting to load the file always results in the error "STI does not yet support Tile Collections" although I used only one tileset. I've searched around for answers to what this means exactly, or possible solutions, but have found nothing... Any help would be greatly appreciated. :) (I'm really new to Love and Lua in general, sorry if this a bit of a noob question)

Upvotes: 0

Views: 1243

Answers (2)

mahercbeaucoup
mahercbeaucoup

Reputation: 597

From a previous comment by Arkane: when creating a new tileset, you need to click the "Embed in map" flag.

New Tileset menu

Upvotes: 0

koyaanisqatsi
koyaanisqatsi

Reputation: 2813

Read: Use a Quad to display part of an Image: https://love2d.org/wiki/love.graphics.newQuad
Like different planets in one image in this example...

quads={love.graphics.newImage("planets.png")
}
local assets={x=0,y=0,size=.1,time=-1,
[1]=love.graphics.newQuad(138,33,300,300,quads[1]:getDimensions()),
[2]=love.graphics.newQuad(505,37,300,300,quads[1]:getDimensions()),
[3]=love.graphics.newQuad(871,21,300,300,quads[1]:getDimensions()),
[4]=love.graphics.newQuad(1238,22,300,300,quads[1]:getDimensions()),
[5]=love.graphics.newQuad(1606,15,300,300,quads[1]:getDimensions()),
[6]=love.graphics.newQuad(1974,11,300,300,quads[1]:getDimensions()),
[7]=love.graphics.newQuad(1976,349,300,300,quads[1]:getDimensions()),
[8]=love.graphics.newQuad(136,382,300,300,quads[1]:getDimensions()),
[9]=love.graphics.newQuad(504,379,300,300,quads[1]:getDimensions()),
[10]=love.graphics.newQuad(871,366,300,300,quads[1]:getDimensions()),
[11]=love.graphics.newQuad(1236,362,300,300,quads[1]:getDimensions()),
[12]=love.graphics.newQuad(19,724,300,300,quads[1]:getDimensions()),
[13]=love.graphics.newQuad(1047,698,300,300,quads[1]:getDimensions()),
[14]=love.graphics.newQuad(1376,687,300,300,quads[1]:getDimensions()),
[15]=love.graphics.newQuad(1721,686,300,300,quads[1]:getDimensions()),
[16]=love.graphics.newQuad(2042,684,300,300,quads[1]:getDimensions()),
[17]=love.graphics.newQuad(347,704,660,300,quads[1]:getDimensions())
}
pquads={x=0,y=0,size=1,time=-1}
for i=1,#assets do table.insert(pquads,assets[i]) end

...where the first pair newQuad(138,33, is the top left position in the PNG image and the last pair 300,300,quads[1]:getDimensions()), is the size of a single tile.
The positions of tiles can be shown in a programm like gimp or photoshop.
Simply move the cursor to a top left of a tile and look at status bar.

Upvotes: 0

Related Questions