sonic-radiance/sonic-radiance.love/scenes/menus/debugmenus/battleBack/init.lua
2022-01-06 14:34:45 +01:00

30 lines
786 B
Lua

local Scene = require "scenes.menus.debugmenus.commons.scene"
local BackgroundViewer = Scene:extend()
local Background = require "game.modules.drawing.parallaxBackground"
local backgroundList = require "datas.gamedata.maps.shoot.zones"
function BackgroundViewer:new()
BackgroundViewer.super.new(self)
self:setBackground("city")
end
function BackgroundViewer:initMenu()
for backId, backgroundData in pairs(backgroundList) do
self.menu:addItem(backgroundData.name, "left", function()
self:setBackground(backId)
self:hideMenu()
end, "select")
end
end
function BackgroundViewer:setBackground(newBackground)
self.background = Background(self, 5, 1, newBackground)
end
function BackgroundViewer:draw()
self.background:draw()
end
return BackgroundViewer