SCML Parser is a tool to import Spriter .scml animations directly into Defold as .collection files.
You can install SCMLParser as a dependency in your project by doing the following:
-
In Defold, open your
game.project. -
Go to the Projects tab, under Dependencies, and click the + button.
-
Replace the
https://url.to/libraryfield withhttps://github.com/EVEVGames/SCMLParser/archive/refs/heads/main.zip -
Save the project (important!).
-
From the menu, select Project → Fetch Libraries.
-
Put your
.scmlfile and all associated animation images in a dedicated folder inside your Defold project assets.
⚠️ Important: Use a dedicated folder to avoid overwriting existing files. -
Right-click the
.scmlfile in the Assets panel. -
Click "Parse SCML".
-
A new
.collection, a.script, and an.atlaswill be generated in the same folder.
If files with the same names exist, they will be overwritten. -
Done! You can now delete the
.scmlfile if you want.
Simply add the generated.collectionto your game scene.
The generated collection has a script attached with properties.
These include the initial animation to play and whether it should auto-play.
Adjust these as needed, or uncheck "Play" to disable auto-start.
You can control the animation using Defold’s message system:
-
Play an animation:
msg.post("your_collection_name", "run_animation", { animation = "animation_name", loop = false })
-
Stop the current animation:
msg.post("your_collection_name", "cancel_animation")
-
Get available animations and respond to the sender as array:
msg.post("your_collection_name", "list_animations")
-
Get available character maps and respond to the sender as array:
msg.post("your_collection_name", "list_character_maps")
-
Apply a sequence of character maps:
msg.post("your_collection_name", "apply_character_maps", {"myCharmap1", "Charmap 2", --[[...]] })
-
Reset all character maps:
msg.post("your_collection_name", "reset_character_maps")
You can also instantiate multiple instances of the generated collection using Defold’s collectionfactory. Refer to the Defold documentation for more details.
This is an initial but functional version of SCML Parser. Bugs and limitations may exist — please report any issues with as much detail as possible.
This project is licensed under the MIT License. See the LICENSE file for details.