RealDocs

UWidget::SetRenderScale

function UMG Blueprint Since 4.7
#include "Components/Widget.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Sets only the scale component of the widget's render transform, leaving angle, shear, and translation unchanged. Non-uniform scale (different X and Y) is supported.

Caveats & Gotchas

  • Scale is cosmetic — layout size does not change, so adjacent widgets are not pushed away and the widget's DesiredSize is unaffected.
  • Scaling to (0,0) visually hides the widget, but the slot space it occupies in the layout remains unchanged. Use SetVisibility(Hidden) or Collapsed if you also want to reclaim layout space.
  • The scale is applied around the render transform pivot (default center). To scale from a corner, change the pivot with SetRenderTransformPivot before applying scale.

Signature

UMG_API void SetRenderScale(FVector2D Scale)

Parameters

Name Type Description Default
Scale FVector2D Per-axis scale factors; (1,1) is identity. Values below 1 shrink, above 1 enlarge.

Return Type

void

Example

Pulse a button on hover C++
void UMyWidget::NativeOnMouseEnter(const FGeometry&, const FPointerEvent&)
{
    MyButton->SetRenderScale(FVector2D(1.1f, 1.1f));
}

void UMyWidget::NativeOnMouseLeave(const FPointerEvent&)
{
    MyButton->SetRenderScale(FVector2D(1.f, 1.f));
}

Version History

Introduced in: 4.7

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.