Convert return values

This commit is contained in:
Not-Nik 2023-07-11 18:58:07 +02:00
parent d07552a064
commit 3f046d9db7
Failed to generate hash of commit
10 changed files with 316 additions and 190 deletions

View file

@ -39,8 +39,7 @@ pub fn main() anyerror!void {
rl.clearBackground(rl.Color.ray_white);
rl.drawCircle(@floatToInt(i32, ballPosition.x), @floatToInt(i32, ballPosition.y), 50, ballColor);
//DrawCircleV(ballPosition, 40, ballColor);
rl.drawCircleV(ballPosition, 40, ballColor);
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.dark_gray);

View file

@ -1,6 +1,7 @@
// raylib-zig (c) Nikolas Wipper 2023
const rl = @import("raylib");
const std = @import("std");
pub fn main() anyerror!void {
// Initialization
@ -32,7 +33,8 @@ pub fn main() anyerror!void {
rl.drawRectangle(screenWidth / 2 - 40, @floatToInt(i32, boxPositionY), 80, 80, rl.Color.maroon);
rl.drawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, rl.Color.gray);
//rl.drawText(rl.textFormat("Box position Y: %03i", .{@floatToInt(c_int, boxPositionY)}), 10, 40, 20, rl.Color.light_gray);
rl.drawText(rl.textFormat("Box position Y: %03i", .{@floatToInt(c_int, boxPositionY)}), 10, 40, 20, rl.Color.light_gray);
rl.endDrawing();
//----------------------------------------------------------------------------------

View file

@ -67,7 +67,7 @@ pub fn main() anyerror!void {
// Draw circle and touch index number
rl.drawCircleV(touchPosition, 34, rl.Color.orange);
//rl.drawText(rl.textFormat("%d", .{i}), @floatToInt(c_int, touchPosition.x) - 10, @floatToInt(c_int, touchPosition.y) - 70, 40, rl.Color.black);
rl.drawText(rl.textFormat("%d", .{i}), @floatToInt(c_int, touchPosition.x) - 10, @floatToInt(c_int, touchPosition.y) - 70, 40, rl.Color.black);
}
}

View file

@ -59,7 +59,7 @@ pub fn main() anyerror!void {
rl.drawText("Shader-based\ntexture\noutline", 10, 10, 20, rl.Color.gray);
//rl.drawText(rl.textFormat("Outline size: %i px", @floatToInt(i32, outlineSize)), 10, 120, 20, rl.Color.maroon);
rl.drawText(rl.textFormat("Outline size: %i px", @floatToInt(i32, outlineSize)), 10, 120, 20, rl.Color.maroon);
rl.drawFPS(710, 10);

View file

@ -69,7 +69,7 @@ pub fn main() anyerror!void {
rl.drawRectangleLines(15 + @floatToInt(i32, frameRec.x), 40 + @floatToInt(i32, frameRec.y), @floatToInt(i32, frameRec.width), @floatToInt(i32, frameRec.height), rl.Color.red);
rl.drawText("FRAME SPEED: ", 165, 210, 10, rl.Color.dark_gray);
//rl.drawText(rl.textFormat("%02i FPS", .{framesSpeed}), 575, 210, 10, rl.Color.DARKGRAY);
rl.drawText(rl.textFormat("%02i FPS", .{framesSpeed}), 575, 210, 10, rl.Color.DARKGRAY);
rl.drawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, rl.Color.dark_gray);
for ([_]u32{0} ** MAX_FRAME_SPEED) |_, i| {