Problem with rectangles and circles!

A while ago I tried to switch between diferent screens, coloring them in plain colors to see if they really changed. After seeing it worked I tried to apply it to the pong game we're developing in class, and it caused the ball to disappear. We could solve the problem using "ClearBackground(BLACK);" to paint that screen constantly black, but now, I want to apply a scrolling texture and it gives me the same problem: I can't see the ball anymore and I was wondering if it was my fault or it was the same kind of "bug" from raylib!

Any help solving the problem will be appreciated!



  • In case anyone was wondering, my Draw looks like this:


    DrawTexture(background, scroll, 0, RAYWHITE);
    DrawTexture(background, screenWidth + scroll, 0, RAYWHITE);

    DrawRectangleRec(player, RAYWHITE);
    DrawRectangleRec(playerTop, GREEN);
    DrawRectangleRec(playerBot, RED);
    DrawRectangleRec(enemy, RAYWHITE);

    DrawCircleV(ballPosition, ballRadius, RAYWHITE);
  • Hello Choli,

    That's a raylib known bug and it has already been corrected for next version.

    At this moment, quads-based shapes (rectangle, textures) are always drawn over triangle-based shapes (circle, poly).

    As a temporal solution, you can use a texture with a circle. I know is far from ideal but I hope to release new raylib version soon... maybe on christmas...
Sign In or Register to comment.