module Lapis::Docs::GENERAL::NODES

Overview

Diorite Scene Node System

Using Diorite's exported Node3D and Node2D classes for in-editor placement and persistent hierarchy visualization.

Overview

In addition to the immediate-mode Frame DSL, Diorite provides concrete Node classes that integrate directly with Godot's Scene Tree, Inspector, and in-editor gizmo system. Nodes can be added in the Godot Editor or instantiated via code, providing persistent visual indicators that follow spatial parent transformations.

Key Topics

Topic Description
3D Shape Nodes DebugLine3D, DebugArrow3D, DebugBox3D, DebugSphere3D, DebugCylinder3D, DebugCapsule3D, DebugVisionCone3D, DebugAxes3D, DebugGrid3D, DebugSpring3D, DebugRuler3D.
2D Shape Nodes DebugLine2D, DebugArrow2D, DebugRect2D, DebugCircle2D.

Code Examples

Adding a Debug Box to a Scene

box = Diorite::DebugBox3D.new
box.box_size = Godot::Vector3.new(2, 2, 2)
box.color = Godot::Color.new(0, 1, 0, 1)
box.wireframe = true
add_child(box)

Adding a Debug Vision Cone to an AI Actor

cone = Diorite::DebugVisionCone3D.new
cone.cone_angle = 75.0_f32
cone.cone_range = 15.0_f32
cone.color = Godot::Color.new(1, 0.2, 0.2, 0.8)
npc.add_child(cone)

Pitfalls & Best Practices

Frequently Asked Questions

Defined in:

docs/general/nodes.cr

Class Method Summary

Class Method Detail

def self.example_01_adding_debug_box : Nil #

Example: Adding a Debug Box to a Scene

box = Diorite::DebugBox3D.new
box.box_size = Godot::Vector3.new(2, 2, 2)
box.color = Godot::Color.new(0, 1, 0, 1)
box.wireframe = true
add_child(box)

[View source]
def self.example_02_adding_debug_vision_cone : Nil #

Example: Adding a Debug Vision Cone to an AI Actor

cone = Diorite::DebugVisionCone3D.new
cone.cone_angle = 75.0_f32
cone.cone_range = 15.0_f32
cone.color = Godot::Color.new(1, 0.2, 0.2, 0.8)
npc.add_child(cone)

[View source]
def self.topic_01_3d_shape_nodes : Nil #

3D Shape Nodes: DebugLine3D, DebugArrow3D, DebugBox3D, DebugSphere3D, DebugCylinder3D, DebugCapsule3D, DebugVisionCone3D, DebugAxes3D, DebugGrid3D, DebugSpring3D, DebugRuler3D.


[View source]
def self.topic_02_2d_shape_nodes : Nil #

2D Shape Nodes: DebugLine2D, DebugArrow2D, DebugRect2D, DebugCircle2D.


[View source]