/******************************************************************************************* * * 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('../../index.js') // 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 // --------------------------------------------------------------------------------------