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