[ue] Closes #2594, add SetSlotColor to SpineWidget.

This commit is contained in:
Mario Zechner 2024-08-19 10:57:24 +02:00
parent 80fb9f3c5a
commit 85a4f71162
3 changed files with 13 additions and 0 deletions

View File

@ -368,6 +368,16 @@ bool USpineWidget::HasSlot(const FString SlotName) {
return false;
}
void USpineWidget::SetSlotColor(const FString SlotName, const FColor SlotColor) {
CheckState();
if (skeleton) {
spine::Slot *slot = skeleton->findSlot(TCHAR_TO_UTF8(*SlotName));
if (slot) {
slot->getColor().set(SlotColor.R / 255.f, SlotColor.G / 255.f, SlotColor.B / 255.f, SlotColor.A / 255.f);
}
}
}
void USpineWidget::GetAnimations(TArray<FString> &Animations) {
CheckState();
if (skeleton) {

View File

@ -141,6 +141,9 @@ public:
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
bool HasSlot(const FString SlotName);
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
void SetSlotColor(const FString SlotName, const FColor SlotColor);
UFUNCTION(BlueprintPure, Category = "Components|Spine|Skeleton")
void GetAnimations(TArray<FString> &Animations);