scenes/mainmenu: dim the main menu when inactive
This commit is contained in:
parent
1b514f8346
commit
f49773823f
|
@ -7,6 +7,8 @@ local MapWidget = MainWidget:extend()
|
|||
local ExitWidget = MainWidget:extend()
|
||||
local OptionsWidget = MainWidget:extend()
|
||||
|
||||
local DIMVALUE = .5
|
||||
|
||||
function MenuObject:new(scene)
|
||||
self.scene = scene
|
||||
local screenwidth, screenheight = core.screen:getDimensions()
|
||||
|
@ -59,6 +61,20 @@ function MainWidget:drawCanvas()
|
|||
end
|
||||
end
|
||||
|
||||
function MainWidget:draw(x, y)
|
||||
if self.menu.isActive == false then
|
||||
love.graphics.setColor(DIMVALUE, DIMVALUE, DIMVALUE, 1)
|
||||
else
|
||||
utils.graphics.resetColor()
|
||||
end
|
||||
|
||||
if self.canvas.texture ~= nil then
|
||||
love.graphics.draw(self.canvas.texture, x, y)
|
||||
end
|
||||
|
||||
utils.graphics.resetColor()
|
||||
end
|
||||
|
||||
function MapWidget:new(menusystem)
|
||||
MapWidget.super.new(self, menusystem, "WORLD MAP")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue