Switching from ATL to STI - tileData does not exist anymore

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lxndio
Prole
Posts: 1
Joined: Thu Nov 13, 2014 7:24 pm

Switching from ATL to STI - tileData does not exist anymore

Post by lxndio »

Hello,

currently I am recoding a game that I've wrote about half a year ago. I have seen that Advanced Tiled Loader is not being developed anymore so I switched to Simple Tiled Implementation.
My problem is that tileData does not exist anymore. In the documentation of STI I cannot find an alternative function. How can I solve this problem?

Regards,
lxndio
User avatar
artofwork
Citizen
Posts: 91
Joined: Mon Sep 15, 2014 1:17 am
Location: East Coast USA

Re: Switching from ATL to STI - tileData does not exist anym

Post by artofwork »

What I would do is go through the class file and see what properties and methods the class contained, what & when its method's return or updated its properties, I looked through map.lua and compiled a list of properties and its methods, this list may or may not be complete

Code: Select all

--Properties of map
self.tilewidth
self.tileheight
self.canvas
self.tiles
self.tileInstances
self.drawRange
    self.drawRange.sx
    self.drawRange.sy
    self.drawRange.ex
    self.drawRange.ey
self.width
self.height
self.tilesets
self.layers
self.orientation

--Methods of map
Map:init(path, fw) 
Map:initWorldCollision(world) 
Map:setTiles(index, tileset, gid)
Map:setLayer(layer, path)
Map:setTileData(layer)
Map:setObjectCoordinates(layer)
Map:setSpriteBatches(layer)
Map:setObjectSpriteBatches(layer)
Map:setDrawRange(tx, ty, w, h)
Map:addCustomLayer(name, index)
Map:convertToCustomLayer(index)
Map:removeLayer(index)
Map:update(dt)
Map:draw(sx, sy)
Map:drawLayer(layer)
Map:drawTileLayer(layer)
Map:drawObjectLayer(layer)
Map:drawImageLayer(layer)
Map:drawWorldCollision(collision)
Map:resize(w, h)
Map:convertIsometricToScreen(x, y)
Map:convertScreenToIsometric(x, y)
Map:convertTileToScreen(x, y)
Map:convertScreenToTile(x, y)
Map:convertIsometricTileToScreen(x, y)
Map:convertScreenToIsometricTile(x, y)
Map:convertStaggeredTileToScreen(x, y)
Map:convertScreenToStaggeredTile(x, y)
Based on the information above you could possibly extend the functionality of STI and write a get method to retrieve whatever information you need by placing it right inside the file before the line where it says return Map.

Example: This would return a table of all the properties of Map

Code: Select all

function Map:getEverything()
     return {
                self.tilewidth,
                self.tileheight,
                self.canvas,
                self.tiles,
                self.tileInstances,
                self.drawRange,
                self.drawRange.sx,
                self.drawRange.sy,
                self.drawRange.ex,
                self.drawRange.ey,
                self.width,
                self.height,
                self.tilesets,
                self.layers,
                self.orientation
      }
end

return Map
Ofourse you would need to know what each property is and what kind of data is may or may not hold, somethings might be tables some might be strings, some might be numbers
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Switching from ATL to STI - tileData does not exist anym

Post by Karai17 »

What exactly do you need tileData for?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 10 guests