mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Add set-skeleton-color.
This commit is contained in:
parent
34e56af5c5
commit
8ed7554f14
@ -250,6 +250,17 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "set-skeleton-color",
|
||||
"scriptName": "SetSkeletonColor",
|
||||
"highlight": false,
|
||||
"params": [
|
||||
{
|
||||
"id": "color",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "set-slot-color",
|
||||
"scriptName": "SetSlotColor",
|
||||
|
||||
@ -69,6 +69,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Acts =
|
||||
this.setPhysicsMode(mode);
|
||||
},
|
||||
|
||||
SetSkeletonColor (this: SDKInstanceClass, color: string) {
|
||||
this.setSkeletonColor(color);
|
||||
},
|
||||
|
||||
SetSlotColor (this: SDKInstanceClass, slotName: string, color: string) {
|
||||
this.setSlotColor(slotName, color);
|
||||
},
|
||||
|
||||
@ -271,6 +271,16 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
||||
}
|
||||
}
|
||||
|
||||
public setSkeletonColor (color: string) {
|
||||
const { skeleton } = this;
|
||||
if (!skeleton) {
|
||||
console.warn('[Spine] setSkeletonColor: no skeleton');
|
||||
return;
|
||||
}
|
||||
|
||||
skeleton.color.setFromString(color);
|
||||
}
|
||||
|
||||
public setSlotColor (slotName: string, color: string) {
|
||||
const { skeleton } = this;
|
||||
if (!skeleton) {
|
||||
|
||||
@ -332,6 +332,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-skeleton-color": {
|
||||
"list-name": "Set skeleton color",
|
||||
"display-text": "Set skeleton color to {0}",
|
||||
"description": "Set the color of the entire skeleton. Accepts hex colors (#RRGGBB or #RRGGBBAA) or color names.",
|
||||
"params": {
|
||||
"color": {
|
||||
"name": "Color",
|
||||
"desc": "Color value (hex like #FF0000 or color name)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-slot-color": {
|
||||
"list-name": "Set slot color",
|
||||
"display-text": "Set slot {0} color to {1}",
|
||||
|
||||
@ -333,6 +333,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-skeleton-color": {
|
||||
"list-name": "设置骨架颜色",
|
||||
"display-text": "设置骨架颜色为{0}",
|
||||
"description": "设置整个骨架的颜色。接受十六进制颜色(#RRGGBB 或 #RRGGBBAA)或颜色名称。",
|
||||
"params": {
|
||||
"color": {
|
||||
"name": "颜色",
|
||||
"desc": "颜色值(十六进制如 #FF0000 或颜色名称)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-slot-color": {
|
||||
"list-name": "设置插槽颜色",
|
||||
"display-text": "设置插槽{0}的颜色为{1}",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user