Animation start
This commit is contained in:
parent
c739f34581
commit
f1a30d050c
2 changed files with 138 additions and 12 deletions
12
utils.odin
12
utils.odin
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue