FArcWidgetFactory
Turns a serialized .ui tree into a live Arc widget tree. The widget class name on each node keys a small construction table; named nodes are collected so a game can resolve them for script binding after instantiate.
- Module
- ArcUI
- Header
#include "ArcUI/FArcWidgetFactory.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr int32_t | MaxUserWidgetDepth | How deep UserWidget composition may nest before the factory refuses. Default 8. |
Public functions
| Returns | Name | Description |
|---|---|---|
FBuildResult | Build | |
FBuildResult | Build | |
FBuildResult | Build | |
void | ApplyBindingValue | Writes one resolved binding value onto a live widget. |
std::string | FormatBindingNumber | |
void | SetImageDecoder | Process-wide image decode hook + GPU texture cache for brush images. |
void | ClearImageCache | |
Arcf::Ref<Arcf::IArcRHITexture> | GetOrLoadImage | |
Arcf::Ref<Arcf::IArcRHITexture> | GetOrLoadSizedImage | One image exported at several pixel sizes ("<stem>-<N>.png"): picks the smallest export that still covers the on-screen size, because a 512 px source sampled down to 16 px without mips shimmers and a 16 px one stretched up blurs. |
void | SetMediaSourceFactory | Process-wide clip decoder for VideoPlayer nodes, injected by the host for the same reason the image decoder is: playback lives in Game. |
bool | HasMediaSourceFactory | |
std::unique_ptr<IArcUIMediaSource> | CreateMediaSource | |
bool | IsKnownType | |
std::vector<std::string> | RegisteredTypes | |
void | SetActiveTheme | Process-wide theme every build falls back to when neither the screen nor the build context names one. |
const FArcUITheme& | ActiveTheme | |
Arcf::ArcColor | ResolveColorToken | Token → colour through the active theme, then the default theme. |
FArcUINode | ComposeUserWidget | Composes a referenced widget asset's tree with the overrides an embedding UserWidget node supplies: every exposed variable writes its value (or its default) onto the target node named by the referenced asset. |
bool | ResolveRightToLeft | Resolves a node's flow_direction ("inherit", "ltr", "rtl") against the parent's. |
FArcUICanvasSlot | MirrorCanvasSlot | A canvas slot mirrored about the canvas's vertical centre line, which is what a right-to-left canvas places its children by. |
Function details
Build
static FBuildResult Build(const FArcUIAsset& asset)Build
static FBuildResult Build(const FArcUIAsset& asset, const FArcUIBindingResolver& resolver)Build
static FBuildResult Build(const FArcUIAsset& asset, const FBuildContext& context)ApplyBindingValue
static void ApplyBindingValue(const std::string& property, const FArcUIBindingValue& value, const Arcf::TSharedPtr<Arcf::AWidget>& widget)Writes one resolved binding value onto a live widget. Shared between the build-time application and the screen stack's per-frame binding pump.
FormatBindingNumber
static std::string FormatBindingNumber(double number)SetImageDecoder
static void SetImageDecoder(FArcUIImageDecoder decoder)Process-wide image decode hook + GPU texture cache for brush images. The cache must be cleared before the Arc bridge/device shuts down.
ClearImageCache
static void ClearImageCache()GetOrLoadImage
static Arcf::Ref<Arcf::IArcRHITexture> GetOrLoadImage(const std::string& path)GetOrLoadSizedImage
static Arcf::Ref<Arcf::IArcRHITexture> GetOrLoadSizedImage(const std::string& stem, const std::vector<int32_t>& exportedSizes, float physicalPixels)One image exported at several pixel sizes ("<stem>-<N>.png"): picks the smallest export that still covers the on-screen size, because a 512 px source sampled down to 16 px without mips shimmers and a 16 px one stretched up blurs.
SetMediaSourceFactory
static void SetMediaSourceFactory(FArcUIMediaSourceFactory factory)Process-wide clip decoder for VideoPlayer nodes, injected by the host for the same reason the image decoder is: playback lives in Game. Null (the default) builds every VideoPlayer as a settings-only node.
HasMediaSourceFactory
static bool HasMediaSourceFactory()CreateMediaSource
static std::unique_ptr<IArcUIMediaSource> CreateMediaSource()IsKnownType
static bool IsKnownType(const std::string& type)RegisteredTypes
static std::vector<std::string> RegisteredTypes()SetActiveTheme
static void SetActiveTheme(const FArcUITheme* theme)Process-wide theme every build falls back to when neither the screen nor the build context names one. Hosts point this at the project theme; the pointer is borrowed, so the owner must outlive the last build.
ActiveTheme
static const FArcUITheme& ActiveTheme()ResolveColorToken
static Arcf::ArcColor ResolveColorToken(const std::string& token, const Arcf::ArcColor& fallback)Token → colour through the active theme, then the default theme. Public because the designer resolves the same tokens for its swatches and its token picker, and the two must never drift apart.
ComposeUserWidget
static FArcUINode ComposeUserWidget(const FArcUINode& instance, const FArcUIAsset& referenced)Composes a referenced widget asset's tree with the overrides an embedding UserWidget node supplies: every exposed variable writes its value (or its default) onto the target node named by the referenced asset.
ResolveRightToLeft
static bool ResolveRightToLeft(const FArcUINode& node, bool inherited)Resolves a node's flow_direction ("inherit", "ltr", "rtl") against the parent's.
MirrorCanvasSlot
static FArcUICanvasSlot MirrorCanvasSlot(const FArcUICanvasSlot& slot)A canvas slot mirrored about the canvas's vertical centre line, which is what a right-to-left canvas places its children by.