class
Diorite::FrameContext
- Diorite::FrameContext
- Reference
- Object
Overview
Context object passed into scoped frame drawing blocks (DebugDraw.frame { |d| ... }).
Provides convenient access to immediate-mode 2D and 3D drawing operations.
DebugDraw.frame do |d|
d.line_3d(start_pos, end_pos, Color.new(0, 1, 0))
d.sphere_3d(center: player.position, radius: 1.5)
d.circle_2d(Godot::Vector2.new(100, 100), 25.0)
end
Defined in:
diorite/core/dsl.crInstance Method Summary
-
#actor_card_3d(position : Godot::Vector3, title : String, stats : Hash(String, String) | Nil = nil, size : Godot::Vector2 = Godot::Vector2.new(1.2_f32, 0.8_f32), color : Godot::Color = Godot::Color.new(0.2_f32, 0.8_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D actor card billboard with anchor line and optional stats.
-
#arc_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D circular arc.
-
#arrow_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), head_size : Float32 = 10.0_f32, duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D directional arrow.
-
#arrow_3d(from : Godot::Vector3, to : Godot::Vector3, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), head_size : Float32 = 0.25_f32, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D directional arrow with a conical arrowhead.
-
#bar_chart_2d(rect : Godot::Rect2, bars : Array(BarData), horizontal : Bool = false, title : String = "", duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D bar chart or histogram.
-
#bezier_cubic_3d(p0 : Godot::Vector3, p1 : Godot::Vector3, p2 : Godot::Vector3, p3 : Godot::Vector3, segments : Int32 = 32, color : Godot::Color = Godot::Color.new(1.0_f32, 0.8_f32, 0.0_f32, 1.0_f32), show_hull : Bool = true, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D cubic Bézier curve.
-
#billboard_square_3d(center : Godot::Vector3 = Godot::Vector3.new, size : Float32 = 1.0_f32, camera_pos : Godot::Vector3 = Godot::Vector3.new, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil, position : Godot::Vector3 | Nil = nil)
Draws a camera-facing billboard square.
-
#box_3d(center : Godot::Vector3, size : Godot::Vector3, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), wireframe : Bool = true, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws an axis-aligned 3D bounding box wireframe.
-
#box_cast_3d(from : Godot::Vector3, to : Godot::Vector3, size : Godot::Vector3 = Godot::Vector3.new(1.0_f32, 1.0_f32, 1.0_f32), hit : Bool = false, color : Godot::Color = Godot::Color.new(0.0_f32, 0.9_f32, 1.0_f32, 0.8_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a swept box cast.
-
#camera_frustum_3d(origin : Godot::Vector3, basis : Godot::Basis, fov_deg : Float32 = 75.0_f32, near : Float32 = 0.05_f32, far : Float32 = 10.0_f32, aspect : Float32 = 1.777_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 0.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D camera frustum wireframe.
-
#capsule_2d(p0 : Godot::Vector2, p1 : Godot::Vector2, radius : Float32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), segments : Int32 = 12, duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D stadium capsule.
-
#capsule_3d(center : Godot::Vector3, radius : Float32 = 0.5_f32, height : Float32 = 2.0_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), segments : Int32 = 16, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D capsule wireframe.
-
#capsule_cast_3d(from : Godot::Vector3, to : Godot::Vector3, radius : Float32 = 0.5_f32, height : Float32 = 1.8_f32, hit : Bool = false, color : Godot::Color = Godot::Color.new(0.0_f32, 0.9_f32, 1.0_f32, 0.8_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a swept capsule cast.
-
#catmull_rom_3d(points : Array(Godot::Vector3), segments_per_curve : Int32 = 16, color : Godot::Color = Godot::Color.new(0.4_f32, 0.8_f32, 1.0_f32, 1.0_f32), loop : Bool = false, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D Catmull-Rom spline curve.
-
#channel(channel_name : String, &block : FrameContext -> ) : Void
Executes a block with all nested drawing commands assigned to channel_name.
-
#circle_2d(center : Godot::Vector2, radius : Float32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), segments : Int32 = 24, duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D circle on the canvas overlay.
-
#circle_3d(center : Godot::Vector3, normal : Godot::Vector3 = Godot::Vector3.new(0, 1, 0), radius : Float32 = 1.0_f32, segments : Int32 = 24, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D planar circle ring.
-
#cone_3d(tip : Godot::Vector3, dir : Godot::Vector3, length : Float32 = 5.0_f32, angle_rad : Float32 = 0.52359877_f32, segments : Int32 = 16, color : Godot::Color = Godot::Color.new(0.2_f32, 0.8_f32, 1.0_f32, 0.8_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D vision cone or spotlight frustum.
-
#cylinder_3d(center : Godot::Vector3, radius : Float32 = 1.0_f32, height : Float32 = 2.0_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), segments : Int32 = 16, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D cylinder wireframe.
-
#gauge_2d(center : Godot::Vector2, radius : Float32, value : Float32, min_val : Float32 = 0.0_f32, max_val : Float32 = 100.0_f32, title : String = "", color : Godot::Color = Godot::Color.new(0.2_f32, 0.8_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D radial gauge.
-
#gauge_3d(center : Godot::Vector3, normal : Godot::Vector3, radius : Float32, value : Float32, min_val : Float32 = 0.0_f32, max_val : Float32 = 100.0_f32, title : String = "", color : Godot::Color = Godot::Color.new(0.2_f32, 0.8_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D radial gauge.
-
#gizmo_3d(origin : Godot::Vector3, basis : Godot::Basis = Godot::Basis.new, size : Float32 = 1.0_f32, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws an RGB coordinate transform gizmo.
-
#grid_3d(origin : Godot::Vector3 = Godot::Vector3.new, size : Godot::Vector2 = Godot::Vector2.new(10.0_f32, 10.0_f32), subdivisions : Int32 = 10, color : Godot::Color = Godot::Color.new(0.6_f32, 0.6_f32, 0.6_f32, 0.5_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil, center : Godot::Vector3 | Nil = nil)
Draws a 3D ground reference grid.
-
#line_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D line segment.
-
#line_3d(from : Godot::Vector3, to : Godot::Vector3, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D line segment between two world positions.
-
#line_arrow_3d(from : Godot::Vector3, to : Godot::Vector3, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), head_size : Float32 = 0.25_f32, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a line with a terminal arrow head.
-
#line_path_3d(points : Array(Godot::Vector3), color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a continuous 3D polyline connecting an ordered list of points.
-
#obb_3d(center : Godot::Vector3, size : Godot::Vector3, basis : Godot::Basis, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), wireframe : Bool = true, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws an oriented bounding box (OBB).
-
#path_2d(points : Array(Godot::Vector2), color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a continuous 2D polyline connecting an ordered list of points.
-
#pie_chart_2d(center : Godot::Vector2, radius : Float32, slices : Array(PieSlice), inner_radius : Float32 = 0.0_f32, duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D pie or donut chart.
-
#pie_chart_3d(center : Godot::Vector3, normal : Godot::Vector3, radius : Float32, slices : Array(PieSlice), inner_radius : Float32 = 0.0_f32, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D pie or donut chart.
-
#plane_3d(center : Godot::Vector3, normal : Godot::Vector3 = Godot::Vector3.new(0.0_f32, 1.0_f32, 0.0_f32), size : Godot::Vector2 = Godot::Vector2.new(5.0_f32, 5.0_f32), color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D plane quad.
-
#points_2d(points : Array(Godot::Vector2), size : Float32 = 4.0_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws 2D points on the canvas overlay.
-
#points_3d(points : Array(Godot::Vector3), size : Float32 = 0.1_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws 3D point markers.
-
#pop_transform : Void
Pops the top 3D coordinate transform from the local transform stack.
-
#position_3d(origin : Godot::Vector3, size : Float32 = 1.0_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3-axis crossing position marker.
-
#push_transform(xform : Godot::Transform3D) : Void
Pushes a 3D coordinate transform onto the local transform stack.
-
#ray_hit_3d(from : Godot::Vector3 = Godot::Vector3.new, hit_point : Godot::Vector3 = Godot::Vector3.new, normal : Godot::Vector3 = Godot::Vector3.new, color : Godot::Color = Godot::Color.new(0.0_f32, 1.0_f32, 0.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil, origin : Godot::Vector3 | Nil = nil)
Draws a raycast collision result.
-
#rect_2d(rect : Godot::Rect2, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D wireframe rectangle.
-
#reticle_3d(position : Godot::Vector3, normal : Godot::Vector3 = Godot::Vector3.new(0, 0, 1), size : Float32 = 0.5_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 0.2_f32, 0.2_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D aiming reticle.
-
#ruler_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), tick_step : Float32 = 20.0_f32, tick_size : Float32 = 8.0_f32, duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D calibrated measuring ruler.
-
#ruler_3d(from : Godot::Vector3, to : Godot::Vector3, tick_size : Float32 = 0.2_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D distance measuring ruler.
-
#sector_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D pie-slice sector.
-
#sphere_3d(center : Godot::Vector3, radius : Float32 = 1.0_f32, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), rings : Int32 = 16, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D orthogonal ring wireframe sphere.
-
#sphere_cast_3d(from : Godot::Vector3, to : Godot::Vector3, radius : Float32 = 0.5_f32, hit : Bool = false, color : Godot::Color = Godot::Color.new(0.0_f32, 0.9_f32, 1.0_f32, 0.8_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a swept sphere cast.
-
#spring_3d(from : Godot::Vector3, to : Godot::Vector3, radius : Float32 = 0.2_f32, coils : Int32 = 8, segments : Int32 = 16, color : Godot::Color = Godot::Color.new(1.0_f32, 0.9_f32, 0.1_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D helical wire spring.
-
#stat_graph_2d(title : String, value : Number, rect : Godot::Rect2 = Godot::Rect2.new(20.0_f32, 20.0_f32, 160.0_f32, 50.0_f32), min_val : Number = 0.0, max_val : Number = 100.0, color : Godot::Color = Godot::Color.new(0.2_f32, 0.9_f32, 0.3_f32, 1.0_f32))
Renders a real-time sparkline telemetry graph.
-
#surface_disk_3d(position : Godot::Vector3, normal : Godot::Vector3, radius : Float32 = 0.5_f32, segments : Int32 = 24, color : Godot::Color = Godot::Color.new(0.0_f32, 0.8_f32, 0.9_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a circular surface contact disc.
-
#telemetry_graph_2d(title : String, value : Number, rect : Godot::Rect2 = Godot::Rect2.new(20.0_f32, 20.0_f32, 160.0_f32, 50.0_f32), min_val : Number = 0.0, max_val : Number = 100.0, color : Godot::Color = Godot::Color.new(0.2_f32, 0.9_f32, 0.3_f32, 1.0_f32))
Alias for
#stat_graph_2d. -
#text_2d(position : Godot::Vector2, text : String, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D text label on the canvas overlay.
-
#text_3d(position : Godot::Vector3, text : String, color : Godot::Color = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D billboard text label.
-
#trail_3d(id : String, current_position : Godot::Vector3, max_points : Int32 = 60, color : Godot::Color = Godot::Color.new(0.9_f32, 0.2_f32, 0.9_f32, 1.0_f32), on_top : Bool = true)
Updates a 3D motion trail.
-
#trajectory_arc_3d(origin : Godot::Vector3, velocity : Godot::Vector3, gravity : Godot::Vector3 = Godot::Vector3.new(0.0_f32, -9.8_f32, 0.0_f32), max_time : Float32 = 3.0_f32, steps : Int32 = 40, color : Godot::Color = Godot::Color.new(0.2_f32, 1.0_f32, 0.3_f32, 1.0_f32), duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a ballistic projectile trajectory arc.
-
#vision_cone_2d(origin : Godot::Vector2, dir : Godot::Vector2, distance : Float32, angle_rad : Float32, segments : Int32 = 16, color : Godot::Color = Godot::Color.new(0.0_f32, 0.9_f32, 1.0_f32, 0.8_f32), duration : Float64 = 0.0, channel : String | Nil = nil)
Draws a 2D vision cone or detection wedge.
-
#vision_cone_3d(origin : Godot::Vector3, direction : Godot::Vector3, angle_deg : Float32 = 45.0_f32, range : Float32 = 10.0_f32, color : Godot::Color = Godot::Color.new(0.0_f32, 0.9_f32, 1.0_f32, 0.8_f32), segments : Int32 = 24, duration : Float64 = 0.0, on_top : Bool = true, channel : String | Nil = nil)
Draws a 3D vision / sensory cone.
-
#with_transform(xform : Godot::Transform3D, &block) : Void
Executes a block with a local 3D transform applied to all nested 3D drawing calls.
Instance Method Detail
Draws a 3D actor card billboard with anchor line and optional stats.
Draws a 2D circular arc.
Draws a 2D directional arrow.
Draws a 3D directional arrow with a conical arrowhead.
Draws a 2D bar chart or histogram.
Draws a 3D cubic Bézier curve.
Draws a camera-facing billboard square.
Draws an axis-aligned 3D bounding box wireframe.
Draws a swept box cast.
Draws a 3D camera frustum wireframe.
Draws a 2D stadium capsule.
Draws a 3D capsule wireframe.
Draws a swept capsule cast.
Draws a 3D Catmull-Rom spline curve.
Executes a block with all nested drawing commands assigned to channel_name.
Draws a 2D circle on the canvas overlay.
Draws a 3D planar circle ring.
Draws a 3D vision cone or spotlight frustum.
Draws a 3D cylinder wireframe.
Draws a 2D radial gauge.
Draws a 3D radial gauge.
Draws an RGB coordinate transform gizmo.
Draws a 3D ground reference grid.
Draws a 2D line segment.
Draws a 3D line segment between two world positions.
Draws a line with a terminal arrow head.
Draws a continuous 3D polyline connecting an ordered list of points.
Draws an oriented bounding box (OBB).
Draws a continuous 2D polyline connecting an ordered list of points.
Draws a 2D pie or donut chart.
Draws a 3D pie or donut chart.
Draws a 3D plane quad.
Draws 2D points on the canvas overlay.
Draws 3D point markers.
Draws a 3-axis crossing position marker.
Pushes a 3D coordinate transform onto the local transform stack.
Draws a raycast collision result.
Draws a 2D wireframe rectangle.
Draws a 3D aiming reticle.
Draws a 2D calibrated measuring ruler.
Draws a 3D distance measuring ruler.
Draws a 2D pie-slice sector.
Draws a 3D orthogonal ring wireframe sphere.
Draws a swept sphere cast.
Draws a 3D helical wire spring.
Renders a real-time sparkline telemetry graph.
Draws a circular surface contact disc.
Alias for #stat_graph_2d.
Draws a 2D text label on the canvas overlay.
Draws a 3D billboard text label.
Updates a 3D motion trail.
Draws a ballistic projectile trajectory arc.
Draws a 2D vision cone or detection wedge.
Draws a 3D vision / sensory cone.
Executes a block with a local 3D transform applied to all nested 3D drawing calls.