Skip to content

secjoa/SCMLParser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCML Parser

SCML Parser is a tool to import Spriter .scml animations directly into Defold as .collection files.

Defold Status License


📦 Installation

You can install SCMLParser as a dependency in your project by doing the following:

  1. In Defold, open your game.project.

  2. Go to the Projects tab, under Dependencies, and click the + button.

  3. Replace the https://url.to/library field with

    https://github.com/EVEVGames/SCMLParser/archive/refs/heads/main.zip
    
  4. Save the project (important!).

  5. From the menu, select Project → Fetch Libraries.


🚀 How to Use

  1. Put your .scml file and all associated animation images in a dedicated folder inside your Defold project assets.
    ⚠️ Important: Use a dedicated folder to avoid overwriting existing files.

  2. Right-click the .scml file in the Assets panel.

  3. Click "Parse SCML".

  4. A new .collection, a .script, and an .atlas will be generated in the same folder.
    If files with the same names exist, they will be overwritten.

  5. Done! You can now delete the .scml file if you want.
    Simply add the generated .collection to your game scene.


⚙️ Script Properties

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.


💬 Messages

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.


🧪 Status

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.


📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Import Spriter .scml Animations into a Defold .collection File

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Lua 100.0%