| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
PHP bindings for raylib, a simple and easy-to-use library to learn videogames programming.
It’s developed using PHP-CPP, so it’s called raylib-phpcpp.
<?php
InitWindow(800, 450, "raylib [core] example - basic window");
SetTargetFPS(60);
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE());
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY());
EndDrawing();
}
CloseWindow();See more examples.
Run
mkdir build && cd build
cmake ..
make -j$(nproc)Then you have libraylib-phpcpp.so in build directory.
| C | raylib-phpcpp |
|---|---|
| WindowShouldClose() | WindowShouldClose() |
| InitWindow(800, 450, “title”) | InitWindow(800, 450, “title”) |
| C | raylib-phpcpp |
|---|---|
| LIGHTGRAY | LIGHTGRAY() |
| GREEN | GREEN() |
| C | raylib-phpcpp |
|---|---|
| FLAG_SHOW_LOGO | RL_FLAG_SHOW_LOGO |
| KEY_COMMA | RL_KEY_COMMA |
<?php
$offset = Vector2(1, 1);
$target = Vector2(0, 0);
$camera = Camera2D($offset, $target, 1.0, 1.0);
<?php
$v = Vector2(1, 2);
// $v->x += 1; doesn't work
$v->x = $v->x + 1;
$camera = Camera2D(Vector2(1, 1), Vector2(0, 0), 1.0, 1.0);
// $camera->target->x = 1; // doesn't work
$target = $camera->target;
$target->x = 1;
$camera->target = $target;
| raylib-phpcpp | PHP |
|---|---|
| ImageCopy | gd extension |
| ImageCrop | gd extension |
You should disable gd extension while exploring raylib :)
TBD.
| Function |
|---|
| GetDroppedFiles |
| ImageExtractPalette |
| LoadModelAnimations |
| LoadMeshes |
| LoadMaterials |
Most functions and features are supported.
For most file and text functions, you can use counterparts in PHP.
raylib-phpcpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check LICENSE for further details.
| Back | FazBrowse Home | New Git URL |