class

AArcUICanvas

A UMG-style canvas: children are placed by anchor + offset + explicit size within this widget's allotted rect. Arc has no canvas panel, so the ArcUI runtime carries its own — the one widget the .ui factory needs that the framework does not provide.

Module
ArcUI
Header
#include "ArcUI/Widgets/AArcUICanvas.h"
Namespace
Arcf

Public functions

ReturnsNameDescription
voidAddChild
voidClearChildren
voidSetDesignSize
voidSetScreenRootOnly the canvas a screen's root node builds insets by the safe zone; nested canvases sit inside an already-inset rect.
ArcVec2ComputeDesiredSize
voidArrangeChildren
int32_tOnPaint
int32_tGetNumChildrenChildren are enumerated front-to-back in ZOrder, so Arc's reverse-order hit test picks the same widget the painter drew on top.
TSharedPtr<AWidget>GetChildAt
TSharedPtr<AWidget>GetChildAtSlotInsertion order — the order the authored node children were added, which is what the designer maps its node paths onto.
boolCanCacheDesiredSize
boolCanSkipArrangeThe arrange body is anchors, slot offsets and the children's cached desired sizes against the allotted rect — no clock, no clamped offset, no row recycling — and the one input it reads from outside the tree (the safe-zone inset) invalidates every widget when it moves.
boolCanRetainPaint
const char*GetTypeName
ArcRectComputeChildRectThe one place canvas geometry is computed.
floatComputeDpiScaleUniform design→viewport scale (aspect-preserving fit) so a canvas authored at its design resolution lays out proportionally at any viewport size.
voidSetSafeZoneInsetsTitle-safe insets as a fraction of each axis, applied by screen-root canvases.
ArcVec2GetSafeZoneInsets

Function details

AddChild

C++
void AddChild(TSharedPtr<AWidget> widget, const ::Mowo::FArcUICanvasSlot& slot)

ClearChildren

C++
void ClearChildren()

SetDesignSize

C++
void SetDesignSize(const ArcVec2& size)

SetScreenRoot

C++
void SetScreenRoot(bool screenRoot)

Only the canvas a screen's root node builds insets by the safe zone; nested canvases sit inside an already-inset rect.

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

ArrangeChildren

C++
void ArrangeChildren(const CGeometry& geo) override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

GetNumChildren

C++
int32_t GetNumChildren() const override

Children are enumerated front-to-back in ZOrder, so Arc's reverse-order hit test picks the same widget the painter drew on top.

GetChildAt

C++
TSharedPtr<AWidget> GetChildAt(int32_t index) const override

GetChildAtSlot

C++
TSharedPtr<AWidget> GetChildAtSlot(int32_t index) const

Insertion order — the order the authored node children were added, which is what the designer maps its node paths onto.

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

CanSkipArrange

C++
bool CanSkipArrange() const override

The arrange body is anchors, slot offsets and the children's cached desired sizes against the allotted rect — no clock, no clamped offset, no row recycling — and the one input it reads from outside the tree (the safe-zone inset) invalidates every widget when it moves. Paint is the children in ZOrder at the geometry arrange gave them. Without these the root of every .ui screen refused, and one refusing descendant vetoes every ancestor, so a shipped game re-arranged and repainted its whole UI tree every frame.

CanRetainPaint

C++
bool CanRetainPaint() const override

GetTypeName

C++
const char* GetTypeName() const override

ComputeChildRect

C++
static ArcRect ComputeChildRect(const ::Mowo::FArcUICanvasSlot& slot, const ArcVec2& parentSize, const ArcVec2& desiredSize, float scale)

The one place canvas geometry is computed. Anchors are fractions of the parent rect; on an axis whose anchors coincide the slot's high offset is the child's size and Alignment is its pivot, otherwise the high offset is the inset from the far edge. Offsets and sizes are authored in design units and multiplied by scale; anchors track the real viewport.

ComputeDpiScale

C++
static float ComputeDpiScale(const ArcVec2& viewport, const ArcVec2& design)

Uniform design→viewport scale (aspect-preserving fit) so a canvas authored at its design resolution lays out proportionally at any viewport size.

SetSafeZoneInsets

C++
static void SetSafeZoneInsets(const ArcVec2& fractions)

Title-safe insets as a fraction of each axis, applied by screen-root canvases. A project setting on the host side; 0 disables.

GetSafeZoneInsets

C++
static ArcVec2 GetSafeZoneInsets()
Generated from ArcUI/Widgets/AArcUICanvas.h via arcui.json · Nov 4, 2026Version 1.0.0