From 7f446f52b77b61e8c40507b3ebea32b909c3eb3a Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:34:55 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README_ZH.md diff --git a/README_ZH.md b/README_ZH.md new file mode 100644 index 0000000..3004b41 --- /dev/null +++ b/README_ZH.md @@ -0,0 +1 @@ +这是README.md的中文翻译 \ No newline at end of file From 979ebb64806ff0e773a1bcca47e79e728f5468a9 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:35:38 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 24d4cdd..6d26bc2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # raylib-drawing +[简体中文](README_ZH.md) raylib is a simple and easy-to-use game library, yet it lacks 2d drawing functions. raylib-drawing provides the functions that raylib lacks. From 46fe7661374894078e55c6041417f84278d492e4 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:36:36 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 1 deletion(-) diff --git a/README_ZH.md b/README_ZH.md index 3004b41..6d26bc2 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -1 +1,175 @@ -这是README.md的中文翻译 \ No newline at end of file +# raylib-drawing +[简体中文](README_ZH.md) + +raylib is a simple and easy-to-use game library, yet it lacks 2d drawing functions. raylib-drawing provides the functions that raylib lacks. + +raylib-drawing is composed of two sub libraries: + - rdrawing.h 2d drawing library + - rturtle.h turtle graphics library + +## rdrawing.h + +rdrawing.h provides many color definitions and basic 2d drawing functions: + +The following program draw and fill a polygon interactively. +``` +#include "../src/rdrawing.h" +#include + +int main() { + InitWindow(800,600,"test"); + + Image img=GenImageColor(800,600,WHITE); + + SetRandomSeed(time(NULL)); + SetTraceLogLevel(LOG_WARNING); + int vx[200]; + int vy[200]; + int size=sizeof(vx)/sizeof(int); + SetTargetFPS(120); + int num=0; + while (!WindowShouldClose()) { + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { + if (num0) + ImageDrawLine(&img,vx[num-1],vy[num-1],vx[num],vy[num],BLACK); + ImageDrawPointEx(&img,vx[num],vy[num],3,BLUE); + num++; + } + } + if (IsKeyPressed(KEY_ENTER)) { + ImageFillPolygonEx(&img,vx,vy,num,LIGHTRED); + ImageDrawPolygonEx(&img,vx,vy,num,3,BLACK); + for (int i=0;i + +int main() { + int n; + initWorld(800,600); + + setSpeed(500); + + n=50; + for (int i=0;i Date: Sat, 8 Mar 2025 10:40:27 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index 6d26bc2..06f08db 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -1,17 +1,17 @@ # raylib-drawing -[简体中文](README_ZH.md) +[English](README.md) -raylib is a simple and easy-to-use game library, yet it lacks 2d drawing functions. raylib-drawing provides the functions that raylib lacks. +raylib是一个简单易用的游戏库,但它缺乏2D绘图功能。raylib-drawing提供了raylib所缺乏的功能。 -raylib-drawing is composed of two sub libraries: - - rdrawing.h 2d drawing library - - rturtle.h turtle graphics library +raylib-drawing由两个子库组成: + - rdrawing.h 2D绘图库 + - rturtle.h 海龟图形库 ## rdrawing.h -rdrawing.h provides many color definitions and basic 2d drawing functions: +rdrawing.h提供了许多颜色定义和基本的2D绘图功能: -The following program draw and fill a polygon interactively. +下面的程序以交互方式绘制和填充多边形。 ``` #include "../src/rdrawing.h" #include From b11266e4d81382798e7d749c5e0876e963b267f5 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:42:26 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index 06f08db..555fd34 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -9,9 +9,9 @@ raylib-drawing由两个子库组成: ## rdrawing.h -rdrawing.h提供了许多颜色定义和基本的2D绘图功能: +`rdrawing.h`提供了许多颜色定义和基本的2D绘图功能: -下面的程序以交互方式绘制和填充多边形。 +以下程序可交互式地绘制并填充多边形。 ``` #include "../src/rdrawing.h" #include From e437793533b2b88c3703e4072fc5053d8d39ecb8 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:43:24 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index 555fd34..8da5862 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -4,8 +4,8 @@ raylib是一个简单易用的游戏库,但它缺乏2D绘图功能。raylib-drawing提供了raylib所缺乏的功能。 raylib-drawing由两个子库组成: - - rdrawing.h 2D绘图库 - - rturtle.h 海龟图形库 + - `rdrawing.h` 2D绘图库 + - `rturtle.h` 海龟图形库 ## rdrawing.h From 30ef687714fa70353df19f7ba9d0143e2506cd98 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:47:15 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index 8da5862..aff75de 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -62,11 +62,11 @@ int main() { } ``` -| Function | Usage | +| 函数 | 用途 | |---|---| -| ImageDrawPointEx | Draw a point to the image | -| ImageDrawArcEx | Draw an ellipse arc to the image, using the provided line width and color | -| ImageDrawLineEx | Draw a line to the image, using the provided line width and color | +| ImageDrawPointEx | 在图像上绘制点 | +| ImageDrawArcEx | 使用提供的线宽和颜色,在图像上绘制椭圆弧 | +| ImageDrawLineEx | 使用提供的线宽和颜色在图像上画一条线 | | ImageDrawPolylineEx | Draw a polyline to the image, using the provided line width and color | | ImageDrawRectangleEx | Draw a rectangle's outline to the image, using the provided line width and color | | ImageDrawRoundRectEx | Draw a rounded rectangle's outline to the image, using the provided line width and color | From 5cdd18126f2e4c6f0317977309ef5e47957cafe1 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 8 Mar 2025 10:58:58 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_ZH.md b/README_ZH.md index aff75de..a5ba8f7 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -67,8 +67,8 @@ int main() { | ImageDrawPointEx | 在图像上绘制点 | | ImageDrawArcEx | 使用提供的线宽和颜色,在图像上绘制椭圆弧 | | ImageDrawLineEx | 使用提供的线宽和颜色在图像上画一条线 | -| ImageDrawPolylineEx | Draw a polyline to the image, using the provided line width and color | -| ImageDrawRectangleEx | Draw a rectangle's outline to the image, using the provided line width and color | +| ImageDrawPolylineEx | 使用提供的线宽和颜色在图像上绘制折线。 | +| ImageDrawRectangleEx | 使用提供的线宽和颜色,在图像上绘制矩形轮廓 | | ImageDrawRoundRectEx | Draw a rounded rectangle's outline to the image, using the provided line width and color | | ImageDrawCircleEx | Draw a circle's outline to the image, using the provided line width and color | | ImageDrawEllipseEx | Draw an ellipse's outline to the image, using the provided line width and color | From 4154fb38247346e593852e02fc9c14c440d14119 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 22 Mar 2025 17:29:32 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README=5FZH.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_ZH.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_ZH.md b/README_ZH.md index a5ba8f7..6cbf19a 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -69,7 +69,7 @@ int main() { | ImageDrawLineEx | 使用提供的线宽和颜色在图像上画一条线 | | ImageDrawPolylineEx | 使用提供的线宽和颜色在图像上绘制折线。 | | ImageDrawRectangleEx | 使用提供的线宽和颜色,在图像上绘制矩形轮廓 | -| ImageDrawRoundRectEx | Draw a rounded rectangle's outline to the image, using the provided line width and color | +| ImageDrawRoundRectEx | 使用提供的线宽和颜色,在图像上绘制圆角矩形轮廓 | | ImageDrawCircleEx | Draw a circle's outline to the image, using the provided line width and color | | ImageDrawEllipseEx | Draw an ellipse's outline to the image, using the provided line width and color | | ImageDrawPolygonEx | Draw a polygon's outline to the image, using the provided line width and color | From 1b2c11ae927f0b554ec7eda12354a14ddefbaa12 Mon Sep 17 00:00:00 2001 From: Orange Black Date: Sat, 22 Mar 2025 17:33:32 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d26bc2..eac256a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # raylib-drawing -[简体中文](README_ZH.md) +[简体中文(未完成)](README_ZH.md) raylib is a simple and easy-to-use game library, yet it lacks 2d drawing functions. raylib-drawing provides the functions that raylib lacks.