Unreal

[언리얼엔진5] 위젯의 크기 구하기

건전한 건전지 2024. 7. 22. 18:31
728x90
반응형

 

FVector2D UMyWidget::GetScrollBoxSize()
{
	if(!MyScrollBox)
	{
		return FVector2D(0,0);
	}

	TSharedPtr<SWidget> SlateWidget = MyScrollBox->TakeWidget();
	if(!SlateWidget.IsValid())
	{
		return FVector2D(0,0);
	}
	
	FGeometry Geometry = SlateWidget->GetCachedGeometry();
	return Geometry.GetLocalSize();
}
728x90
반응형