mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-08 03:27:28 +00:00
New logo (example)
This commit is contained in:
parent
e25a3e070a
commit
9c5197bad4
15
build.zig
15
build.zig
@ -55,16 +55,21 @@ pub fn build(b: *Builder) void {
|
||||
.path = "examples/core/3d_camera_first_person.zig",
|
||||
.desc = "Simple first person demo",
|
||||
},
|
||||
.{
|
||||
.name = "texture_outline",
|
||||
.path = "examples/shaders/texture_outline.zig",
|
||||
.desc = "Uses a shader to create an outline around a sprite",
|
||||
},
|
||||
.{
|
||||
.name = "logo_raylib",
|
||||
.path = "examples/shapes/logo_raylib.zig",
|
||||
.desc = "Renders the raylib-zig logo",
|
||||
},
|
||||
.{
|
||||
.name = "sprite_anim",
|
||||
.path = "examples/textures/sprite_anim.zig",
|
||||
.desc = "Animate a sprite",
|
||||
},
|
||||
.{
|
||||
.name = "texture_outline",
|
||||
.path = "examples/shaders/texture_outline.zig",
|
||||
.desc = "Uses a shader to create an outline around a sprite",
|
||||
}
|
||||
// .{
|
||||
// .name = "models_loading",
|
||||
// .path = "examples/models/models_loading.zig",
|
||||
|
40
examples/shapes/logo_raylib.zig
Normal file
40
examples/shapes/logo_raylib.zig
Normal file
@ -0,0 +1,40 @@
|
||||
// raylib-zig (c) Nikolas Wipper 2023
|
||||
|
||||
const rl = @import("raylib");
|
||||
|
||||
pub fn main() anyerror!void {
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const screenWidth = 800;
|
||||
const screenHeight = 450;
|
||||
|
||||
rl.initWindow(screenWidth, screenHeight, "raylib-zig [shapes] example - raylib logo using shapes");
|
||||
defer rl.closeWindow(); // Close window and OpenGL context
|
||||
|
||||
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
const raylib_zig = rl.Color.init(247, 164, 29, 255);
|
||||
|
||||
// Main game loop
|
||||
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
// TODO: Update your variables here
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
rl.beginDrawing();
|
||||
defer rl.endDrawing();
|
||||
|
||||
rl.clearBackground(rl.Color.ray_white);
|
||||
|
||||
rl.drawRectangle(screenWidth / 2 - 128, screenHeight / 2 - 128, 256, 256, raylib_zig);
|
||||
rl.drawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, rl.Color.ray_white);
|
||||
rl.drawText("raylib-zig", screenWidth / 2 - 96, screenHeight / 2 + 57, 41, raylib_zig);
|
||||
|
||||
rl.drawText("this is NOT a texture!", 350, 370, 10, rl.Color.gray);
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
BIN
logo/logo.png
BIN
logo/logo.png
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
logo/logo.xcf
BIN
logo/logo.xcf
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user