~yujiri/raylib-zig

add Rectangle.overlaps
update raylib
update readme

refs

devel
browse  log 

clone

read-only
https://git.sr.ht/~yujiri/raylib-zig
read/write
git@git.sr.ht:~yujiri/raylib-zig

You can also use your local clone with git send-email.

Fork of https://github.com/Not-Nik/raylib-zig. I restructured and simplified the library, and added methods to some types so instead of, for example, raylib.Vector2Add(a, b), you can write a.add(b). To use this library, put something like this in your build.zig:

const raylib = @import("raylib-zig/raylib/src/build.zig");

pub fn build(b: *Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});
    // ...
    const raylib_mod = b.addModule("raylib", .{
        .source_file = .{ .path = "raylib-zig/binding.zig" },
    });
    // ...
    your_exe.addModule("raylib", raylib_mod);
    your_exe.linkLibrary(raylib.addRaylib(b, target, optimize, .{}));

Full list of methods I added:

  • Vector2.add
  • Vector2.subtract
  • Vector2.scale
  • Vector2.distance
  • Vector2.rotate
  • Vector2.moveTowards
  • Vector2.normalize
  • Vector2.angle
  • Vector2.angleTo
  • Rectangle.topleft
  • Rectangle.center
  • Rectangle.right
  • Rectangle.bottom
  • Rectangle.containsPoint
  • Rectangle.overlaps