• Runtimes
  • SetColor on SlotData?

On the editor we can set the color of a Slot. On the run-time we can get this color with SlotData.getColor(), but I can't find a method to set the color. I tried changing the Color returned by getColor, but that didn't work either. Am I missing something here? Is there a way to change the Color of the Slot in code without having to set each possible Color on a different Skin?

I'm using the libgdx runtime.

Related Discussions
...
  • 編集済み

Sure, it works like this in libgdx:

slot.getColor().set(1, 0, 0, 1);

I was doing that, but it wasn't working.

Turns out I was changing the Color from the SlotData I got from SkeletonData.findSlot(). When in fact I should've been changing the Color from Slot (not SlotData) from Skeleton.findSlot() (not SkeletonData). Now everything is well and fine.

Thanks for the help 🙂