03-25-2021, 08:16 AM
You're not dumb at all
I think the problem is: prior to release 2.8.0, function for sprite animation took 4 arguments:
Whereas for release 2.8.0, the first "anim_index" parameter has been removed, so the function is:
The C# binding still targets the old format, but you're using latest 2.9.0 release, so parameter order gets mismatched. It should be updated to the new API. The SetSpriteAnimation function should not belong to Animation class, but to Sprite class. That's the idea:
This method
Should be transformed to:
I think the problem is: prior to release 2.8.0, function for sprite animation took 4 arguments:
Code:
bool TLN_SetSpriteAnimation (int anim_index, int nsprite, TLN_Sequence sequence, int loop);
Whereas for release 2.8.0, the first "anim_index" parameter has been removed, so the function is:
Code:
bool TLN_SetSpriteAnimation (int nsprite, TLN_Sequence sequence, int loop);
The C# binding still targets the old format, but you're using latest 2.9.0 release, so parameter order gets mismatched. It should be updated to the new API. The SetSpriteAnimation function should not belong to Animation class, but to Sprite class. That's the idea:
This method
Code:
Animation::SetSpriteAnimation(int spriteIndex, Sequence sequence, int loop)
{
TLN_SetSpriteAnimation(index, spriteIndex, sequence.ptr, loop);
}
Should be transformed to:
Code:
Sprite::SetAnimation(Sequence sequence, int loop)
{
TLN_SetSpriteAnimation(index, sequence.ptr, loop);
}