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",
"Type": 0,
"URL": "https://i.imgur.com/AFuB9II.png"
},
{
"Name": "TitleGradient",
"Type": 0,
"URL": "https://i.imgur.com/bY6nZbu.png"
}
]

View File

@ -1014,14 +1014,17 @@ function titleSplash(scenarioName)
Wait.stop(hideTitleSplashWaitFunctionId)
hideTitleSplashWaitFunctionId = nil
UI.setAttribute('title_splash', 'active', false)
-- UI.setAttribute('title_gradient', 'active', false)
end
-- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen)
-- 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_gradient')
hideTitleSplashWaitFunctionId = Wait.time(function()
UI.hide('title_splash')
-- UI.hide('title_gradient')
hideTitleSplashWaitFunctionId = nil
end, 4)
end

View File

@ -98,16 +98,27 @@
</VerticalLayout>
<!-- Title Splash when starting a scenario -->
<Text id="title_splash"
fontSize="150"
font="font_teutonic-arkham"
outline="black"
outlineSize="3 -3"
<Panel
id="title_splash"
height="220"
showAnimation="FadeIn"
hideAnimation="FadeOut"
active="false"
animationDuration="2"
animationDuration="2">
<Image
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>
</Text>
</Panel>
<Include src="OptionPanel.xml"/>