Skip to content

Commit 2a08bf4

Browse files
committed
Objects marked as not visible will no longer be drawn
1 parent 1c8cc36 commit 2a08bf4

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

sti/init.lua

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -933,16 +933,18 @@ function Map:drawObjectLayer(layer)
933933
end
934934

935935
for _, object in ipairs(layer.objects) do
936-
if object.shape == "rectangle" and not object.gid then
937-
drawShape(object.rectangle, "rectangle")
938-
elseif object.shape == "ellipse" then
939-
drawShape(object.ellipse, "ellipse")
940-
elseif object.shape == "polygon" then
941-
drawShape(object.polygon, "polygon")
942-
elseif object.shape == "polyline" then
943-
drawShape(object.polyline, "polyline")
944-
elseif object.shape == "point" then
945-
lg.points(object.x, object.y)
936+
if object.visible then
937+
if object.shape == "rectangle" and not object.gid then
938+
drawShape(object.rectangle, "rectangle")
939+
elseif object.shape == "ellipse" then
940+
drawShape(object.ellipse, "ellipse")
941+
elseif object.shape == "polygon" then
942+
drawShape(object.polygon, "polygon")
943+
elseif object.shape == "polyline" then
944+
drawShape(object.polyline, "polyline")
945+
elseif object.shape == "point" then
946+
lg.points(object.x, object.y)
947+
end
946948
end
947949
end
948950

0 commit comments

Comments
 (0)