Position closebuttons automatically

This commit is contained in:
Kenny Shields 2014-01-24 22:48:42 -05:00
parent 69e38a4972
commit 5156ca3ca5
2 changed files with 6 additions and 3 deletions

View File

@ -18,6 +18,7 @@ function newobject:initialize()
self.internal = true
self.hover = false
self.down = false
self.autoposition = true
self.OnClick = function() end
-- apply template properties to the object
@ -61,6 +62,11 @@ function newobject:update(dt)
self.hover = true
end
if self.autoposition then
self.staticx = self.parent.width - self.width - 4
self.staticy = 4
end
-- move to parent if there is a parent
if parent ~= base then
self.x = parent.x + self.staticx

View File

@ -371,9 +371,6 @@ function skin.DrawCloseButton(object)
love.graphics.draw(image, x, y)
end
object:SetPos(parentwidth - 20, 4)
object:SetSize(16, 16)
end
--[[---------------------------------------------------------