Update C sources, add new functions and rename package to
This commit is contained in:
parent
391c25482d
commit
08aa518a46
156 changed files with 34542 additions and 19573 deletions
|
@ -8,35 +8,35 @@ func main() {
|
|||
screenWidth := int32(800)
|
||||
screenHeight := int32(450)
|
||||
|
||||
raylib.InitWindow(screenWidth, screenHeight, "raylib [text] example - bmfont and ttf sprite fonts loading")
|
||||
rl.InitWindow(screenWidth, screenHeight, "raylib [text] example - bmfont and ttf sprite fonts loading")
|
||||
|
||||
msgBm := "THIS IS AN AngelCode SPRITE FONT"
|
||||
msgTtf := "THIS SPRITE FONT has been GENERATED from a TTF"
|
||||
|
||||
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||
fontBm := raylib.LoadFont("fonts/bmfont.fnt") // BMFont (AngelCode)
|
||||
fontTtf := raylib.LoadFont("fonts/pixantiqua.ttf") // TTF font
|
||||
fontBm := rl.LoadFont("fonts/bmfont.fnt") // BMFont (AngelCode)
|
||||
fontTtf := rl.LoadFont("fonts/pixantiqua.ttf") // TTF font
|
||||
|
||||
fontPosition := raylib.Vector2{}
|
||||
fontPosition := rl.Vector2{}
|
||||
|
||||
fontPosition.X = float32(screenWidth)/2 - raylib.MeasureTextEx(fontBm, msgBm, float32(fontBm.BaseSize), 0).X/2
|
||||
fontPosition.X = float32(screenWidth)/2 - rl.MeasureTextEx(fontBm, msgBm, float32(fontBm.BaseSize), 0).X/2
|
||||
fontPosition.Y = float32(screenHeight)/2 - float32(fontBm.BaseSize)/2 - 80
|
||||
|
||||
raylib.SetTargetFPS(60)
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
for !raylib.WindowShouldClose() {
|
||||
raylib.BeginDrawing()
|
||||
for !rl.WindowShouldClose() {
|
||||
rl.BeginDrawing()
|
||||
|
||||
raylib.ClearBackground(raylib.RayWhite)
|
||||
rl.ClearBackground(rl.RayWhite)
|
||||
|
||||
raylib.DrawTextEx(fontBm, msgBm, fontPosition, float32(fontBm.BaseSize), 0, raylib.Maroon)
|
||||
raylib.DrawTextEx(fontTtf, msgTtf, raylib.NewVector2(75.0, 240.0), float32(fontTtf.BaseSize)*0.8, 2, raylib.Lime)
|
||||
rl.DrawTextEx(fontBm, msgBm, fontPosition, float32(fontBm.BaseSize), 0, rl.Maroon)
|
||||
rl.DrawTextEx(fontTtf, msgTtf, rl.NewVector2(75.0, 240.0), float32(fontTtf.BaseSize)*0.8, 2, rl.Lime)
|
||||
|
||||
raylib.EndDrawing()
|
||||
rl.EndDrawing()
|
||||
}
|
||||
|
||||
raylib.UnloadFont(fontBm) // AngelCode Font unloading
|
||||
raylib.UnloadFont(fontTtf) // TTF Font unloading
|
||||
rl.UnloadFont(fontBm) // AngelCode Font unloading
|
||||
rl.UnloadFont(fontTtf) // TTF Font unloading
|
||||
|
||||
raylib.CloseWindow()
|
||||
rl.CloseWindow()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue