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

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):

Code:
Sprite sprite = engine.Sprites[0];
sprite.Setup(ss, TileFlags.None);

Same happens with Animation, you don't create them, but use ones available in engine.Animations[] array.



Let me know,
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)