Giter Site home page Giter Site logo

godot-target-inspector's Introduction

godot-target-inspector

An easy-to-use inspector control for Godot Engine based on Tree

Screenshot of TargetInspector (2021-04-04-001)

Features

  • TargetInspector custom tree control
  • Set inspection target by assigning any object to inspector.target
  • Set inspection target by assigning a NodePath to inspector.target_path
  • Indexed properties work on targets specified as a NodePath (e.g. /root/Game:player:inventory)
  • Automatic two-way data binding
  • Event-driven updates if the target has a changed signal
  • Polling-driven updates if event-driven isn't available
  • Supported types
    • Node and Resource (embedded/nested objects)
    • float (supports ranges, but all three of min, max, step must be specified)
    • int (supports ranges, but all three of min, max, step must be specified)
    • String
    • bool (soon)
    • Vectors, Rect2, and other built-in dimensional types (soon)

Usage

In addition to setting the exported target_path property within the Godot editor, there are several ways to set the target in GDScript:

inspector.set_target(document)
inspector.set_target(self, "document.baz")
inspector.target_path = "%s:document" % [get_path()]

The UI works by creating a "virtual DOM" of Node objects which are mirrored by a Tree and its TreeNode objects. One of the reasons this project was created was to avoid the hassle of Tree working differently from everything else in Godot.

Because of this design, it's straightforward to query and modify target properties being watched by the inspector. Here's the easiest way to directly modify a value:

inspector.set_inspector_node("foo", 5.1)

And these are all equivalent methods of getting an inspector node:

var fizz = inspector.get_inspector_node("baz.fizz")
var fizz = inspector.get_inspector_node("baz:fizz")
var fizz = inspector.get_inspector_node("baz/fizz")
var fizz = inspector.root.get_node("baz").get_node("fizz")
if fizz:
    fizz.set_value(1337.5)

Author

Brian Jorgensen

License

MIT

godot-target-inspector's People

Contributors

b33j0r avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.