mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Position closebuttons automatically
This commit is contained in:
parent
69e38a4972
commit
5156ca3ca5
@ -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
|
||||
|
@ -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
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user