From 4e2ff01294fabc380fa761686b5ed8de7395be8b Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 16 Jun 2016 17:14:00 +0200 Subject: Naut name display --- selector.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.1