2022-05-06 00:05:20 +02:00
|
|
|
local version = require("common.version")
|
|
|
|
local Dim = require("common.dimensions")
|
2021-08-09 20:13:53 +02:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
local BAR_ALPHA = 191
|
2021-08-09 20:13:53 +02:00
|
|
|
|
|
|
|
local FOOTER_HEIGHT = 128
|
2022-05-06 00:05:20 +02:00
|
|
|
local footerY = Dim.design.height - FOOTER_HEIGHT
|
2021-08-09 20:13:53 +02:00
|
|
|
|
|
|
|
-- Images
|
2022-05-06 00:05:20 +02:00
|
|
|
local footerRightImage = gfx.CreateSkinImage("components/bars/footer_right.png", 0)
|
2021-08-09 20:13:53 +02:00
|
|
|
|
|
|
|
-- Animation related
|
2022-05-06 00:05:20 +02:00
|
|
|
local entryTransitionScale = 0
|
|
|
|
local entryTransitionFooterYOffset = 0
|
2021-08-09 20:13:53 +02:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
local legend = {{control = "START", text = "Confirm selection"}, {control = "KNOB", text = "Scroll"}}
|
|
|
|
|
|
|
|
local function set() end
|
|
|
|
|
|
|
|
local function drawFooter()
|
|
|
|
gfx.BeginPath()
|
|
|
|
gfx.FillColor(0, 0, 0, BAR_ALPHA)
|
|
|
|
gfx.Rect(0, footerY, Dim.design.width, FOOTER_HEIGHT)
|
|
|
|
gfx.Fill()
|
2021-08-09 20:13:53 +02:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
gfx.BeginPath()
|
|
|
|
gfx.ImageRect(Dim.design.width - 275, footerY - 25, 328 * 0.85, 188 * 0.85, footerRightImage, 1, 0)
|
|
|
|
|
|
|
|
gfx.BeginPath()
|
|
|
|
gfx.LoadSkinFont("Digital-Serial-Bold.ttf")
|
2021-08-13 22:59:35 +02:00
|
|
|
gfx.FontSize(20)
|
|
|
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
2022-05-06 00:05:20 +02:00
|
|
|
gfx.FillColor(255, 255, 255, 255)
|
|
|
|
gfx.Text("EXPERIMENTALGEAR " .. version.MAJOR .. "." .. version.MINOR .. "." .. version.PATCH .. "", 8, 1895)
|
2021-08-09 20:13:53 +02:00
|
|
|
end
|
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
local function progressTransitions(deltaTime)
|
|
|
|
entryTransitionScale = entryTransitionScale + deltaTime / 0.3
|
|
|
|
if (entryTransitionScale > 1) then entryTransitionScale = 1 end
|
2021-08-09 20:13:53 +02:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
entryTransitionFooterYOffset = FOOTER_HEIGHT * (1 - entryTransitionScale)
|
|
|
|
footerY = Dim.design.height - FOOTER_HEIGHT + entryTransitionFooterYOffset
|
2021-08-09 20:13:53 +02:00
|
|
|
end
|
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
local function draw(deltaTime, params)
|
|
|
|
if params and params.noEnterTransition then
|
|
|
|
entryTransitionScale = 1
|
2021-08-12 16:20:19 +02:00
|
|
|
end
|
|
|
|
|
2021-08-09 20:13:53 +02:00
|
|
|
gfx.Save()
|
2021-11-22 22:25:38 +01:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
gfx.ResetTransform()
|
|
|
|
|
|
|
|
Dim.updateResolution()
|
|
|
|
|
|
|
|
Dim.transformToScreenSpace()
|
|
|
|
|
|
|
|
gfx.LoadSkinFont("NotoSans-Regular.ttf")
|
|
|
|
|
|
|
|
drawFooter()
|
2021-08-09 20:13:53 +02:00
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
progressTransitions(deltaTime)
|
2021-08-09 20:13:53 +02:00
|
|
|
|
|
|
|
gfx.Restore()
|
|
|
|
end
|
|
|
|
|
2022-05-06 00:05:20 +02:00
|
|
|
return {set = set, draw = draw}
|