Repository navigation
Expand file tree
/
Copy pathcore_basic_window.js
More file actions
46 lines (36 loc) · 1.65 KB
/
Copy pathcore_basic_window.js
File metadata and controls
46 lines (36 loc) · 1.65 KB
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
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2018 Rob Loach (@RobLoach)
*
********************************************************************************************/
const r = require('raylib')
// Initialization
//--------------------------------------------------------------------------------------
var screenWidth = 800
var screenHeight = 450
r.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
r.SetTargetFPS(60)
//--------------------------------------------------------------------------------------
// Main game loop
while (!r.WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
r.BeginDrawing()
r.ClearBackground(r.RAYWHITE)
r.DrawText("Congrats! You created your first window!", 190, 200, 20, r.LIGHTGRAY)
r.EndDrawing()
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
r.CloseWindow() // Close window and OpenGL context
//--------------------------------------------------------------------------------------