From cb59b59a73a5f92e115078ce5a22bcd2b46b9611 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Fri, 24 Jan 2014 22:17:48 -0500 Subject: [PATCH] Position scrollbuttons immediately after their creation --- objects/internal/scrollable/scrollbody.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/objects/internal/scrollable/scrollbody.lua b/objects/internal/scrollable/scrollbody.lua index 7c3088b..417617f 100644 --- a/objects/internal/scrollable/scrollbody.lua +++ b/objects/internal/scrollable/scrollbody.lua @@ -38,6 +38,8 @@ function newobject:initialize(parent, bartype) if self.bartype == "vertical" then local upbutton = loveframes.objects["scrollbutton"]:new("up") + upbutton.staticx = 0 + self.width - upbutton.width + upbutton.staticy = 0 upbutton.parent = self upbutton.Update = function(object, dt) upbutton.staticx = 0 + self.width - upbutton.width @@ -54,6 +56,8 @@ function newobject:initialize(parent, bartype) end local downbutton = loveframes.objects["scrollbutton"]:new("down") downbutton.parent = self + downbutton.staticx = 0 + self.width - downbutton.width + downbutton.staticy = 0 + self.height - downbutton.height downbutton.Update = function(object, dt) downbutton.staticx = 0 + self.width - downbutton.width downbutton.staticy = 0 + self.height - downbutton.height @@ -72,6 +76,8 @@ function newobject:initialize(parent, bartype) elseif self.bartype == "horizontal" then local leftbutton = loveframes.objects["scrollbutton"]:new("left") leftbutton.parent = self + leftbutton.staticx = 0 + leftbutton.staticy = 0 leftbutton.Update = function(object, dt) leftbutton.staticx = 0 leftbutton.staticy = 0 @@ -87,6 +93,8 @@ function newobject:initialize(parent, bartype) end local rightbutton = loveframes.objects["scrollbutton"]:new("right") rightbutton.parent = self + rightbutton.staticx = 0 + self.width - rightbutton.width + rightbutton.staticy = 0 rightbutton.Update = function(object, dt) rightbutton.staticx = 0 + self.width - rightbutton.width rightbutton.staticy = 0