Fixup for rl 3.7
This commit is contained in:
parent
a8d8d4b9bc
commit
004388133b
7 changed files with 23 additions and 24 deletions
|
|
@ -69,7 +69,7 @@ pub fn main() anyerror!void
|
|||
camera.rotation = Clamp(camera.rotation, -40, 40);
|
||||
|
||||
// Camera zoom controls
|
||||
camera.zoom += @intToFloat(f32, GetMouseWheelMove() * @floatToInt(c_int, 0.05));
|
||||
camera.zoom += GetMouseWheelMove() * 0.05;
|
||||
|
||||
camera.zoom = Clamp(camera.zoom, 0.1, 3.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ pub fn main() anyerror!void
|
|||
|
||||
InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||
|
||||
var boxPositionY: i32 = screenHeight / 2 - 40;
|
||||
var scrollSpeed: i32 = 4; // Scrolling speed in pixels
|
||||
var boxPositionY: f32 = screenHeight / 2 - 40;
|
||||
var scrollSpeed: f32 = 4; // Scrolling speed in pixels
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
@ -36,10 +36,10 @@ pub fn main() anyerror!void
|
|||
|
||||
ClearBackground(WHITE);
|
||||
|
||||
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON);
|
||||
DrawRectangle(screenWidth/2 - 40, @floatToInt(c_int, boxPositionY), 80, 80, MAROON);
|
||||
|
||||
DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY);
|
||||
DrawText(FormatText("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY);
|
||||
DrawText(FormatText("Box position Y: %03i", @floatToInt(c_int, boxPositionY)), 10, 40, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue