improvement: make option menu a bit less plain
This commit is contained in:
parent
459f4905c7
commit
ce5cb1298f
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 {
|
||||
["tilesets"] = {
|
||||
{"charicons", "assets/sprites/characters/charicons"},
|
||||
{"normaltiles", "assets/backgrounds/normaltile"},
|
||||
{"sptiles", "assets/backgrounds/specialtile"},
|
||||
{"borders", "assets/backgrounds/borders"},
|
||||
},
|
||||
["sprites"] = {
|
||||
{"cursorground", "assets/gui/cursor/ground"},
|
||||
{"hitGFX", "assets/sprites/gfx/hit"},
|
||||
},
|
||||
["textures"] = {
|
||||
{"menucursor", "assets/gui/cursor-menulist.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}
|
||||
{"background", "assets/backgrounds/options.png"}
|
||||
},
|
||||
["imagefonts"] = {
|
||||
{"hudnbrs", "assets/gui/fonts/hudnumbers"},
|
||||
{"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"},
|
||||
{"medium", "assets/gui/fonts/SA2font"},
|
||||
},
|
||||
["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"},
|
||||
{"mBeep", "assets/sfx/menus/beep.wav"},
|
||||
{"mSelect", "assets/sfx/menus/select.wav"},
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
local Scene = require "core.modules.scenes"
|
||||
local OptionsMenu = Scene:extend()
|
||||
|
||||
local ListBox = require "core.modules.menusystem.listbox"
|
||||
local OptionMenu = require "scenes.options.menu"
|
||||
local Widgets = require "scenes.options.widgets"
|
||||
|
||||
local gui = require "game.modules.gui"
|
||||
|
||||
function OptionsMenu:new()
|
||||
OptionsMenu.super.new(self)
|
||||
|
||||
|
@ -33,16 +35,22 @@ function OptionsMenu:new()
|
|||
|
||||
self.keyDetector = {}
|
||||
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
|
||||
|
||||
-- MENU FUNCTION
|
||||
-- Functions that serve the handling of menus
|
||||
|
||||
function OptionsMenu:addMenu(name, nobackbutton)
|
||||
local screenHeight, screenWidth = core.screen:getDimensions()
|
||||
local w, h = 424/2, 240 - 48
|
||||
local x, y = w / 2, 24
|
||||
ListBox(self.menusystem, name, x, y, w, h, 8)
|
||||
OptionMenu(self.menusystem, name)
|
||||
end
|
||||
|
||||
function OptionsMenu:addSubMenu(name, fullname)
|
||||
|
@ -89,9 +97,15 @@ function OptionsMenu:keypressed( key )
|
|||
end
|
||||
|
||||
function OptionsMenu:draw()
|
||||
love.graphics.setColor(.3, .1, .4, 1)
|
||||
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
||||
utils.graphics.resetColor()
|
||||
local w, h = core.screen:getDimensions()
|
||||
for i=-1, (w/128) do
|
||||
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
|
||||
|
||||
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