mauville-technologies / godot_dragonbones

Plugin module for Godot 2.1 & Godot 3 Game Engine to use DragonBones
MIT License
85 stars 13 forks source link

Child armatures #17

Closed Ozzadar closed 3 years ago

Ozzadar commented 3 years ago

New animation event for supporting child armatures:

        Dictionary dict = Dictionary();

        dict[String("armature")] = String(armature->getName().c_str());
        dict[String("animation")] = String(_p_value->animationState->name.c_str());
        dict[String("event_name")] = String(_p_value->name.c_str());
        dict[String("int")] = int_val;
        dict[String("float")] = float_val;
        dict[String("string")] = string_val;

        emit_signal("dragon_anim_event", dict);

This was the original design wiki, which no longer applies: https://github.com/mauville-technologies/godot_dragonbones/wiki/Feature:-Nested-Dragonbones-Projects

Ozzadar commented 3 years ago

I'm taking a deep think on this now. It's close but the way this is done falls down with:

Hoping to think up a structure that makes sense to do this. Once this is complete, I think the next step is to try to get the entire structure to show up in Godot at least to some degree; or at least referenceable in GDScript ( think sprite.get_node("ChildArmatureSlot").get_armature().play_animation("") type calls

Ozzadar commented 3 years ago

The thoughts I had above have been fleshed out.

You now access your various components through:

sprite.get_armature().get_slot("gun").get_child_armature().play("fire") sprite.get_armature().get_slot("gun").get_child_armature().set_display_by_name("greenGun")

etc.. This allows for unlimited armature nesting.

iamge

Ozzadar commented 3 years ago

Working on producing builds; if all goes well I can mark this as ready and release builds will be produced when 3.2.3 is released (which I think they want to do ASAP) so I can build on top of it

Ozzadar commented 3 years ago

I'm maintaining a live demo project to test/demonstrate all the features here:

https://mauville-technologies.github.io/godot_dragonbones_tutorial/

Ozzadar commented 3 years ago

This has been built, tested and released: https://www.godotdragonbones.com/godot-dragonbones-3-2

Live Demo has been updated with more stuff as well