add more Rectangle methods
add rlDisableBackfaceCulling
update for zig 0.13
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)
.
Although this library is designed to be used with Zig's "package manager", Raylib itself isn't, so I don't know a way to depend on it by URL. What you can do is use it by path: check out this repository at a path like raylib
(including its submodule), and put this in your build.zig.zon
:
.dependencies = .{
.raylib = .{
.path = "raylib",
},
},
And this in your build.zig
:
const raylib = b.dependency("raylib", .{
.target = target,
.optimize = optimize,
});
your_exe.root_module.addImport("raylib", raylib.module("raylib"));
Full list of methods I added:
Vector2.add
Vector2.subtract
Vector2.multiply
Vector2.divide
Vector2.scale
Vector2.distance
Vector2.rotate
Vector2.moveTowards
Vector2.normalize
Vector2.angle
Vector2.angleTo
Rectangle.topleft
Rectangle.center
Rectangle.size
Rectangle.right
Rectangle.bottom
Rectangle.topright
Rectangle.bottomleft
Rectangle.bottomright
Rectangle.containsPoint
Rectangle.overlaps
Rectangle.overlapRect
Rectangle.containsRect
Rectangle.closestPointTo
Rectangle.overlapsCircle
Rectangle.add
Rectangle.subtract
Rectangle.expand
Rectangle.fromTopleftAndSize
Rectangle.fromCenterAndSize
Rectangle.fromTwoPoints
I also added bindings for a few rlgl functions. See rlgl.zig
.