I'm testing out Tilengine with the CS binding and when making a simple character with an animation I keep getting an Invalid SequencePack error. I will admit that I'm using a 3 year old video as a tutorial of sorts so it's possible something changed since then and I just don't know it. I'll post my code below:
Of course things change over time and something can break. Th C# binding has not been updated in a while but the main engine has continued evolving. One thing that has changed but that hasn't been translated to the binding is animation.
However I can see concept mistake in your code. You're creating Sprite and Animation objects, and then assign assets. You must not do. The engine itselfs creates indexed arrays of Sprite and Animation objects, you must request what one you want (but not create new ones).
For example you init the engine at 400x240 resolution, with 4 layers, 80 sprites and 16 animators:
Code:
Engine engine = Engine.Init(400, 240, 4,80, 16);
If you want to use sprite index 0 (they go from 0 to 79 in this example):
It may be some incompatibility between the current version of the engine and the binding, because there are some breaking changes to the animation API since the C# binding was last updated. As I don't have .netcore environment installed I couldn't run the program.
However I did a quick translate to C, and it works. There's a slight mistake in the sqx file, as animation frame starts at 0, sequence should be 0,1,2,3,4 instead of 1,2,3,4,5, but it only causes a minor glitch on each loop, otherwise it loads and displays correctly. Relative paths seem also correct.
Here is the translated C test, running at .\Testing\Testing\bin\Debug\netcoreapp3.1 to keep the same folder structure:
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: