struct Diorite::FrameBatchBuilder2D

Overview

Ergonomic 2D immediate batch builder writing directly into a FrameLineBatch2D carved out of Lapis::Core::FrameArena.

Defined in:

diorite/core/frame_arena_batch.cr

Constant Summary

DEFAULT_COLOR = Godot::Color.new(1.0_f32, 1.0_f32, 1.0_f32, 1.0_f32)

Constructors

Instance Method Summary

Constructor Detail

def self.new(batch : FrameLineBatch2D) #

def self.wrap(batch : FrameLineBatch2D) : FrameBatchBuilder2D #

Instance Method Detail

def arc(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = DEFAULT_COLOR) : self #

def arc_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = DEFAULT_COLOR) : self #

def arrow(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR, head_size : Float32 = 10.0_f32) : self #

def arrow_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR, head_size : Float32 = 10.0_f32) : self #

def bar_chart(r : Godot::Rect2, bars : Array(BarData), horizontal : Bool = false) : self #

def bar_chart_2d(r : Godot::Rect2, bars : Array(BarData), horizontal : Bool = false) : self #

def batch : FrameLineBatch2D #

def capsule(p0 : Godot::Vector2, p1 : Godot::Vector2, radius : Float32, color : Godot::Color = DEFAULT_COLOR, segments : Int32 = 12) : self #

def capsule_2d(p0 : Godot::Vector2, p1 : Godot::Vector2, radius : Float32, color : Godot::Color = DEFAULT_COLOR, segments : Int32 = 12) : self #

def circle(center : Godot::Vector2, radius : Float32, color : Godot::Color = DEFAULT_COLOR, segments : Int32 = 24) : self #

def circle_2d(center : Godot::Vector2, radius : Float32, color : Godot::Color = DEFAULT_COLOR, segments : Int32 = 24) : self #

def colors : Slice(Godot::Color) #

def cols : ArenaVertexBuffer(Godot::Color) #

def gauge(center : Godot::Vector2, radius : Float32, value : Float32, min_val : Float32 = 0.0_f32, max_val : Float32 = 100.0_f32, color : Godot::Color = DEFAULT_COLOR) : self #

def gauge_2d(center : Godot::Vector2, radius : Float32, value : Float32, min_val : Float32 = 0.0_f32, max_val : Float32 = 100.0_f32, color : Godot::Color = DEFAULT_COLOR) : self #

def line(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR) : self #

def line_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR) : self #

def line_count : Int32 #

def path(pts, color : Godot::Color = DEFAULT_COLOR) : self #

def path_2d(pts, color : Godot::Color = DEFAULT_COLOR) : self #

def pie_chart(center : Godot::Vector2, radius : Float32, slices : Array(PieSlice), inner_radius : Float32 = 0.0_f32) : self #

def pie_chart_2d(center : Godot::Vector2, radius : Float32, slices : Array(PieSlice), inner_radius : Float32 = 0.0_f32) : self #

def points(pts, size : Float32 = 4.0_f32, color : Godot::Color = DEFAULT_COLOR) : self #

def points_2d(pts, size : Float32 = 4.0_f32, color : Godot::Color = DEFAULT_COLOR) : self #

def rect(r : Godot::Rect2, color : Godot::Color = DEFAULT_COLOR) : self #

def rect_2d(r : Godot::Rect2, color : Godot::Color = DEFAULT_COLOR) : self #

def ruler(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR, tick_step : Float32 = 20.0_f32, tick_size : Float32 = 8.0_f32) : self #

def ruler_2d(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color = DEFAULT_COLOR, tick_step : Float32 = 20.0_f32, tick_size : Float32 = 8.0_f32) : self #

def sector(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = DEFAULT_COLOR) : self #

def sector_2d(center : Godot::Vector2, radius : Float32, start_angle : Float32, end_angle : Float32, segments : Int32 = 24, color : Godot::Color = DEFAULT_COLOR) : self #

def telemetry_graph(graph : TelemetryGraph) : self #

def vertex_count : Int32 #

def vertices : Slice(Godot::Vector2) #

def verts : ArenaVertexBuffer(Godot::Vector2) #

def vision_cone(origin : Godot::Vector2, dir : Godot::Vector2, distance : Float32, angle_rad : Float32, segments : Int32 = 16, color : Godot::Color = DEFAULT_COLOR) : self #

def vision_cone_2d(origin : Godot::Vector2, dir : Godot::Vector2, distance : Float32, angle_rad : Float32, segments : Int32 = 16, color : Godot::Color = DEFAULT_COLOR) : self #