Navigation
API > API/Runtime > API/Runtime/UMG
The canvas panel is a designer friendly panel that allows widgets to be laid out at arbitrary locations, anchored and z-ordered with other children of the canvas. The canvas is a great widget for manual layout, but bad when you want to procedurally just generate widgets and place them in a container (unless you want absolute layout).
- Many Children
- Absolute Layout
- Anchors
| Name | UCanvasPanel |
| Type | class |
| Header File | /Engine/Source/Runtime/UMG/Public/Components/CanvasPanel.h |
| Include Path | #include "Components/CanvasPanel.h" |
Syntax
UCLASS (
Meta=(ShortTooltip="A designer-friendly panel useful for laying out top-level widgets. Use sparingly."),
MinimalAPI)
class UCanvasPanel : public UPanelWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UPanelWidget → UCanvasPanel
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UCanvasPanel
(
const FObjectInitializer& ObjectInitializer |
Components/CanvasPanel.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UCanvasPanelSlot * AddChildToCanvas
(
UWidget* Content |
Components/CanvasPanel.h |
|
|
TSharedPtr< class SConstraintCanvas > GetCanvasWidget() |
Gets the underlying native canvas widget if it has been constructed | Components/CanvasPanel.h | |
bool GetGeometryForSlot
(
int32 SlotIndex, |
Computes the geometry for a particular slot based on the current geometry of the canvas. | Components/CanvasPanel.h | |
bool GetGeometryForSlot
(
UCanvasPanelSlot* Slot, |
Computes the geometry for a particular slot based on the current geometry of the canvas. | Components/CanvasPanel.h |
Overridden from UPanelWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool LockToPanelOnDrag() |
Components/CanvasPanel.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
Gets the palette category of the widget | Components/CanvasPanel.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
Components/CanvasPanel.h |
Protected
Overridden from UPanelWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UClass * GetSlotClass() |
UPanelWidget. | Components/CanvasPanel.h | |
virtual void OnSlotAdded
(
UPanelSlot* Slot |
Components/CanvasPanel.h | ||
virtual void OnSlotRemoved
(
UPanelSlot* Slot |
Components/CanvasPanel.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > RebuildWidget() |
Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. | Components/CanvasPanel.h |