Got window setup & basic text to window space debug.

This commit is contained in:
2024-01-21 13:35:52 -05:00
parent 85ac6a1d55
commit d0c016a355
8 changed files with 262 additions and 129 deletions

23
code/text.odin Normal file
View File

@ -0,0 +1,23 @@
package sectr
import "core:unicode/utf8"
import rl "vendor:raylib"
font_rec_mono_semicasual_reg : rl.Font;
default_font : rl.Font
debug_text :: proc( content : string, x, y : f32, size : f32 = 16.0, color : rl.Color = rl.WHITE, font : rl.Font = default_font )
{
if len( content ) == 0 {
return
}
runes := utf8.string_to_runes( content )
rl.DrawTextCodepoints( font,
raw_data(runes), cast(i32) len(runes),
position = rl.Vector2 { x, y },
fontSize = size,
spacing = 0.0,
tint = color );
}