class

PointClickEngine::Graphics::UI::TextRenderer

Inherits Reference < Object

Text rendering with advanced features

Constants

DEFAULT_FONT_SIZE = 20

Default font size

Constructors

new(font : RL::Font | Nil = nil, font_size : Int32 = DEFAULT_FONT_SIZE)
Source

Instance methods

cleanup

Cleanup

Source
color

Text properties

Source
color=(color : RL::Color)

Text properties

Source
draw(text : String, x : Float32, y : Float32, align : TextAlign = TextAlign::Left, v_align : VerticalAlign = VerticalAlign::Top)

Draw text at position

Source
draw_gradient(text : String, x : Float32, y : Float32, start_color : RL::Color, end_color : RL::Color, vertical : Bool = false)

Draw text with fade gradient

Source
draw_in_box(text : String, box : RL::Rectangle, h_align : TextAlign = TextAlign::Center, v_align : VerticalAlign = VerticalAlign::Middle, clip : Bool = true)

Draw text in a box

Source
draw_shake(text : String, x : Float32, y : Float32, intensity : Float32 = 2.0_f32)

Draw text with shake effect

Source
draw_typewriter(text : String, x : Float32, y : Float32, progress : Float32, align : TextAlign = TextAlign::Left)

Draw typewriter effect

Source
draw_wave(text : String, x : Float32, y : Float32, amplitude : Float32 = 5.0_f32, frequency : Float32 = 0.1_f32, time : Float32 = 0.0_f32)

Draw text with wave effect

Source
draw_wrapped(text : String, x : Float32, y : Float32, max_width : Float32, align : TextAlign = TextAlign::Left, line_spacing : Float32 = 1.2_f32)

Draw text with word wrap

Source
enable_shadow
Source
enable_shadow=(enable_shadow : Bool)
Source
font

Font data

Source
font=(font : RL::Font | Nil)

Font data

Source
font_size
Source
font_size=(font_size : Int32)
Source
load_font(path : String, size : Int32 = DEFAULT_FONT_SIZE)

Load font from file

Source
max_width
Source
max_width=(max_width : Float32)
Source
measure_text(text : String) : RL::Vector2

Measure text dimensions

Source
outline_color
Source
outline_color=(outline_color : RL::Color)
Source
outline_thickness
Source
outline_thickness=(outline_thickness : Int32)
Source
shadow_color
Source
shadow_color=(shadow_color : RL::Color)
Source
shadow_offset
Source
shadow_offset=(shadow_offset : RL::Vector2)
Source
spacing
Source
spacing=(spacing : Float32)
Source
word_wrap

Word wrap

Source
word_wrap=(word_wrap : Bool)

Word wrap

Source
wrap_text(text : String, max_width : Float32) : Array(String)

Wrap text to fit within max width

Source