Hi all, well this time I have a little problem understanding how to draw my skeleton.
I decide create a slot with multiple skin placeholders for a frame to frame animation, this work on editor, but at the runtime is not rendering.
the example is, imagine roar animation, so i have a slot named mouth and multiple placeholders for the diferente animation stages. the situation is all the time i want the default mouth stay at close.
before i do these animation my skeleton structure was
bone:mouth
slot: mouth
placeholder: mouth_closed
now is :
bone:mouth
slot: mouth
placeholder1: mouth_closed
placeholder2: mouth_opening1
placeholder2: mouth_opening2
placeholder3: mouth_opened
the firts problem i find, is when i create the skeleton the mouth was not drawn, after searh a little i find I can initialize this with:
skeleton().setAttachment("mouth", "mouth_closed");
this work! but then i find another problem.
if i decide apply another skin (for example
skeleton().setSkin("armor")
)
then the the mouth dissapear again, and if i call again the setAtachment this give me a nullpointer exception 🙁
I'm not really sure what is the correct way to handle multiple placeholders in a single slot, or if there is a better way to implement it
after a good time trying I find a solution... this work but i have no idea why
my old code was this. when i change armors i get the placeholder issue:
skeleton().setSkin(baseSkin); //without this only spawn a floating armor
skeleton().setSkin(armor);
my new code: with this all work ok, and the placeholder issue is fixed....
skeleton().getSkin().addSkin( baseSkin);
skeleton().getSkin().addSkin(armor);
Skeleton().setSlotsToSetupPose();