FMiriGraphicsTheme
A game-UI theme: the named colours, fonts and metrics a .ui resolves its tokens against. Serialized as MDF under the engine's existing .theme extension, so it browses, cooks and validates like every other text asset. A screen names its theme; without one the host's project theme applies, and without that the built-in default theme — which carries exactly the colours the factory used to hardcode, so nothing an older asset authored moves.
- Module
- MiriGraphics
- Header
#include "MiriGraphics/FMiriGraphicsTheme.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
std::string | Name | Default "Default". |
std::vector<FMiriGraphicsThemeColor> | Colors | |
std::vector<FMiriGraphicsThemeFont> | Fonts | |
std::vector<FMiriGraphicsThemeMetric> | Metrics | |
std::vector<FMiriGraphicsThemeRadii> | Radii | |
std::vector<FMiriGraphicsThemeShadow> | Shadows | |
std::vector<FMiriGraphicsThemeGradient> | Gradients | |
std::vector<FMiriGraphicsThemeSprite> | Sprites | |
std::vector<FMiriGraphicsThemeMotion> | Motion |
Public functions
| Returns | Name | Description |
|---|---|---|
const FMiriGraphicsThemeColor* | FindColor | |
const FMiriGraphicsThemeFont* | FindFont | |
const FMiriGraphicsThemeMetric* | FindMetric | |
const FMiriGraphicsThemeRadii* | FindRadii | |
const FMiriGraphicsThemeShadow* | FindShadow | |
const FMiriGraphicsThemeGradient* | FindGradient | |
const FMiriGraphicsThemeSprite* | FindSprite | |
const FMiriGraphicsThemeMotion* | FindMotion | |
bool | ResolveColor | |
bool | ResolveMetric | |
void | SetColor | |
std::vector<std::string> | ColorTokens | |
std::string | SerializeToMDF | |
bool | ParseFromMDF | |
bool | LoadFromFile | |
bool | SaveToFile | |
std::string | NormalizeToken | "token/accent", "Assets/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood. |
FMiriGraphicsTheme | MakeDefault | |
Vec4 | HighContrastColor | What a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface. |
const FMiriGraphicsTheme& | Default |
Function details
FindColor
const FMiriGraphicsThemeColor* FindColor(const std::string& token) constFindFont
const FMiriGraphicsThemeFont* FindFont(const std::string& name) constFindMetric
const FMiriGraphicsThemeMetric* FindMetric(const std::string& name) constFindRadii
const FMiriGraphicsThemeRadii* FindRadii(const std::string& name) constFindShadow
const FMiriGraphicsThemeShadow* FindShadow(const std::string& name) constFindGradient
const FMiriGraphicsThemeGradient* FindGradient(const std::string& name) constFindSprite
const FMiriGraphicsThemeSprite* FindSprite(const std::string& name) constFindMotion
const FMiriGraphicsThemeMotion* FindMotion(const std::string& name) constResolveColor
bool ResolveColor(const std::string& token, Vec4& out) constResolveMetric
bool ResolveMetric(const std::string& name, float& out) constSetColor
void SetColor(const std::string& token, const Vec4& value)ColorTokens
std::vector<std::string> ColorTokens() constSerializeToMDF
std::string SerializeToMDF() constParseFromMDF
bool ParseFromMDF(const std::string& text, std::string* outError = nullptr)LoadFromFile
bool LoadFromFile(const std::string& path, std::string* outError = nullptr)SaveToFile
bool SaveToFile(const std::string& path) constNormalizeToken
static std::string NormalizeToken(const std::string& token)"token/accent", "Assets/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood.
MakeDefault
static FMiriGraphicsTheme MakeDefault()HighContrastColor
static Vec4 HighContrastColor(const std::string& normalizedToken, const Vec4& value)What a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface. Tokens only — a literal colour authored in a .ui is the author's to choose.
Default
static const FMiriGraphicsTheme& Default()