summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-16 17:14:00 +0200
committerAki <nthirtyone@gmail.com>2016-06-16 17:14:00 +0200
commit4e2ff01294fabc380fa761686b5ed8de7395be8b (patch)
treeff5ed87414748eaf786d1474a22d6d45dc6513b8
parent72c2f5c09a1286421cea5cad24fd11eba0df876c (diff)
downloadroflnauts-4e2ff01294fabc380fa761686b5ed8de7395be8b.zip
roflnauts-4e2ff01294fabc380fa761686b5ed8de7395be8b.tar.gz
roflnauts-4e2ff01294fabc380fa761686b5ed8de7395be8b.tar.bz2
Naut name display
-rw-r--r--selector.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/selector.lua b/selector.lua
index 17f76c1..778c6cc 100644
--- a/selector.lua
+++ b/selector.lua
@@ -24,7 +24,8 @@ function Selector:getPosition ()
end
function Selector:draw ()
-- portrait, sprite
- local p = self.parent.portrait_sheet[self.parent.nauts[self.naut]]
+ local name = self.parent.nauts[self.naut]
+ local p = self.parent.portrait_sheet[name]
local sprite = self.parent.portrait_sprite
-- scale, position
local scale = self.parent.scale
@@ -41,6 +42,9 @@ function Selector:draw ()
else
love.graphics.draw(sprite, p.active, x*scale, y*scale, 0, 1*scale, 1*scale)
end
+ if self.naut ~= 1 then
+ love.graphics.printf(name, (x-6)*scale, (y+33)*scale, 44, "center", 0, scale, scale)
+ end
end
function Selector:assignController(controller)
controller:setParent(self)