defDragon

Defold DragonBones extension. Alpha release.

The extension now works on Windows, HTML5, Linux. Linux tested indirectly on Windows by bundling.

The latest release is 0.6

Defold example project: defDragon Example

Live example: HTML5 Example

Todo

  • Reduce draw calls :check_box_with_check:
  • Culling :check_box_with_check:
  • Projection :check_box_with_check:

DragonBonesPro 09_04_2026

18 Likes

Simple example showing basic usage. The game.project dependency should be updated to point to latest tag release.

defDragon example 2.zip (89.4 KB)

dmengine_X2cXwohmLy

11 Likes

Cool! A lot of people wanted DragonBones to work! Thank you for sharing!

Sadly, I tried to run it, and there is a type error in line 459 of script_dragonbones.cpp:

/dragonbones/src/script_dragonbones.cpp
	Line 459: format specifies type 'int' but the argument has type 'size_type' (aka 'unsigned long') [-Werror,-Wformat]
  458 |                 dmLogInfo("onDrawFrame: Skipping slot '%s' due to empty buffers or texture ID 0 (vertices: %d, indices: %d)",
      |                                                                                                            ~~
      |                                                                                                            %zu
  459 |                     slot->getName().c_str(), openglSlot->vertices.size(), openglSlot->indices.size());
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~

and:

/dragonbones/src/script_dragonbones.cpp
	Line 459: format specifies type 'int' but the argument has type 'size_type' (aka 'unsigned long') [-Werror,-Wformat]
  458 |                 dmLogInfo("onDrawFrame: Skipping slot '%s' due to empty buffers or texture ID 0 (vertices: %d, indices: %d)",
      |                                                                                                                         ~~
      |                                                                                                                         %zu
  459 |                     slot->getName().c_str(), openglSlot->vertices.size(), openglSlot->indices.size());
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~

Exported data not properly loaded is my guess. Please try my updated example. I am on Windows 10. Maybe it’s the platform?

1 Like

Ah, maybe. Same with ver 2. I’m on Ubuntu, but I’ll try on Windows.

Definitely it’s platform, there are errors with HTML5. HTML5 is fixed. The latest release is 0.0.4

1 Like

As far as it goes, I consider this project done.

Defold Wishlist

  • go.property(“file1”, resource.file()) - A way of picking arbitrary files like JSON.
  • mesh indices. It will reduce the number of resources used.
  • Tutorial on creating simple custom component. In my opinion, spine and rive extensions are too complex to be understood by reading the source.

Lessons

  • Using meshes, buffer
  • Interfacing with external libraries

Minor bug? I don’t know

 --mtx_test is vertex constant user matrix4
 go.set("#mesh", hash("mtx_test"), vmath.matrix4())
 -- error below: Invalid index 2 for property 'mtx_test'
 print(go.get("#mesh", hash("mtx_test"))) 
5 Likes

Vote up: Add option for indexed vertices for buffers to be used with the mesh component. · Issue #5477 · defold/defold · GitHub

For the files references as property, it’s an interesting idea. I didn’t find any similar issue though, so it’s worth creating it!

There is some discussion that might be relevant somehow here:

2 Likes

Added to the Asset Portal:

2 Likes

Never say never. Updated to version 0.5. Go transform now apply to armature. No need to manually update with dragonbones.move and co.

The updated sample.

The early sample :joy:

2 Likes

Added feature request.

2 Likes