Released a new version of STI. This is mostly a maintenance release but it has a new versioning system so I'll explain. STI's version number will now contain four sections as opposed to the previous three. The first three sections will be the same as the version of Tiled that the release was designed against and the last section will be the STI release within the Tiled release.
Examples:
1) Tiled's current version number is 0.12.3. STI has its first release based on this version of Tiled so STI's version is 0.12.3.0.
2) If STI is updated before Tiled, it will get the version number of 0.12.3.1.
3) If Tiled is updated before STI then Tiled may be released as 0.13.0 or 0.12.4. STI 0.12.3.x should still be used and will not get a version bump without merit (which is to say, I will not auto-bump numbers unless I make changes).
Many releases of Tiled do not affect STI in any way, they are fixes for the Tiled editor itself so you may not see an update to STI even if there are several updates to Tiled.
Now, with that out of the way, the changes to STI are as follows:
1) You must now type in the full file name (including extension) when loading a new map. Previously you could write sti.new("map01"). You must now write sti.new("map01.lua"). While writing ".lua" might seem redundant, it is consistent with everything else in LOVE and most other places so I feel like it is better to be consistent than to be lazy.
2) Map:setDrawRange no longer auto-inverts your translations so you must pass in negative translations yourself. This is again for consistency's sake.
3) Map:draw no longer accepts scale values. Please use love.graphics.scale if you want to scale the map.
4) STI still does not support Tile Collections, but it
does give you a better error message now!
5) There is a new table, Map.objects. It indexes all unique objects by their new IDs (this was added in Tiled 0.11.0).
6) You can now check which version of Tiled that your map was exported from by printing Map.tiledversion! Make sure the version at
least matches STI's or else you might get weird errors! Remember you can also print STI's version with STI._VERSION!
Code: Select all
local sti = require "sti"
print(sti._VERSION) -- 0.12.3.0
local map = sti.new("map01.lua")
print(map.tiledversion) -- 0.12.3