2024-01-21 10:35:52 -08:00
|
|
|
package sectr
|
|
|
|
|
2024-01-22 00:47:53 -08:00
|
|
|
import "core:unicode/utf8"
|
2024-01-21 10:35:52 -08:00
|
|
|
import rl "vendor:raylib"
|
|
|
|
|
2024-02-10 00:40:53 -08:00
|
|
|
debug_text :: proc( content : string, pos : Vec2, size : f32 = 16.0, color : rl.Color = rl.WHITE, font : rl.Font = {} )
|
2024-01-21 10:35:52 -08:00
|
|
|
{
|
|
|
|
if len( content ) == 0 {
|
|
|
|
return
|
|
|
|
}
|
2024-01-21 20:38:02 -08:00
|
|
|
runes := utf8.string_to_runes( content, context.temp_allocator )
|
2024-01-21 10:35:52 -08:00
|
|
|
|
2024-01-22 00:47:53 -08:00
|
|
|
font := font
|
|
|
|
if ( font.chars == nil ) {
|
2024-01-29 22:29:48 -08:00
|
|
|
font = get_state().default_font
|
2024-01-22 00:47:53 -08:00
|
|
|
}
|
|
|
|
|
2024-01-21 10:35:52 -08:00
|
|
|
rl.DrawTextCodepoints( font,
|
|
|
|
raw_data(runes), cast(i32) len(runes),
|
2024-02-10 00:40:53 -08:00
|
|
|
position = transmute(rl.Vector2) pos,
|
2024-01-21 10:35:52 -08:00
|
|
|
fontSize = size,
|
|
|
|
spacing = 0.0,
|
|
|
|
tint = color );
|
|
|
|
}
|