How would I go about accessing the tile information in order to draw different colored squares
for each tile, with STI?
On my own simple map I used this:
Code: Select all
for i,v in ipairs(map) do
if v.kind == 1 then
love.graphics.setColor(0,255,0)
love.graphics.rectangle("line", v.x, v.y, v.width, v.height)
love.graphics.setColor(255,255,255)
end
if v.kind == 2 then
love.graphics.setColor(0,255,255)
love.graphics.rectangle("line", v.x, v.y, v.width, v.height)
love.graphics.setColor(255,255,255)
end
if v.kind == 3 then
love.graphics.setColor(0,0,255)
love.graphics.rectangle("line", v.x, v.y, v.width, v.height)
love.graphics.setColor(255,255,255)
end
if v.kind == 4 then
love.graphics.setColor(255,0,255)
love.graphics.rectangle("line", v.x, v.y, v.width, v.height)
love.graphics.setColor(255,255,255)
end
end
Any help would be appreciated, even a point in the right direction.
Thanks