diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-04 22:58:37 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-04 22:58:37 +0200 |
commit | 1392fe0404f19decab197064c88ca4dc0ad9c12d (patch) | |
tree | 397aeed2a61635ac887fecbd6a02cdb01b52ae7b /not | |
parent | 6d81b4c2e65593218bb2a8ee322d083e362c7ab1 (diff) | |
download | roflnauts-1392fe0404f19decab197064c88ca4dc0ad9c12d.zip roflnauts-1392fe0404f19decab197064c88ca4dc0ad9c12d.tar.gz roflnauts-1392fe0404f19decab197064c88ca4dc0ad9c12d.tar.bz2 |
Minor interaction changes; draw arrows
Diffstat (limited to 'not')
-rw-r--r-- | not/Selector.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/not/Selector.lua b/not/Selector.lua index 00cf5a0..c6ab810 100644 --- a/not/Selector.lua +++ b/not/Selector.lua @@ -98,15 +98,30 @@ function Selector:getShapeString () end end +-- TODO: Selector draw is missing box content drawing. function Selector:draw (scale) local x, y = self:getPosition() local w, h = self:getSize() + local boxType = "normal" if self:getLocked() then boxType = "active" end + love.graphics.setColor(255, 255, 255, 255) love.graphics.draw(self.atlas, self.quads[self:getShapeString()][boxType], x*scale, y*scale, 0, scale, scale) + + if self.focused then + local dy = (h-6)/2 + local al, ar = self.quads.arrow_r, self.quads.arrow_l + if self.lock then + al, ar = ar, al + end + + love.graphics.draw(self.atlas, ar, (x+0-2-math.floor(self.delay))*scale, (y+dy)*scale, 0, scale, scale) + love.graphics.draw(self.atlas, al, (x+w-4+math.floor(self.delay))*scale, (y+dy)*scale, 0, scale, scale) + end + love.graphics.setFont(Font) love.graphics.printf(self:getText(), (x-w)*scale, (y+h+1)*scale, w*3, "center", 0, scale, scale) end @@ -127,6 +142,7 @@ function Selector:controlpressed (set, action, key) if action == "right" then self:setIndex(self.index + 1) end + -- TODO: Extend functionality on attack action in Selector. if action == "attack" then self.lock = true end |