Merge pull request #252 from JupiterRider/master

Getter and setter for font added
This commit is contained in:
Milan Nikolic 2023-04-04 10:18:41 +02:00 committed by GitHub
commit 22ca1484d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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))
}
// SetFont - set custom font (global state)
func SetFont(font rl.Font) {
cfont := (*C.Font)(unsafe.Pointer(&font))
C.GuiSetFont(*cfont)
}
// GetFont - get custom font (global state)
func GetFont() rl.Font {
ret := C.GuiGetFont()
ptr := unsafe.Pointer(&ret)
return *(*rl.Font)(ptr)
}