SFxWidget::ComputeDesiredSize

Compute the ideal size necessary to display this widget.

Windows
MacOS
Linux

Override Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Layout/SFxWidget.h

Include

#include "Widgets/Layout/SFxWidget.h"

Source

/Engine/Source/Runtime/Slate/Private/Widgets/Layout/SFxWidget.cpp

Syntax

virtual FVector2D ComputeDesiredSize
(
    float LayoutScaleMultiplier
) const

Remarks

Compute the ideal size necessary to display this widget. For aggregate widgets (e.g. panels) this size should include the size necessary to show all of its children. CacheDesiredSize() guarantees that the size of descendants is computed and cached before that of the parents, so it is safe to call GetDesiredSize() for any children while implementing this method.

that ComputeDesiredSize() is meant as an aide to the developer. It is NOT meant to be very robust in many cases. If your widget is simulating a bouncing ball, you should just return a reasonable size; e.g. 160x160. Let the programmer set up a reasonable rule of resizing the bouncy ball simulation.

Returns

The desired size.

Parameters

Parameter

Description

LayoutScaleMultiplier

This parameter is safe to ignore for almost all widgets; only really affects text measuring.

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