• Runtimes
  • Corona Slot setColor Problem

Im just getting started with using Spine in my Corona project. I seem to have everything working except changing the color of a slot attachment.

Im trying to do something like this:

local colorName = skeleton:findSlot("__left lower arm slot")
colorName:setColor (208,17, 17, 255)

I get an error that the 'setColor' method is nil. I had a look in slot.lua and I don't see setColor in there... is it missing or something? Any help would be greatly appreciated. Thanks!

Related Discussions
...

You can directly set the color via the Slot.color field! See the methods in Color.lua provided by color itself. Your example would translate to colorName.color:set(1 / 208, 1 / 17, 1 / 17, 1 / 255). Note that Spine stores color channels in the range 0-1, not 0-255.

Thanks so much for the reply! I think Im all sorted out now.