UCanvasPanel

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.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Components/CanvasPanel.h

Include

#include "Components/CanvasPanel.h"

Syntax

class UCanvasPanel : public UPanelWidget

Remarks

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

Variables

Name Description

Protected variable

TSharedPtr< cla...

 

MyCanvas

Constructors

Name Description

Public function

UCanvasPanel

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

UCanvasPanel...

 

AddChildToCanvas

(
    UWidget* Content
)

Public function Const

TSharedPtr< ...

 

GetCanvasWidget()

Gets the underlying native canvas widget if it has been constructed

Public function Const

bool

 

GetGeometryForSlot

(
    int32 SlotIndex,
    FGeometry& ArrangedGeometry
)

Computes the geometry for a particular slot based on the current geometry of the canvas.

Public function Const

bool

 

GetGeometryForSlot

(
    UCanvasPanelSlot* Slot,
    FGeometry& ArrangedGeometry
)

Computes the geometry for a particular slot based on the current geometry of the canvas.

Overridden from UPanelWidget

Name Description

Protected function Virtual Const

UClass *

 

GetSlotClass()

UPanelWidget.

Public function Virtual Const

bool

 

LockToPanelOnDrag()

Protected function Virtual

void

 

OnSlotAdded

(
    UPanelSlot* Slot
)

Protected function Virtual

void

 

OnSlotRemoved

(
    UPanelSlot* Slot
)

Overridden from UWidget

Name Description

Public function Virtual

const FText

 

GetPaletteCategory()

Gets the palette category of the widget

Protected function Virtual

TSharedRef< ...

 

RebuildWidget()

Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed.

Overridden from UVisual

Name Description

Public function Virtual

void

 

ReleaseSlateResources

(
    bool bReleaseChildren
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss