In-game property inspector for Godot 4.4+
- Bool
- Int
- Float
- String, StringName
- Color
- Vector2, Vector2i
- Vector3, Vector3i
- Enum
- Flags
- Typed/Untyped Arrays and PackedArrays
- Dictionary
- Category, Group and Subgroup
git clone
this repository toaddons
folder.- Enabled
Object Inspector
in Plugins.
- Add
ObjectInspector
node to the scene. - Apply the example theme to the
ObjectInspector
node. - Call
set_object
method. - Done!
# Some script.gd...
@onready var inspector: Inspector = $Inspector # Path to our inspector in a tree.
func _ready() -> void:
# Some object that we get from some method.
var object: Object = get_object()
# Sets our object to our inspector.
inspector.set_object(object)
# Some script.gd...
static func _static_init() -> void:
Inspector.add_description("ClassName", "some_value", "Property description.")
# Validation method must return `true` if the property can be handled. Example:
static func can_handle(object: Object, property: Dictionary, editable: bool) -> bool:
return property["type"] == TYPE_FLOAT
# Constructor method must return an object of class `Control`.
static func create_control(object: Object, property: Dictionary, editable: bool, setter: Callable, getter: Callable) -> Control:
var spin_box := SpinBox.new()
spin_box.set_editable(editable)
spin_box.set_value_no_signal(getter.call())
# Assign custom property description.
spin_box.set_tooltip_text(Inspector.get_object_property_description(object, property["name"]))
spin_box.value_changed.connect(setter)
return spin_box
# Some script.gd...
# Declare custom property handler.
static func _static_init() -> void:
InspectorProperty.declare_property(can_handle, create_control)
Copyright (c) 2022-2024 Mansur Isaev and contributors
Unless otherwise specified, files in this repository are licensed under the MIT license. See LICENSE.md for more information.