Getter and setter for font added

This commit is contained in:
JupiterRider 2023-03-25 12:27:33 +01:00
parent 61db589fe8
commit c3738608cf

View file

@ -1174,3 +1174,16 @@ func TabBar(bounds rl.Rectangle, text []string, active *int32) int32 {
}()
return int32(C.GuiTabBar(cbounds, (**C.char)(ctext.Pointer), count, &cactive))
}
// Set gui custom font (global state)
func SetFont(font rl.Font) {
cfont := (*C.Font)(unsafe.Pointer(&font))
C.GuiSetFont(*cfont)
}
// Get gui custom font (global state)
func GetFont() rl.Font {
ret := C.GuiGetFont()
ptr := unsafe.Pointer(&ret)
return *(*rl.Font)(ptr)
}