mirror of https://github.com/mode777/rayjs.git
52 lines
2.1 KiB
JavaScript
52 lines
2.1 KiB
JavaScript
/*******************************************************************************************
|
|
*
|
|
* raylib [shapes] example - Draw raylib logo using basic shapes
|
|
*
|
|
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
|
*
|
|
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
* BSD-like license that allows static linking with closed source software
|
|
*
|
|
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
|
*
|
|
********************************************************************************************/
|
|
// Initialization
|
|
//--------------------------------------------------------------------------------------
|
|
const screenWidth = 800;
|
|
const 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(RAYWHITE);
|
|
|
|
drawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
|
|
drawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, GOLD);
|
|
drawText("rayjs", screenWidth/2 - 38, screenHeight/2 + 48, 50, BLACK);
|
|
|
|
drawText("this is NOT a texture!", 350, 370, 10, GRAY);
|
|
|
|
endDrawing();
|
|
//----------------------------------------------------------------------------------
|
|
}
|
|
|
|
// De-Initialization
|
|
//--------------------------------------------------------------------------------------
|
|
closeWindow(); // Close window and OpenGL context
|
|
//--------------------------------------------------------------------------------------
|
|
|