Convert return values
This commit is contained in:
parent
d07552a064
commit
3f046d9db7
10 changed files with 316 additions and 190 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue