mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 06:14:53 +08:00
[ue] Closes #2594, add SetSlotColor to SpineWidget.
This commit is contained in:
parent
80fb9f3c5a
commit
85a4f71162
Binary file not shown.
@ -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) {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user