diff --git a/changelog.txt b/changelog.txt index 4343b81..5e8f7fa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +================================================ +Version 0.9.2.2 - Alpha (May 23 - 2012) +================================================ +[FIXED] vertical slider value direction (top is now max value and bottom is 0) +[FIXED] text flashing in the text input object when moving the text blinker to the right +[FIXED] text blinker in the text input object not appearing in certain situations + ================================================ Version 0.9.2 - Alpha (May 22 - 2012) ================================================ diff --git a/init.lua b/init.lua index d39e4eb..f40bf79 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ loveframes = {} -- library info loveframes.info = {} loveframes.info.author = "Nikolai Resokav" -loveframes.info.version = "0.9.2" +loveframes.info.version = "0.9.2.2" loveframes.info.stage = "Alpha" -- library configurations diff --git a/objects/internal/sliderbutton.lua b/objects/internal/sliderbutton.lua index b4c0fc7..1471f17 100644 --- a/objects/internal/sliderbutton.lua +++ b/objects/internal/sliderbutton.lua @@ -109,8 +109,11 @@ function sliderbutton:update(dt) self.staticy = 0 end - progress = loveframes.util.Round(self.staticy/(self.parent.height - self.height), 5) - nvalue = self.parent.min + (self.parent.max - self.parent.min) * progress + local space = self.parent.height - self.height + local remaining = (self.parent.height - self.height) - self.staticy + local percent = loveframes.util.Round(remaining/space, 5) + + nvalue = self.parent.min + (self.parent.max - self.parent.min) * percent pvalue = self.parent.value end @@ -223,7 +226,7 @@ function sliderbutton:MoveToX(x) end --[[--------------------------------------------------------- - - func: MoveToY(x) + - func: MoveToY(y) - desc: moves the object to the specified y position --]]--------------------------------------------------------- function sliderbutton:MoveToY(y) diff --git a/objects/slider.lua b/objects/slider.lua index 645f43b..871fc27 100644 --- a/objects/slider.lua +++ b/objects/slider.lua @@ -201,7 +201,7 @@ function slider:SetValue(value) local xpos = self.width * (( newval - self.min ) / (self.max - self.min)) sliderbutton:MoveToX(xpos) elseif self.slidetype == "vertical" then - local ypos = self.height * (( newval - self.min ) / (self.max - self.min)) + local ypos = self.height - self.height * (( newval - self.min ) / (self.max - self.min)) sliderbutton:MoveToY(ypos) end @@ -354,4 +354,8 @@ function slider:SetSlideType(slidetype) self.slidetype = slidetype + if slidetype == "vertical" then + self:SetValue(self.min) + end + end \ No newline at end of file diff --git a/objects/textinput.lua b/objects/textinput.lua index 8e7f76d..1b162a8 100644 --- a/objects/textinput.lua +++ b/objects/textinput.lua @@ -264,8 +264,8 @@ function textinput:RunKey(key, unicode) self:MoveBlinker(1) if blinkx >= self.x + swidth and blinknum ~= #self.text then local width = self.font:getWidth(self.text:sub(blinknum, blinknum)) - self.xoffset = self.xoffset - width - elseif blinknum == #self.text and self.xoffset ~= ((0 - font:getWidth(self.text)) + swidth) then + self.xoffset = self.xoffset - width*2 + elseif blinknum == #self.text and self.xoffset ~= ((0 - font:getWidth(self.text)) + swidth) and font:getWidth(self.text) + self.textxoffset > self.width then self.xoffset = ((0 - font:getWidth(self.text)) + swidth) end end