From 02aba07e03465205b45c41df7aec6894d4e89909 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 20 Jul 2017 19:51:30 +0200 Subject: Moved name-tag drawing to separate function; moved up overall in drawing functions --- not/Hero.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'not/Hero.lua') diff --git a/not/Hero.lua b/not/Hero.lua index e8fa206..039aeb8 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -169,8 +169,11 @@ end function Hero:draw (offset_x, offset_y, scale, debug) if not self.isAlive then return end Hero.__super.draw(self, offset_x, offset_y, scale, debug) - love.graphics.setFont(Font) +end + +function Hero:drawTag (offset_x, offset_y, scale) local x,y = self:getPosition() + love.graphics.setFont(Font) love.graphics.printf(string.format("Player %d", math.abs(self.group)), (math.floor(x)+offset_x)*scale, (math.floor(y)+offset_y-26)*scale,100,'center',0,scale,scale,50,0) end -- cgit v1.1