sonic-radiance/sonic-radiance.love/scenes/menus/debugmenus/battleBack/init.lua

30 lines
786 B
Lua
Raw Normal View History

local Scene = require "scenes.menus.debugmenus.commons.scene"
2020-08-01 14:01:08 +02:00
local BackgroundViewer = Scene:extend()
2020-08-01 14:01:08 +02:00
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")
2020-08-01 14:01:08 +02:00
end
end
function BackgroundViewer:setBackground(newBackground)
self.background = Background(self, 5, 1, newBackground)
end
function BackgroundViewer:draw()
self.background:draw()
end
return BackgroundViewer