Update enum/const name style
This commit is contained in:
parent
e29e012981
commit
7e95ad81b5
12 changed files with 741 additions and 741 deletions
|
|
@ -11,7 +11,7 @@ pub fn main() anyerror!void {
|
|||
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||
|
||||
var ballPosition = rl.Vector2.init(-100, -100);
|
||||
var ballColor = rl.Color.BEIGE;
|
||||
var ballColor = rl.Color.beige;
|
||||
|
||||
var touchCounter: f32 = 0;
|
||||
var touchPosition = rl.Vector2.init(0, 0);
|
||||
|
|
@ -25,25 +25,25 @@ pub fn main() anyerror!void {
|
|||
//----------------------------------------------------------------------------------
|
||||
ballPosition = rl.getMousePosition();
|
||||
|
||||
ballColor = rl.Color.BEIGE;
|
||||
ballColor = rl.Color.beige;
|
||||
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
||||
ballColor = rl.Color.MAROON;
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.mouse_button_left)) {
|
||||
ballColor = rl.Color.maroon;
|
||||
}
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
||||
ballColor = rl.Color.LIME;
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.mouse_button_middle)) {
|
||||
ballColor = rl.Color.lime;
|
||||
}
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
||||
ballColor = rl.Color.DARKBLUE;
|
||||
if (rl.isMouseButtonDown(rl.MouseButton.mouse_button_right)) {
|
||||
ballColor = rl.Color.dark_blue;
|
||||
}
|
||||
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.mouse_button_left)) {
|
||||
touchCounter = 10;
|
||||
}
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.mouse_button_middle)) {
|
||||
touchCounter = 10;
|
||||
}
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
||||
if (rl.isMouseButtonPressed(rl.MouseButton.mouse_button_right)) {
|
||||
touchCounter = 10;
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ pub fn main() anyerror!void {
|
|||
//----------------------------------------------------------------------------------
|
||||
rl.beginDrawing();
|
||||
|
||||
rl.clearBackground(rl.Color.RAYWHITE);
|
||||
rl.clearBackground(rl.Color.ray_white);
|
||||
|
||||
const nums = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
for (nums) |i| {
|
||||
|
|
@ -66,16 +66,16 @@ pub fn main() anyerror!void {
|
|||
if ((touchPosition.x >= 0) and (touchPosition.y >= 0)) {
|
||||
|
||||
// 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.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);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the normal mouse location
|
||||
rl.drawCircleV(ballPosition, 30 + (touchCounter * 3), ballColor);
|
||||
|
||||
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.DARKGRAY);
|
||||
rl.drawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, rl.Color.DARKGRAY);
|
||||
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.dark_gray);
|
||||
rl.drawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, rl.Color.dark_gray);
|
||||
|
||||
rl.endDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue