mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +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.internal = true
|
||||||
self.hover = false
|
self.hover = false
|
||||||
self.down = false
|
self.down = false
|
||||||
|
self.autoposition = true
|
||||||
self.OnClick = function() end
|
self.OnClick = function() end
|
||||||
|
|
||||||
-- apply template properties to the object
|
-- apply template properties to the object
|
||||||
@ -61,6 +62,11 @@ function newobject:update(dt)
|
|||||||
self.hover = true
|
self.hover = true
|
||||||
end
|
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
|
-- move to parent if there is a parent
|
||||||
if parent ~= base then
|
if parent ~= base then
|
||||||
self.x = parent.x + self.staticx
|
self.x = parent.x + self.staticx
|
||||||
|
@ -371,9 +371,6 @@ function skin.DrawCloseButton(object)
|
|||||||
love.graphics.draw(image, x, y)
|
love.graphics.draw(image, x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
object:SetPos(parentwidth - 20, 4)
|
|
||||||
object:SetSize(16, 16)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
--[[---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user