Enhancements and tweaks for the scenario title splash

- Add a background gradient
- Add a wrapping panel to hold both text and gradient
- Add font resizing in case of very long scenario names.  None currently overflow, but this should ensure they stay on one line if we get a longer one
This commit is contained in:
Buhallin 2023-01-10 18:05:19 -08:00
parent 9d522b5392
commit 5caeb47c82
No known key found for this signature in database
GPG Key ID: DB3C362823852294
3 changed files with 30 additions and 11 deletions

View File

@ -198,5 +198,10 @@
"Name": "Inv-Jacqueline", "Name": "Inv-Jacqueline",
"Type": 0, "Type": 0,
"URL": "https://i.imgur.com/AFuB9II.png" "URL": "https://i.imgur.com/AFuB9II.png"
},
{
"Name": "TitleGradient",
"Type": 0,
"URL": "https://i.imgur.com/bY6nZbu.png"
} }
] ]

View File

@ -875,7 +875,7 @@ function applyOptionPanelChange(id, state)
-- option: Show CYOA campaign guides -- option: Show CYOA campaign guides
elseif id == "showCYOA" then elseif id == "showCYOA" then
optionPanel[id] = spawnOrRemoveHelper(state, "CYOA Campaign Guides", {65, 1.6, -11}) optionPanel[id] = spawnOrRemoveHelper(state, "CYOA Campaign Guides", {65, 1.6, -11})
-- option: Show custom playmat images -- option: Show custom playmat images
elseif id == "showCustomPlaymatImages" then elseif id == "showCustomPlaymatImages" then
optionPanel[id] = spawnOrRemoveHelper(state, "Custom Playmat Images", {67.5, 1.6, 37}) optionPanel[id] = spawnOrRemoveHelper(state, "Custom Playmat Images", {67.5, 1.6, 37})
@ -1014,14 +1014,17 @@ function titleSplash(scenarioName)
Wait.stop(hideTitleSplashWaitFunctionId) Wait.stop(hideTitleSplashWaitFunctionId)
hideTitleSplashWaitFunctionId = nil hideTitleSplashWaitFunctionId = nil
UI.setAttribute('title_splash', 'active', false) UI.setAttribute('title_splash', 'active', false)
-- UI.setAttribute('title_gradient', 'active', false)
end end
-- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen) -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen)
-- wait timer to hide the scenario name -- wait timer to hide the scenario name
UI.setValue('title_splash', scenarioName) UI.setValue('title_splash_text', scenarioName)
UI.show('title_splash') UI.show('title_splash')
-- UI.show('title_gradient')
hideTitleSplashWaitFunctionId = Wait.time(function() hideTitleSplashWaitFunctionId = Wait.time(function()
UI.hide('title_splash') UI.hide('title_splash')
-- UI.hide('title_gradient')
hideTitleSplashWaitFunctionId = nil hideTitleSplashWaitFunctionId = nil
end, 4) end, 4)
end end

View File

@ -98,16 +98,27 @@
</VerticalLayout> </VerticalLayout>
<!-- Title Splash when starting a scenario --> <!-- Title Splash when starting a scenario -->
<Text id="title_splash" <Panel
fontSize="150" id="title_splash"
font="font_teutonic-arkham" height="220"
outline="black"
outlineSize="3 -3"
showAnimation="FadeIn" showAnimation="FadeIn"
hideAnimation="FadeOut" hideAnimation="FadeOut"
active="false" active="false"
animationDuration="2" animationDuration="2">
horizontalOverflow="Wrap"> <Image
</Text> id="title_gradient"
height="220"
image="TitleGradient" />
<Text id="title_splash_text"
width="95%"
height="180"
resizeTextForBestFit="true"
resizeTextMinSize="100"
resizeTextMaxSize="150"
font="font_teutonic-arkham"
outline="black"
outlineSize="3 -3"
horizontalOverflow="Wrap">
</Text>
</Panel>
<Include src="OptionPanel.xml"/> <Include src="OptionPanel.xml"/>