Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Animation Error
#7
Hi again,

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:

Code:
#include "Tilengine.h"

int main(int argc, char* argv)
{
    TLN_Init(427, 240, 11, 30, 30);
    
    TLN_SetLoadPath("assets/Sprites/Terri");
    TLN_Spriteset ss = TLN_LoadSpriteset("TerriIdle.png");
    TLN_SequencePack sp = TLN_LoadSequencePack("TerriIdle.sqx");
    TLN_Sequence idle = TLN_FindSequence(sp, "idle");

    int sprite = TLN_GetAvailableSprite();
    TLN_ConfigSprite(sprite, ss, 0);
    TLN_SetSpriteAnimation(sprite, idle, 0);

    int frame = 0;
    TLN_CreateWindow(NULL, 0);
    while (TLN_ProcessWindow()) {
        TLN_DrawFrame(frame);
        frame += 1;
    }
    return 0;
}

And the top left corner captured with GifCam, after correcting the sqx file


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
C# Animation Error - by Midnight Syntax - 03-23-2021, 02:55 PM
RE: C# Animation Error - by megamarc - 03-24-2021, 12:28 AM
RE: C# Animation Error - by Midnight Syntax - 03-24-2021, 03:54 AM
RE: C# Animation Error - by Midnight Syntax - 03-24-2021, 03:55 AM
RE: C# Animation Error - by megamarc - 03-24-2021, 08:18 PM
RE: C# Animation Error - by Midnight Syntax - 03-25-2021, 03:29 AM
RE: C# Animation Error - by megamarc - 03-25-2021, 06:27 AM
RE: C# Animation Error - by Midnight Syntax - 03-25-2021, 07:06 AM
RE: C# Animation Error - by megamarc - 03-25-2021, 08:16 AM
RE: C# Animation Error - by Midnight Syntax - 03-25-2021, 09:07 AM
RE: C# Animation Error - by megamarc - 03-25-2021, 09:35 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)