mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[ue] USpineWidget now reports its desired size.
This commit is contained in:
parent
3ae685fff5
commit
83fab4ad97
@ -539,6 +539,7 @@
|
||||
* Added mix-and-match example to demonstrate the new Skin API.
|
||||
* Materials on `SkeletonRendererComponent` are now blueprint read and writeable. This allows setting dynamic material instances at runtime.
|
||||
* Added `InitialSkin` property to `USpineWidget`. This allows previewing different skins in the UMG Designer. Initial skins can still be overridden via blueprint events such as `On Initialized`.
|
||||
* `USpineWidget` will now report its own desired size based on the setup pose dimensions of the skeleton. This is used when selecting `Size to content` on a `USpineWidget` in the designer.
|
||||
|
||||
## C# ##
|
||||
* **Breaking changes**
|
||||
|
||||
@ -228,6 +228,14 @@ void SSpineWidget::Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements
|
||||
Idx++;
|
||||
}
|
||||
|
||||
FVector2D SSpineWidget::ComputeDesiredSize(float X) const {
|
||||
if (widget && widget->skeleton && widget->Atlas) {
|
||||
return FVector2D(boundsSize.X, boundsSize.Y);
|
||||
} else {
|
||||
return FVector2D(256, 256);
|
||||
}
|
||||
}
|
||||
|
||||
void SSpineWidget::UpdateMesh(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, Skeleton *Skeleton) {
|
||||
TArray<FVector> vertices;
|
||||
TArray<int32> indices;
|
||||
|
||||
@ -55,6 +55,8 @@ protected:
|
||||
|
||||
void Flush(int32 LayerId, FSlateWindowElementList &OutDrawElements, const FGeometry &AllottedGeometry, int &Idx, TArray<FVector> &Vertices, TArray<int32> &Indices, TArray<FVector2D> &Uvs, TArray<FColor> &Colors, TArray<FVector> &Colors2, UMaterialInstanceDynamic *Material);
|
||||
|
||||
virtual FVector2D ComputeDesiredSize(float) const override;
|
||||
|
||||
USpineWidget *widget;
|
||||
FRenderData renderData;
|
||||
FVector boundsMin;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user