Ajout des derniers développement #1
4 changed files with 37 additions and 43 deletions
BIN
sonic-radiance.love/assets/backgrounds/options.png
Normal file
BIN
sonic-radiance.love/assets/backgrounds/options.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -1,49 +1,15 @@
|
||||||
return {
|
return {
|
||||||
["tilesets"] = {
|
|
||||||
{"charicons", "assets/sprites/characters/charicons"},
|
|
||||||
{"normaltiles", "assets/backgrounds/normaltile"},
|
|
||||||
{"sptiles", "assets/backgrounds/specialtile"},
|
|
||||||
{"borders", "assets/backgrounds/borders"},
|
|
||||||
},
|
|
||||||
["sprites"] = {
|
["sprites"] = {
|
||||||
{"cursorground", "assets/gui/cursor/ground"},
|
{"cursorground", "assets/gui/cursor/ground"},
|
||||||
{"hitGFX", "assets/sprites/gfx/hit"},
|
{"hitGFX", "assets/sprites/gfx/hit"},
|
||||||
},
|
},
|
||||||
["textures"] = {
|
["textures"] = {
|
||||||
{"menucursor", "assets/gui/cursor-menulist.png"},
|
{"background", "assets/backgrounds/options.png"}
|
||||||
{"statusbar", "assets/gui/status_bar.png"},
|
|
||||||
{"cursorpeak", "assets/gui/cursor/peak.png"},
|
|
||||||
{"actorsShadow", "assets/sprites/shadow.png"},
|
|
||||||
{"emptytile", "assets/backgrounds/tilemask.png"},
|
|
||||||
|
|
||||||
{"e_speedster", "assets/gui/emblem_speedster.png"},
|
|
||||||
{"e_technic", "assets/gui/emblem_technic.png"},
|
|
||||||
{"e_power", "assets/gui/emblem_power.png"},
|
|
||||||
|
|
||||||
{"m_speedster", "assets/gui/emblem_speedster_mask.png"},
|
|
||||||
{"m_technic", "assets/gui/emblem_technic_mask.png"},
|
|
||||||
{"m_power", "assets/gui/emblem_power_mask.png"},
|
|
||||||
|
|
||||||
{"hudturn", "assets/gui/strings/hudturn.png"},
|
|
||||||
{"battlecompleted", "assets/gui/strings/battle_completed.png" }
|
|
||||||
},
|
|
||||||
["fonts"] = {
|
|
||||||
{"small", "assets/gui/fonts/PixelOperator.ttf", 16},
|
|
||||||
{"victory", "assets/gui/fonts/vipnagorgialla.ttf", 12}
|
|
||||||
},
|
},
|
||||||
["imagefonts"] = {
|
["imagefonts"] = {
|
||||||
{"hudnbrs", "assets/gui/fonts/hudnumbers"},
|
|
||||||
{"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"},
|
|
||||||
{"medium", "assets/gui/fonts/SA2font"},
|
{"medium", "assets/gui/fonts/SA2font"},
|
||||||
},
|
},
|
||||||
["sfx"] = {
|
["sfx"] = {
|
||||||
{"hit", "assets/sfx/hit.wav"},
|
|
||||||
{"hitconnect", "assets/sfx/hitconnect.wav"},
|
|
||||||
{"jump", "assets/sfx/jump.wav"},
|
|
||||||
{"woosh", "assets/sfx/woosh.wav"},
|
|
||||||
{"spincharge", "assets/sfx/spincharge.wav"},
|
|
||||||
{"spinrelease", "assets/sfx/spinrelease.wav"},
|
|
||||||
|
|
||||||
{"mBack", "assets/sfx/menus/back.wav"},
|
{"mBack", "assets/sfx/menus/back.wav"},
|
||||||
{"mBeep", "assets/sfx/menus/beep.wav"},
|
{"mBeep", "assets/sfx/menus/beep.wav"},
|
||||||
{"mSelect", "assets/sfx/menus/select.wav"},
|
{"mSelect", "assets/sfx/menus/select.wav"},
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
local Scene = require "core.modules.scenes"
|
local Scene = require "core.modules.scenes"
|
||||||
local OptionsMenu = Scene:extend()
|
local OptionsMenu = Scene:extend()
|
||||||
|
|
||||||
local ListBox = require "core.modules.menusystem.listbox"
|
local OptionMenu = require "scenes.options.menu"
|
||||||
local Widgets = require "scenes.options.widgets"
|
local Widgets = require "scenes.options.widgets"
|
||||||
|
|
||||||
|
local gui = require "game.modules.gui"
|
||||||
|
|
||||||
function OptionsMenu:new()
|
function OptionsMenu:new()
|
||||||
OptionsMenu.super.new(self)
|
OptionsMenu.super.new(self)
|
||||||
|
|
||||||
|
@ -33,16 +35,22 @@ function OptionsMenu:new()
|
||||||
|
|
||||||
self.keyDetector = {}
|
self.keyDetector = {}
|
||||||
self.keyDetector.widget = nil
|
self.keyDetector.widget = nil
|
||||||
|
|
||||||
|
self.borderY = 25
|
||||||
|
self.borders = gui.newBorder(424, 30, 8)
|
||||||
|
|
||||||
|
self.timer = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function OptionsMenu:update(dt)
|
||||||
|
self.timer = (self.timer + (30 * dt)) % 128
|
||||||
end
|
end
|
||||||
|
|
||||||
-- MENU FUNCTION
|
-- MENU FUNCTION
|
||||||
-- Functions that serve the handling of menus
|
-- Functions that serve the handling of menus
|
||||||
|
|
||||||
function OptionsMenu:addMenu(name, nobackbutton)
|
function OptionsMenu:addMenu(name, nobackbutton)
|
||||||
local screenHeight, screenWidth = core.screen:getDimensions()
|
OptionMenu(self.menusystem, name)
|
||||||
local w, h = 424/2, 240 - 48
|
|
||||||
local x, y = w / 2, 24
|
|
||||||
ListBox(self.menusystem, name, x, y, w, h, 8)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsMenu:addSubMenu(name, fullname)
|
function OptionsMenu:addSubMenu(name, fullname)
|
||||||
|
@ -89,9 +97,15 @@ function OptionsMenu:keypressed( key )
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsMenu:draw()
|
function OptionsMenu:draw()
|
||||||
love.graphics.setColor(.3, .1, .4, 1)
|
local w, h = core.screen:getDimensions()
|
||||||
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
for i=-1, (w/128) do
|
||||||
utils.graphics.resetColor()
|
for j=-1,(h/128) do
|
||||||
|
self.assets.images["background"]:draw(i*128 + self.timer, j*128 + self.timer)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
||||||
|
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
return OptionsMenu
|
return OptionsMenu
|
||||||
|
|
14
sonic-radiance.love/scenes/options/menu.lua
Normal file
14
sonic-radiance.love/scenes/options/menu.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
local ListBox = require "core.modules.menusystem.listbox"
|
||||||
|
local OptionMenu = ListBox:extend()
|
||||||
|
local WIDTH = 424/1.4
|
||||||
|
local HEIGHT = 240/1.4
|
||||||
|
|
||||||
|
function OptionMenu:new(menusystem, name)
|
||||||
|
local w, h = math.floor(WIDTH), math.floor(HEIGHT)
|
||||||
|
local screenw, screenh = core.screen:getDimensions()
|
||||||
|
local x = (screenw/2) - (w/2)
|
||||||
|
local y = (screenh/2) - (h/2)
|
||||||
|
OptionMenu.super.new(self, menusystem, name, x, y, w, h, 8)
|
||||||
|
end
|
||||||
|
|
||||||
|
return OptionMenu
|
Loading…
Reference in a new issue