// // Circle screen transition effect (CLEAN) // // Draw a circle on the screen but draw from the edges of this circle // to the edges of the screen. // // #include "raylib.h" void circletransition(int r, int screenWidth, int screenHeight, Color col); int main(void) { // Initialization //-------------------------------------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib example."); SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- int radius = 0; int state = 0; // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- if(state==0 && radius0){ radius-=10; }else{ state = 0; } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); for(int y=0;y= 0; --x) { if ((x * x) + (y * y) <= (radius * radius)) { DrawLine(0,yc-y,xc-x,yc-y,col); DrawLine(0,yc+y,xc-x,yc+y,col); DrawLine(xc+x,yc-y,screenWidth,yc-y,col); DrawLine(xc+x,yc+y,screenWidth,yc+y,col); largestX = x; break; // go to next y coordinate } } } }