class

PointClickEngine::Graphics::Utils::BitmapFont

Inherits Reference < Object

Bitmap font loader and manager

Constructors

load(font_path : String) : BitmapFont

Load font from Raylib font file

Source
load_custom(texture_path : String, data_path : String) : BitmapFont

Load font from custom format (JSON-like)

Source
load_grid(texture_path : String, char_width : Int32, char_height : Int32, first_char : Char = ' ', chars_per_row : Int32 = 16) : BitmapFont

Load font from sprite sheet with fixed grid

Source
new(texture : RL::Texture2D, base_size : Int32, line_height : Int32)
Source

Instance methods

add_glyph(char : Char, x : Int32, y : Int32, width : Int32, height : Int32, advance : Float32)

Add custom character mapping

Source
base_size
Source
base_size=(base_size : Int32)
Source
char_width(char : Char) : Float32

Get character width

Source
cleanup

Cleanup

Source
clone

Clone font with different settings

Source
draw(text : String, x : Float32, y : Float32, color : RL::Color = RL::WHITE)

Draw text

Source
draw_scaled(text : String, x : Float32, y : Float32, scale : Float32, color : RL::Color = RL::WHITE)

Draw text with scale

Source
glyphs
Source
glyphs=(glyphs : Hash(Char, Glyph))
Source
has_char?(char : Char) : Bool

Check if font has a specific character

Source
line_height
Source
line_height=(line_height : Int32)
Source
line_spacing
Source
line_spacing=(line_spacing : Float32)
Source
measure(text : String) : RL::Vector2

Measure text dimensions

Source
spacing

Common spacing

Source
spacing=(spacing : Float32)

Common spacing

Source
texture

Font metadata

Source
texture=(texture : RL::Texture2D)

Font metadata

Source

Nested types