diff options
-rw-r--r-- | src/ui_implementation.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui_implementation.odin b/src/ui_implementation.odin index 7c5f9e3..594e5a1 100644 --- a/src/ui_implementation.odin +++ b/src/ui_implementation.odin @@ -88,7 +88,7 @@ button :: proc(text: string, width: int, selected := false) -> Item { Text_Alignment :: enum int { Left, Right, - Center + Center, } label :: proc(text: string, font: rl.Font, alignment: Text_Alignment = .Left) -> Item { item := oui.item_make() @@ -97,6 +97,7 @@ label :: proc(text: string, font: rl.Font, alignment: Text_Alignment = .Left) -> data.subtype = .Label data.text = text data.font_size = font.baseSize // This should not be necesssary + data.font = font data.alignment = alignment return item @@ -135,7 +136,7 @@ ui_draw :: proc(item: oui.Item) { // For some reason, data.font.baseSize == 0 here. It doesn't outside of this function. Dunno why. font_height := f32(data.font_size) - + rl.DrawTextEx(data.font, strings.unsafe_string_to_cstring(data.text), { 0, 0 }, font_height, 0.0, rl.RAYWHITE); //rl.DrawTextEx(rl.GetFontDefault(), strings.unsafe_string_to_cstring(data.text), { 0, 0 }, 40, 0, rl.WHITE); //rl.DrawFPS(0, 0) |