Posts: 196
Threads: 26
Joined: Dec 2020
Reputation:
1
Hi! I have some questions about the sqx format.
How does it work and what are the tags I can use? Can I use seconds instead of frames? And can I set an individual delay per sequence frame?
Thanks for your answer!
Posts: 681
Threads: 33
Joined: Jan 1970
Reputation:
13
Hi!
The sqx format is something I set up early when creating Tilengine, and then forgot about it. There is no public documentation about the accepted tags, but it's quite simple. The parser source code is in file LoadSequencePack.c, in the callback function handler() staring at line 36. Its main use case is for defining color cycle animations, with multiple color ranges. It can also be used to define regular sprite sequences, but since I implemented the function TLN_CreateSpriteSequence() to define an animation based on a numbered series of named sprites inside a spriteset, I haven't used .sqx anymore.
The sqx file doesn't allow to define individual delays per frame, it uses one global delay for the whole animation, just like one of the parameters of TLN_CreateSpriteSequence() expects. But you can easily set per-frame delays with TLN_SetAnimationDelay() once you have created the animation.
It only accepts delays in frames, not in seconds. It makes sense, because when you use hand-drawn animations, they're expected to run in multiples of whole frames. You cannot delay for example 1.5 frames. If you try do, you get jerky animation and the intention of the 2D artist gets lost. Of course, you can easily convert from milliseconds to frames if you know the target frame rate, in case the time domain of your game is in seconds and not in frames.
If there's somewhat standard text-based format for animations, I'd be glad to support it. Just like .tmx is "de facto" standard for tilemaps. But I don't know about a better alternative for animations, or at least I didn't know back when I defined sqx. Do you know some suitable format?
Hope to have solved your questions!