summaryrefslogtreecommitdiffhomepage
path: root/selector.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-05 16:50:29 +0200
committerAki <nthirtyone@gmail.com>2016-06-05 16:50:29 +0200
commitab54b33e5ba43440c83bcd405fadad835a9e6450 (patch)
tree81d9affd3bee13571b6d3468c4b87f5debfff715 /selector.lua
parent6a95cb98187127fc2379127b176483d496ef5181 (diff)
downloadroflnauts-ab54b33e5ba43440c83bcd405fadad835a9e6450.zip
roflnauts-ab54b33e5ba43440c83bcd405fadad835a9e6450.tar.gz
roflnauts-ab54b33e5ba43440c83bcd405fadad835a9e6450.tar.bz2
Menu visuals
Diffstat (limited to 'selector.lua')
-rw-r--r--selector.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/selector.lua b/selector.lua
index 5a1cb22..97a20c6 100644
--- a/selector.lua
+++ b/selector.lua
@@ -23,12 +23,23 @@ function Selector:getPosition ()
return self.x, self.y
end
function Selector:draw ()
+ -- portrait, sprite
local p = self.parent.portrait_sheet[self.parent.nauts[self.naut]]
+ local sprite = self.parent.portrait_sprite
+ -- scale, position
local scale = self.parent.scale
+ local x,y = self:getPosition()
+ -- arrows
+ local arrowl = self.parent.portrait_sheet.arrow_left
+ local arrowr = self.parent.portrait_sheet.arrow_right
if not self.state then
- love.graphics.draw(self.parent.portrait_sprite, p.normal, self.x*scale, self.y*scale, 0, 1*scale, 1*scale)
+ love.graphics.draw(sprite, p.normal, x*scale, y*scale, 0, 1*scale, 1*scale)
+ if self.controller ~= nil then
+ love.graphics.draw(sprite, arrowl, (x-5)* scale, (y+13)*scale, 0, scale, scale)
+ love.graphics.draw(sprite, arrowr, (x+33)*scale, (y+13)*scale, 0, scale, scale)
+ end
else
- love.graphics.draw(self.parent.portrait_sprite, p.active, self.x*scale, self.y*scale, 0, 1*scale, 1*scale)
+ love.graphics.draw(sprite, p.active, x*scale, y*scale, 0, 1*scale, 1*scale)
end
end
function Selector:assignController(controller)