preliminary version of credits splash

This commit is contained in:
Hersi 2022-04-03 03:02:16 +02:00
parent aecfc1c925
commit e8f7471663
1 changed files with 43 additions and 1 deletions

View File

@ -11,6 +11,10 @@ local splash2BgColor = {255, 255, 255}
local splash2Logo = gfx.CreateSkinImage("titlescreen/splash/usc2.png", 0) local splash2Logo = gfx.CreateSkinImage("titlescreen/splash/usc2.png", 0)
local splash2LogoWidth, splash2LogoHeight = gfx.ImageSize(splash2Logo) local splash2LogoWidth, splash2LogoHeight = gfx.ImageSize(splash2Logo)
local splash3BgColor = {255, 255, 255}
local splash3Logo = gfx.CreateSkinImage("titlescreen/splash/team-exceed.png", 0)
local splash3LogoWidth, splash3LogoHeight = gfx.ImageSize(splash3Logo)
local splashState = "init" local splashState = "init"
local splashTimer = 0 local splashTimer = 0
local fadeDuration = 0.5 local fadeDuration = 0.5
@ -18,6 +22,7 @@ local fadeAlpha = 0
local splashInitDuration = 1 local splashInitDuration = 1
local splash1Duration = 4 local splash1Duration = 4
local splash2Duration = 4 local splash2Duration = 4
local splash3Duration = 4
game.LoadSkinSample("titlescreen/splash/splash1.wav") game.LoadSkinSample("titlescreen/splash/splash1.wav")
local splash1SfxPlayed = false local splash1SfxPlayed = false
@ -114,7 +119,7 @@ local function splash2(deltaTime)
gfx.Text("Press START to skip...", 10, Dim.design.height - 10) gfx.Text("Press START to skip...", 10, Dim.design.height - 10)
if (splashTimer < 0) then if (splashTimer < 0) then
splashState = "done" splashState = "splash3"
splashTimer = 0 splashTimer = 0
return return
end end
@ -126,6 +131,41 @@ local function splash2(deltaTime)
splashTimer = splashTimer - deltaTime splashTimer = splashTimer - deltaTime
end end
local function splash3(deltaTime)
local splash3LogoXOffset = (Dim.design.width - splash3LogoWidth) / 2
local splash3LogoYOffset = (Dim.design.height - splash3LogoHeight) / 2
calcFade(splash3Duration)
gfx.BeginPath()
gfx.Rect(0, 0, Dim.design.width, Dim.design.height)
gfx.FillColor(splash3BgColor[1], splash3BgColor[2], splash3BgColor[3], fadeAlpha)
gfx.Fill()
gfx.BeginPath()
gfx.ImageRect(splash3LogoXOffset, splash3LogoYOffset, splash3LogoWidth, splash3LogoHeight, splash3Logo, fadeAlpha / 255, 0)
gfx.BeginPath()
gfx.LoadSkinFont("segoeui.ttf")
gfx.FillColor(0, 0, 0, fadeAlpha)
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_BOTTOM)
gfx.FontSize(28)
gfx.Text("Press START to skip...", 10, Dim.design.height - 10)
if (splashTimer < 0) then
splashState = "done"
splashTimer = 0
return
end
if splashTimer == 0 then
splashTimer = splash3Duration
end
splashTimer = splashTimer - deltaTime
end
local function reset() local function reset()
triggerSkip = false triggerSkip = false
splashState = "init" splashState = "init"
@ -160,6 +200,8 @@ function render(deltaTime)
splash1(deltaTime) splash1(deltaTime)
elseif splashState == "splash2" then elseif splashState == "splash2" then
splash2(deltaTime) splash2(deltaTime)
elseif splashState == "splash3" then
splash3(deltaTime)
elseif splashState == "done" then elseif splashState == "done" then
reset() reset()
return { return {