SectrPrototype/code/text.odin
Ed_ f76ba4e9ba Lots of stuff (Big ones are cam and frame initial features)
There is now a 2D camera in the workspace!
We have a basic 'Frame' definition. It doesn't have any interaction yet...

I started to define spacial math, mostly for doing conversion and getting a grounding on pixel/points/cm reference. The world space is in cm.
2024-02-10 03:40:53 -05:00

25 lines
551 B
Odin

package sectr
import "core:unicode/utf8"
import rl "vendor:raylib"
debug_text :: proc( content : string, pos : Vec2, size : f32 = 16.0, color : rl.Color = rl.WHITE, font : rl.Font = {} )
{
if len( content ) == 0 {
return
}
runes := utf8.string_to_runes( content, context.temp_allocator )
font := font
if ( font.chars == nil ) {
font = get_state().default_font
}
rl.DrawTextCodepoints( font,
raw_data(runes), cast(i32) len(runes),
position = transmute(rl.Vector2) pos,
fontSize = size,
spacing = 0.0,
tint = color );
}