Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Bindora is a reactive data binding library for Godot 4.x. Based on Godot's design philosophy, it provides a declarative and component-based approach to help you manage relationships between nodes and data.
Bindora
Bindora is a reactive data binding library for Godot 4.x. Based on Godot's design philosophy, it provides a declarative and component-based approach to help you manage relationships between nodes and data.
Core Features
Reactive Data System
- Provides the
Refclass as the base data type - Supports multiple data types
- Supports serialization and deserialization
- Automatic type conversion and checking
- Provides lifecycle hooks
Comprehensive Binding Support
- Text binding -
TextBinding - Input binding -
InputBinding - Radio button binding -
RadioBinding - Checkbox binding -
CheckBoxBinding - Property binding -
PropertyBinding - Display binding -
ShowBinding - Shader binding -
ShaderBinding - Toggle binding -
ToggleBinding - List binding -
ListBinding - Theme override binding -
ThemeOverrideBinding - Custom binding -
CustomBinding
Data Monitoring
- Provides the
Watcherclass for data monitoring - Supports single and multi-value monitoring
- Supports custom callback functions
Quick Start
Installing Bindora
Copy the bindora folder into your Godot project.
Basic Usage
Create a Label node and set its text to "Text is {{value}}". Then add a script to the node with the following code:
extends Label
# Declare data
var text_ref = RefString.new("Hello World")
# Create text binding
text_ref.bind_text(self)
# Create a watcher
text_ref.create_watcher(func(watcher,new_value):
print("Text changed to: ", new_value)
)
# Wait for a while
await get_tree().create_timer(3.0).timeout
# Modify data
text_ref.value = "New Text"
# Or
text_ref.set_value("New Text") # Using set_value is recommended as it includes type checking
The Ref class provides many convenient binding methods, which you can explore in the API Reference.
Using ReactiveResource
Create a resource class that extends ReactiveResource and declare Ref variables within it.
Note:
Refvariables declared inReactiveResourcedo not need to be exported with@export. They are automatically handled and exported upon declaration. Using@exportmay cause unexpected errors.
class MyResource extends ReactiveResource:
var text_ref = RefString.new("Hello World")
Using RefArray in combination.
var packed_scene = preload("res://path/to/your/packed_scene.tscn")
var array = RefArray.new()
array.bind_list($Container, packed_scene, func(item, data , index):
data.text_ref.bind_text(item)
)
for i in 3:
var new_item = MyResource.new()
new_item.text_ref.set_value("Item " + i)
array.append(new_item)
API Reference
Basic Variable Types - RefVariant
RefBool, RefInt, RefFloat, RefString, RefVector2, RefVector2i, RefVector3, RefVector3i, RefVector4, RefVector4i, RefRect2, RefRect2i, RefColor
Binding methods:
- bind_text(_node: CanvasItem, _property: String = "value",_template: String = "") -> TextBinding
- bind_input(_node: CanvasItem, _property: String = "") -> InputBinding
- bind_multi_input(_dict: Dictionary[CanvasItem, String]) -> Dictionary[CanvasItem, InputBinding]
- bind_property(_node: CanvasItem, _property: String, _use_node_data: bool = false) -> PropertyBinding
- bind_multi_property(_dict: Dictionary[CanvasItem, String]) -> Dictionary[CanvasItem, PropertyBinding]
- bind_radios(_nodes: Array[CanvasItem]) -> Dictionary[CanvasItem, RadioBinding]
- bind_radios_custom(_dict: Dictionary[CanvasItem, String]) -> Dictionary[CanvasItem, RadioBinding]
- bind_shader(_node: CanvasItem, _property: String) -> ShaderBinding
- bind_show(_node: CanvasItem, _callable: Callable) -> ShowBinding
- bind_theme_override(_node: CanvasItem, _property: String) -> ThemeOverrideBinding
- bind_toggle(_node: CanvasItem, _opposite: bool = false) -> ToggleBinding
- bind_multi_toggle(_dict: Dictionary[CanvasItem, bool]) -> Dictionary[CanvasItem, ToggleBinding]
Special Types
- bind_text(_node: CanvasItem, _keyword: String = "value", _template: String = "") -> TextBinding
- bind_check_boxes(_nodes: Array[CanvasItem]) -> Dictionary[CanvasItem, CheckBoxBinding]
- bind_check_boxes_custom(_dict: Dictionary[CanvasItem, String]) -> Dictionary[CanvasItem, CheckBoxBinding]
- bind_list(_parent: Node, _packed_scene: PackedScene, _callable: Callable) -> ListBinding
- bind_text(_node: CanvasItem, _template: String = "") -> TextBinding
Resource Types - RefResource
RefFontRefLabelSettingsRefMaterialRefStyleBox
Contributing
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
License
Bindora is an open-source project under the MIT license.
Bindora is a reactive data binding library for Godot 4.x. Based on Godot's design philosophy, it provides a declarative and component-based approach to help you manage relationships between nodes and data.
Reviews
Quick Information
Bindora is a reactive data binding library for Godot 4.x. Based on Godot's design philosophy, it provides a declarative and component-based approach to help you manage relationships between nodes and data.