Raylib - Drawing shapes














































Raylib - Drawing shapes



/*

 There are many number of shapes and figures we can draw in raylib like circle,rectangle,square,ellipse etc.
 There are many things we can draw in our file. Go to the following link to check out more about the shapes   and stuff in raylib : https://www.raylib.com/cheatsheet/cheatsheet.html
 
 This is a program to draw shapes in the pop-up window using raylib.  
*/

#include"raylib.h"

int main(){
    
    //screen dimensions
    int windowHeight = 500;
    int windowWidth = 1000;
    
    
    InitWindow(windowWidth,windowHeight,"YOUR NEW GAME");
    SetTargetFPS(120);
    
    //circle dimensions
    int circle_x = 200;
    int circle_y = 150;
    int circle_radius = 100;
    
    //rectangle dimensions
    int rec_x = 0;
    int rec_y = 0;
    int rec_height = 50;
    int rec_width = 100;
    
    
    while(WindowShouldClose()==false){
        BeginDrawing();
        
        //draws a circle
        DrawCircle(circle_x,circle_y,circle_radius,RED);
        
        //draws a rectangle
        DrawRectangle(rec_x,rec_y,rec_width,rec_height,BLUE);
        
        
        ClearBackground(LIGHTGRAY);
        EndDrawing();
    }
    
}





Comments