examples: Use decl literals (#221)

This commit is contained in:
Mike Will 2025-03-12 16:21:15 -04:00 committed by GitHub
parent 03ec79ef85
commit d4fc514d54
Failed to generate hash of commit
37 changed files with 323 additions and 323 deletions

View file

@ -59,49 +59,49 @@ pub fn main() anyerror!void {
// NOTE: Texture is scaled twice its size
rl.drawTextureEx(
background,
rl.Vector2.init(scrolling_back, 20.0),
.init(scrolling_back, 20.0),
0.0,
2.0,
rl.Color.white,
.white,
);
rl.drawTextureEx(
background,
rl.Vector2.init(@as(f32, @floatFromInt(background.width * 2)) + scrolling_back, 20),
.init(@as(f32, @floatFromInt(background.width * 2)) + scrolling_back, 20),
0.0,
2.0,
rl.Color.white,
.white,
);
// Draw midground image twice
rl.drawTextureEx(
midground,
rl.Vector2.init(scrolling_mid, 20.0),
.init(scrolling_mid, 20.0),
0.0,
2.0,
rl.Color.white,
.white,
);
rl.drawTextureEx(
midground,
rl.Vector2.init(@as(f32, @floatFromInt(midground.width * 2)) + scrolling_mid, 20),
.init(@as(f32, @floatFromInt(midground.width * 2)) + scrolling_mid, 20),
0.0,
2.0,
rl.Color.white,
.white,
);
// Draw foreground image twice
rl.drawTextureEx(
foreground,
rl.Vector2.init(scrolling_fore, 70.0),
.init(scrolling_fore, 70.0),
0.0,
2.0,
rl.Color.white,
.white,
);
rl.drawTextureEx(
foreground,
rl.Vector2.init(@as(f32, @floatFromInt(foreground.width * 2)) + scrolling_fore, 70),
.init(@as(f32, @floatFromInt(foreground.width * 2)) + scrolling_fore, 70),
0.0,
2.0,
rl.Color.white,
.white,
);
rl.drawText(
@ -109,14 +109,14 @@ pub fn main() anyerror!void {
10,
10,
20,
rl.Color.red,
.red,
);
rl.drawText(
"(c) Cyberpunk Street Environment by Luis Zuno (@ansimuz)",
screen_width - 330,
screen_height - 20,
10,
rl.Color.ray_white,
.ray_white,
);
}
}