2
0

raylib_shapes.c 3.5 KB

123456789101112131415161718192021222324252627282930
  1. // Basic shapes drawing functions
  2. void DrawPixel(int posX, int posY, Color color); // Draw a pixel
  3. void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
  4. void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
  5. void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
  6. void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
  7. void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
  8. void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
  9. void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
  10. void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
  11. void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
  12. void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle
  13. void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
  14. void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
  15. void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle
  16. void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline
  17. void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
  18. void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points
  19. void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines
  20. // Basic shapes collision detection functions
  21. bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
  22. bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
  23. bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
  24. Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
  25. bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
  26. bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
  27. bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle