2022-01-06 14:34:45 +01:00
|
|
|
local Scene = require "scenes.menus.debugmenus.commons.scene"
|
2020-08-01 14:01:08 +02:00
|
|
|
local BackgroundViewer = Scene:extend()
|
2022-01-06 14:34:45 +01:00
|
|
|
|
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
|
|
|
|
|
2022-01-06 14:34:45 +01:00
|
|
|
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
|