From 8e21086fe14b13497969f1d655664a01816a0a81 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Sat, 27 Aug 2022 18:42:04 +0200 Subject: [PATCH] Update examples --- examples/core/mouse_wheel/main.go | 4 ++-- examples/go.mod | 10 +++++----- examples/physics/chipmunk/main.go | 4 ++-- examples/textures/image_text/main.go | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/core/mouse_wheel/main.go b/examples/core/mouse_wheel/main.go index 288dfff..d1071e7 100644 --- a/examples/core/mouse_wheel/main.go +++ b/examples/core/mouse_wheel/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -18,7 +18,7 @@ func main() { rl.SetTargetFPS(60) for !rl.WindowShouldClose() { - boxPositionY -= rl.GetMouseWheelMove() * scrollSpeed + boxPositionY -= int32(rl.GetMouseWheelMove()) * scrollSpeed rl.BeginDrawing() diff --git a/examples/go.mod b/examples/go.mod index 323900e..466bea3 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -3,10 +3,10 @@ module examples go 1.16 require ( - github.com/gen2brain/raylib-go/easings v0.0.0-20220323230550-c878e5c98a96 - github.com/gen2brain/raylib-go/physics v0.0.0-20220323230550-c878e5c98a96 - github.com/gen2brain/raylib-go/raygui v0.0.0-20220323230550-c878e5c98a96 - github.com/gen2brain/raylib-go/raylib v0.0.0-20220323230550-c878e5c98a96 - github.com/jakecoffman/cp v1.1.0 + github.com/gen2brain/raylib-go/easings v0.0.0-20220827153754-6e090424c541 + github.com/gen2brain/raylib-go/physics v0.0.0-20220827153754-6e090424c541 + github.com/gen2brain/raylib-go/raygui v0.0.0-20220827153754-6e090424c541 + github.com/gen2brain/raylib-go/raylib v0.0.0-20220827153754-6e090424c541 + github.com/jakecoffman/cp v1.2.1 github.com/neguse/go-box2d-lite v0.0.0-20170921151050-5d8ed9b7272b ) diff --git a/examples/physics/chipmunk/main.go b/examples/physics/chipmunk/main.go index 08e59d3..ac6c911 100644 --- a/examples/physics/chipmunk/main.go +++ b/examples/physics/chipmunk/main.go @@ -5,7 +5,7 @@ import ( "math" "math/rand" - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" "github.com/jakecoffman/cp" ) @@ -85,7 +85,7 @@ func main() { for !rl.WindowShouldClose() { // calculate dt now := rl.GetTime() - dt = now - lastTime + dt = float32(now - lastTime) lastTime = now // update the mouse position diff --git a/examples/textures/image_text/main.go b/examples/textures/image_text/main.go index b416442..9905150 100644 --- a/examples/textures/image_text/main.go +++ b/examples/textures/image_text/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/gen2brain/raylib-go/raylib" + rl "github.com/gen2brain/raylib-go/raylib" ) func main() { @@ -11,8 +11,7 @@ func main() { rl.InitWindow(screenWidth, screenHeight, "raylib [textures] example - image text drawing") // TTF Font loading with custom generation parameters - var fontChars int32 - font := rl.LoadFontEx("fonts/KAISG.ttf", 64, &fontChars, 0) + font := rl.LoadFontEx("fonts/KAISG.ttf", 64, nil) parrots := rl.LoadImage("parrots.png") // Load image in CPU memory (RAM)