-
Notifications
You must be signed in to change notification settings - Fork 1
/
shapes_logo_raylib.php
56 lines (43 loc) · 1.93 KB
/
shapes_logo_raylib.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
use Nawarian\Raylib\Types\Color;
use function Nawarian\Raylib\{
BeginDrawing,
ClearBackground,
CloseWindow,
DrawRectangle,
DrawText,
EndDrawing,
InitWindow,
SetTargetFPS,
WindowShouldClose
};
require_once __DIR__ . '/../../vendor/autoload.php';
// Initialization
//--------------------------------------------------------------------------------------
$screenWidth = 800;
$screenHeight = 450;
InitWindow($screenWidth, $screenHeight, 'raylib [shapes] example - raylib logo using shapes');
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) { // Detect window close button or ESC key
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(Color::rayWhite());
DrawRectangle($screenWidth / 2 - 128, $screenHeight / 2 - 128, 256, 256, Color::black());
DrawRectangle($screenWidth / 2 - 112, $screenHeight / 2 - 112, 224, 224, Color::rayWhite());
DrawText('raylib', (int) ($screenWidth / 2 - 44), (int) ($screenHeight / 2 + 48), 50, Color::black());
DrawText('this is NOT a texture!', 350, 370, 10, Color::gray());
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------