UI Theme
Description
A theme is a DialogueUiTheme asset holding every sprite, colour, font, and size the dialogue UI uses, split into five blocks. Applying a theme walks the prompt and panel views and pushes those values into them.
Themes are applied through Dialogue UI Service; DialogueUiThemeService is the static helper that resolves which theme applies. See UI and Theming.
IDialogueUiTheme
| Property | Type | Covers |
|---|---|---|
| Prompt | DialoguePromptThemeData | The interact prompt. |
| Speech | DialogueSpeechThemeData | The panel background and the speech text. |
| Options | DialogueOptionsThemeData | The option list, selected and unselected. |
| Progress | DialogueProgressThemeData | The countdown progress bar. |
| Shared | DialogueSharedThemeData | Fallback font and size for anything unset. |
DialogueUiThemeService
A static helper. It reads settings; it does not apply anything.
| Name | Parameters | Return Type | Description |
|---|---|---|---|
| GetSettings | N/A | ModuleSettings | The dialogue module settings asset. |
| GetUiSettings | N/A | DialogueUiSettingsData | The UI section of module settings. |
| GetModuleDefaultTheme | N/A | DialogueUiTheme | The default theme configured in module settings. |
| ResolveTheme | IDialogueUiTheme explicitOverride = null | IDialogueUiTheme | Returns the override if given, otherwise the module default. |
DialoguePromptThemeData
| Field | Type | Default |
|---|---|---|
| backgroundSprite | Sprite | none |
| backgroundColor | Color | white |
| textColor | Color | black |
| keyTextColor | Color | black |
| fontAsset | TMP_FontAsset | none |
| fontSize | int | 36 |
| defaultPromptText | string | Press '{0}' to chat |
| interactionKeyLabel | string | X |
defaultPromptText is a format string; {0} is replaced with the resolved binding label for the current device, so a gamepad shows its own button rather than X.
DialogueSpeechThemeData
| Field | Type | Default |
|---|---|---|
| panelBackgroundSprite | Sprite | none |
| panelImageType | Image.Type | Simple |
| panelFillCenter | bool | true |
| panelBackgroundColor | Color | black, 39% alpha |
| speechBackgroundSprite | Sprite | none |
| speechImageType | Image.Type | Simple |
| speechFillCenter | bool | true |
| speechBackgroundColor | Color | transparent |
| speakerNameColor | Color | white |
| speechTextColor | Color | white |
| nameFontAsset | TMP_FontAsset | none |
| bodyFontAsset | TMP_FontAsset | none |
| nameFontSize | int | 36 |
| bodyFontSize | int | 36 |
The Image.Type and fill-centre pairs exist so a nine-sliced panel sprite renders correctly; set the image type to Sliced when using one.
DialogueOptionsThemeData
| Field | Type | Default |
|---|---|---|
| optionBackgroundSprite | Sprite | none |
| selectedOptionBackgroundSprite | Sprite | none |
| selectedOptionImageType | Image.Type | Simple |
| selectedOptionFillCenter | bool | true |
| selectedMarkerSprite | Sprite | none |
| optionBackgroundColor | Color | transparent |
| selectedOptionBackgroundColor | Color | black, 39% alpha |
| optionTextColor | Color | white |
| selectedOptionTextColor | Color | white |
| optionFontAsset | TMP_FontAsset | none |
| optionFontSize | int | 36 |
| verticalSpacing | float | 0 |
| minimumHeight | float | 60 |
DialogueProgressThemeData
| Field | Type | Default |
|---|---|---|
| frameSprite | Sprite | none |
| frameImageType | Image.Type | Simple |
| frameFillCenter | bool | true |
| fillSprite | Sprite | none |
| fillImageType | Image.Type | Simple |
| capSprite | Sprite | none |
| frameColor | Color | white |
| fillColor | Color | white |
| capColor | Color | white |
| defaultVisible | bool | false |
defaultVisible decides whether the bar shows outside of a timed option. Leave it off unless the bar is part of your panel's resting look.
DialogueSharedThemeData
| Field | Type | Default |
|---|---|---|
| fallbackFontAsset | TMP_FontAsset | none |
| fallbackFontSize | int | 36 |
Used wherever a block leaves its own font unset, so a theme can set one font once rather than in five places.