Hello everyone! I have an existential doubt
It happens that until now I had been using the color slot to customize my characters, such as hair, skin, clothes, etc.
and it works perfectly with normal animations in my runtime
Now it happens that for certain parts of the body I am applying (I do not know if it is called this way) frame per frame animation
I mean, using a single slot multiple skinholders that I enable or disable in the animation according to my need.
example a mouth movement:
slot name: mouth
placeholder: normal
placeholder: semiopen
placeholder: open
If I change the color of the slot in the editor and play the animation, the color remains in all the images
but in my runtime the color is lost when changing from normal to others. but when I the animation back to the normal placeholder it shows the new color well.
I don't know then if my idea of using the slot color is correct for this purpose, or I am forgetting to do something.
it is the code i use for change the colors
private void changeColorBySlot(Color color, String slotName) {
Slot slot = skeleton.findSlot(slotName);
RegionAttachment attachment = (RegionAttachment) slot.getAttachment();
try {
if (color != null)
attachment.getColor().set(color);
attachment.updateOffset();
}catch (Exception e){
Gdx.app.error("Error changing color in slot: ",slotName);
}
}