Skip to content
/ fyr Public

A wrapper/helper to work with raylib-zig (by Not-Nik)

License

Notifications You must be signed in to change notification settings

zewenn/fyr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fyr

fyr is a custom zig-based wrapper of Not-Nik's raylib-zig; containing an entity component system, asset loading, automatic rendering and many more features...

Important

This project is still very much under development, take care when using! Contributions are welcome.

Add the fyr library

You are only a couple of easy steps away fromm building your dream project:

  1. Run the following command to save the dependency:

    zig fetch --save git+https://github.com/zewenn/fyr#stable
  2. Add the following to your build.zig:

    const fyr_module = b.dependency("fyr", .{
        .target = target,
        .optimize = optimize,
    });
    
    const fyr = fyr_module.module("fyr");
    
    exe.root_module.addImport("fyr", fyr);
  3. You are ready to go! Now you can import fyr with a regular zig @import():

    const fyr = @import("fyr");

Project Setup

Setting up a project with fyr is so easy, even your grandma could do it 😄

Note

You can follow the documentation, or take a look at the demo project

// This handles the entire program, from start to finish
// All your code must be configured within these blocks
fyr.project({
    // This block will run before initalising the raylib window
    // Great place to configure default behaviours

    // Set the title of the window
    fyr.title("fyr-demo");
    // Resize to 720p
    fyr.winSize(fyr.Vec2(1280, 720));

    // Set the path of the debug assets dir
    fyr.useAssetDebugPath("./src/demo/assets/");
})({
    // This codeblock will run after the initalisation, but before the loop
    // Code here is used to configure scenes, entities, scripts and uis

    // Create the "default" scene, fyr will auto load the scene with this id
    fyr.scene("default")({
        // This block is used to configure the scene itself

        // Adding entities for example
        fyr.entities(.{
            try Player(),
            try Box(),
        });
    });
});

About

A wrapper/helper to work with raylib-zig (by Not-Nik)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published