twuky / raylib-4.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

raylib-4.0

node-addon-api test with binding https://github.com/raysan5/raylib

Usage

Import Module:

import * as raylib from 'raylib-4.0'

Import CommonJS:

const raylib = require('raylib-4.0')

Your First Window

let screenWidth = 800
let screenHeight = 450 

raylib.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")

raylib.SetTargetFPS(60)

while(!raylib.WindowShouldClose()) {
  raylib.BeginDrawing()
    raylib.ClearBackground(raylib.RAYWHITE)
    raylib.DrawText("Congrats! You created your first window!", 190, 200, 20, raylib.LIGHTGRAY)
  raylib.EndDrawing()
}

raylib.CloseWindow()

Other Usage Details

Not all raylib functions are currently working or enabled. Read on unsupported_functions.md for more details.

Installing

While in development this package is not available on NPM You can currently install the library through github:

npm i https://github.com/twuky/raylib-4.0

Development

NPM Scripts:

generate: Reads raylib API JSON and generates Cpp bindings and TS Definitions.

test: Runs tests for the package.

benchmark: Runs an example "Bunnymark" benchmark.

About


Languages

Language:C 66.2%Language:C++ 27.9%Language:TypeScript 3.0%Language:JavaScript 2.5%Language:CMake 0.3%Language:GLSL 0.2%