-
Notifications
You must be signed in to change notification settings - Fork 20
/
core_basic_window.js
45 lines (35 loc) · 1.64 KB
/
core_basic_window.js
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
/*******************************************************************************************
*
* 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
// --------------------------------------------------------------------------------------
const screenWidth = 800
const 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 node-raylib window!', 120, 200, 20, r.LIGHTGRAY)
r.EndDrawing()
// ----------------------------------------------------------------------------------
}
// De-Initialization
// --------------------------------------------------------------------------------------
r.CloseWindow() // Close window and OpenGL context
// --------------------------------------------------------------------------------------