diff --git a/objects/internal/closebutton.lua b/objects/internal/closebutton.lua index d42685f..1782980 100644 --- a/objects/internal/closebutton.lua +++ b/objects/internal/closebutton.lua @@ -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 diff --git a/skins/Blue/skin.lua b/skins/Blue/skin.lua index e8acb6a..f2b791c 100644 --- a/skins/Blue/skin.lua +++ b/skins/Blue/skin.lua @@ -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 --[[---------------------------------------------------------