Godot DragonBones 3.2.51 released! (Patch Notes)
- Paul Mauviel
- Aug 10, 2020
- 1 min read
I'm glad to say that I've just released a newer version of the binaries which includes all the recent work put into swapping slot displays.
Tutorial content coming soon enough; however here are the patch notes and related pull requests
Patch Notes
Patch feature: Slot Swapping
You can now specify multiple children in the slots of your Dragonbones projects and switch between them at will at runtime. This enables a much greater level of customization.

New Functions
bool has_slot(const String &_slot_name) const; Color get_slot_display_color_multiplier(const String &_slot_name); void set_slot_display_color_multiplier(const String &_slot_name, const Color &_color); void set_slot_display_index(const String &_slot_name, int _index = 0); int get_slot_display_index(const String &_slot_name); int get_total_items_in_slot(const String &_slot_name); void cycle_next_item_in_slot(const String &_slot_name); void cycle_previous_item_in_slot(const String &_slot_name); void set_slot_by_item_name(const String &_slot_name, const String &_item_name); void set_all_slots_by_item_name(const String &_item_name);
Demo Code
extends Node2D onready var dragonbones_sprite = $Character onready var color_picker = $CanvasLayer/ColorPickerButton # Called when the node enters the scene tree for the first time. func _ready(): dragonbones_sprite.set_slot_display_index("slot_head", -1) dragonbones_sprite.set_slot_display_index("slot_face", -1) dragonbones_sprite.set_slot_display_index("slot_chest", -1) dragonbones_sprite.set_slot_display_index("slot_hip", -1) pass # Replace with function body. func next_in_slot(slot_name : String): dragonbones_sprite.cycle_next_item_in_slot(slot_name) pass
OTHER THINGS
API Change:
func _handle animation_event(animation_name, ev_name) has new signature so you can now receive data from your events: func _handle animation_event(animation_name, ev_name, _int : int, _float : float, _string : string)
Bug fixes:
Duplicating in-editor now works.
Known Bugs:
Replacing resource file in-editor will not remove the old armature.
WORK AROUND: Duplicate the node with the wrong armature and delete the original. Alternatively, you can close / reopen the scene
Related PRs:
https://github.com/mauville-technologies/godot_dragonbones/pull/7
https://github.com/mauville-technologies/godot_dragonbones/pull/9
https://github.com/mauville-technologies/godot_dragonbones/pull/11
https://github.com/mauville-technologies/godot_dragonbones/pull/12
댓글