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
| Returns | Name | Description |
|---|---|---|
void | AddChild | |
void | ClearChildren | |
void | SetDesignSize | |
void | SetScreenRoot | Only the canvas a screen's root node builds insets by the safe zone; nested canvases sit inside an already-inset rect. |
ArcVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
int32_t | GetNumChildren | Children 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> | GetChildAtSlot | Insertion order — the order the authored node children were added, which is what the designer maps its node paths onto. |
bool | CanCacheDesiredSize | |
bool | CanSkipArrange | 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. |
bool | CanRetainPaint | |
const char* | GetTypeName | |
ArcRect | ComputeChildRect | The one place canvas geometry is computed. |
float | ComputeDpiScale | Uniform design→viewport scale (aspect-preserving fit) so a canvas authored at its design resolution lays out proportionally at any viewport size. |
void | SetSafeZoneInsets | Title-safe insets as a fraction of each axis, applied by screen-root canvases. |
ArcVec2 | GetSafeZoneInsets |
Function details
AddChild
void AddChild(TSharedPtr<AWidget> widget, const ::Mowo::FArcUICanvasSlot& slot)ClearChildren
void ClearChildren()SetDesignSize
void SetDesignSize(const ArcVec2& size)SetScreenRoot
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
ArcVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideGetNumChildren
int32_t GetNumChildren() const overrideChildren are enumerated front-to-back in ZOrder, so Arc's reverse-order hit test picks the same widget the painter drew on top.
GetChildAt
TSharedPtr<AWidget> GetChildAt(int32_t index) const overrideGetChildAtSlot
TSharedPtr<AWidget> GetChildAtSlot(int32_t index) constInsertion order — the order the authored node children were added, which is what the designer maps its node paths onto.
CanCacheDesiredSize
bool CanCacheDesiredSize() const overrideCanSkipArrange
bool CanSkipArrange() const overrideThe 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
bool CanRetainPaint() const overrideGetTypeName
const char* GetTypeName() const overrideComputeChildRect
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
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
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
static ArcVec2 GetSafeZoneInsets()