How andresit1524/vector_display_2d works
What this project is (type + purpose)
So your “system” is not a web service; it’s a Godot addon module composed of:
• Editor integration layer (registering the plugin, adding the node type, handling shortcut)
• Runtime node/component layer (the actual node drawing vectors in-game)
• Configuration/presets layer (Resource for settings/presets)
• Demo content (example scenes/assets to show usage)
Read the file tree as architecture
From the tree:
• addons/vector_display_2d/plugin.cfg
Godot plugin manifest: tells Godot “this is an editor plugin”, name, script entrypoint, etc.
• addons/vector_display_2d/plugin.gd
EditorPlugin script: registers/unregisters custom types, may install input actions/shortcuts, and wires editor tooling.
• addons/vector_display_2d/vector_display_2d.gd
The core VectorDisplay2D Node implementation: binds to a target node + property (Vector2), draws it, applies settings, responds to toggle visibility.
• addons/vector_display_2d/vector_display_settings.gd
• addons/vector_display_2d/vector_display_functions.gd
Shared pure functions / utilities: vector math, arrowhead geometry, drawing helpers—used by the node and possibly by settings validation.
• addons/vector_display_2d/display_shortcut.tres
A Resource storing the shortcut binding; user edits it in the editor to change the toggle key.
• demo_content/
Non-core: sample scenes/images (README references demo.png, demo_2.png) to demonstrate the addon.
This is a classic Godot addon layout: plugin entrypoint + node script + resource + helpers + editor-configurable assets.
Godot host environment (external container)
• Godot Editor (4.0+)
• Godot Runtime/Game (4.0+)
These are “external systems” your addon plugs into.
Addon package (your system)
Inside a boundary labeled addons/vector_display_2d:
Editor Plugin Layer
• plugin.cfg (Plugin Manifest)
• plugin.gd (EditorPlugin: registers node type, installs shortcut resource, editor integration)
Runtime Node Layer
• vector_display_2d.gd (VectorDisplay2D Node: draws vectors in 2D)
Configuration / Presets Layer
• vector_display_settings.gd (VectorDisplay2DSettings Resource: parameters + preset saving)
Utilities Layer
• vector_display_functions.gd (math/drawing/arrowhead helpers)
Input/Shortcut Asset
• display_shortcut.tres (toggle visibility shortcut definition)
User project integration points (other “actors”)
Outside the addon boundary:
• User Scene Tree (their game scenes)
• Target Node (any node with a Vector2 property, e.g., player with velocity: Vector2)
• Property Binding (the chosen property name/path)
• demo_content as “Example Scenes/Assets” connected to addon usage.
Godot Editor → plugin.cfg
• “discovers plugin metadata”
Godot Editor → plugin.gd
• “loads EditorPlugin on enable”
plugin.gd → Godot Editor APIs
• “register custom type: VectorDisplay2D”
• “expose node in Create Node dialog”
• (optionally) “register shortcut/action using display_shortcut.tres”
plugin.gd → display_shortcut.tres
• “reads shortcut resource / installs binding”
• and “user edits this resource in editor”
User Scene → VectorDisplay2D Node (vector_display_2d.gd)
• “node exists in scene tree; configured with target + property”
VectorDisplay2D → Target Node
• “reads Vector2 property each frame / on process”
• This is the key dependency: VectorDisplay2D is an observer of another node’s state.
VectorDisplay2D → vector_display_functions.gd
• “uses helper math to compute line/arrowhead geometry, scaling, transformations”
Input event (Shift+V) → VectorDisplay2D visibility state
• “toggles display on/off”
• Source of truth for the binding is display_shortcut.tres (edited in editor), but effect occurs at runtime.
Left: Godot Editor
• display_shortcut.tres editable in editor
Center: Addon boundary (addons/vector_display_2d)
• VectorDisplay2D + VectorDisplay2DSettings + vector_display_functions together as runtime core
• keep plugin.* slightly separated as editor-only
Right: User Project
• User Scene Tree containing VectorDisplay2D
• Target Node with velocity: Vector2 (example)