Animation start

This commit is contained in:
Synthasmagoria 2026-08-16 14:09:14 +02:00
commit f1a30d050c
2 changed files with 138 additions and 12 deletions

View file

@ -20,7 +20,7 @@ write_entire_file :: proc(name: string, data: []byte, truncate := true) -> (succ
return _write_entire_file(name, data, truncate)
}
/// ### RAYLIB TEXT DRAWING ### ///
/// ### RAYLIB DRAWING UTILS ### ///
measure_text :: proc(text: cstring, style: FontStyle) -> v2 {
return rl.MeasureTextEx(style.font, text, style.size, style.spacing)
}
@ -29,6 +29,16 @@ draw_text :: proc(text: cstring, position: v2, style: FontStyle, color: rl.Color
rl.DrawTextEx(style.font, text, position, style.size, style.spacing, color)
}
draw_grid :: proc(area: rect2, line_interval: v2, color: rl.Color) {
br := rect_get_br(area)
for x := area.x; x < br.x; x += line_interval.x {
rl.DrawLineV({x, area.y}, {x, br.y}, color)
}
for y := area.y; y < br.y; y += line_interval.y {
rl.DrawLineV({area.x, y}, {br.x, y}, color)
}
}
TextHalign :: enum {
Left,
Middle,