Commits

Chris Klimas committed f9f1861

Position tile-based objects properly in loadLayers()

For whatever reason, it seems Tiled uses the lower-left corner for x and y
position for a tile-based object instead of the upper-left one, which it uses
for rectangle-drawn objects.

  • Participants
  • Parent commits 64ab3a1

Comments (0)

Files changed (1)

File zoetrope/core/view.lua

 							for key, value in pairs(tile.properties) do
 								obj.properties[key] = tovalue(value)
 							end
+
+							-- Tiled tile-based objects measure their y
+							-- position at their lower-left corner, instead
+							-- of their upper-left corner as usual
+
+							obj.y = obj.y - obj.height
 						end
 
 						-- create a new object if the class does exist