The list object will only update its children if they are within its boundaries

This commit is contained in:
Kenny Shields 2014-01-20 17:20:08 -05:00
parent 6cede1d844
commit 8fddb8635a

View File

@ -88,7 +88,10 @@ function newobject:update(dt)
local offsety = self.offsety
for k, v in ipairs(children) do
v:update(dt)
local col = loveframes.util.BoundingBox(x, v.x, y, v.y, width, v.width, height, v.height)
if col then
v:update(dt)
end
v:SetClickBounds(x, y, width, height)
v.x = (v.parent.x + v.staticx) - offsetx
v.y = (v.parent.y + v.staticy) - offsety
@ -145,7 +148,7 @@ function newobject:draw()
-- set the object's draw order
self:SetDrawOrder()
if draw then
draw(self)
else