scenes/map: improve cursor

This commit is contained in:
Kazhnuz 2019-03-08 20:04:24 +01:00
parent d1f110f11b
commit 587f2e08a1
1 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,9 @@
local Scene = require "core.modules.scenes"
local WorldMap = Scene:extend()
local menuutils = require "core.modules.menusystem.widgets.utils"
local CURSOR_PADDING = 2
function WorldMap:new()
WorldMap.super.new(self)
self.assets:addImage("background", "assets/backgrounds/worldmap.png")
@ -71,8 +74,10 @@ end
function WorldMap:draw()
self.assets:drawImage("background", 0, 0)
love.graphics.draw(self.banner, 0, 8)
local x, y = 16 + self.cursor.drawx * 16, 48 + self.cursor.drawy * 16
love.graphics.rectangle("fill", x, y, 16, 16)
local x, y = 16 + self.cursor.drawx * 16 - CURSOR_PADDING,
48 + self.cursor.drawy * 16 - CURSOR_PADDING
local size = 16 + CURSOR_PADDING * 2
menuutils.drawCursor(x, y, size, size)
end
return WorldMap