From 4b8883062bc5d2b0f702cdb8333bb992eb32ac7a Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 12 Aug 2023 22:27:25 +0800 Subject: [PATCH] update linux templates --- .../templates/epitrochoid/epitrochoid_c.txt | 26 ++++++++--------- .../linux/templates/epitrochoid/info.template | 1 + .../templates/hypotrochoid/hypotrochoid_c.txt | 28 +++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/platform/linux/templates/epitrochoid/epitrochoid_c.txt b/platform/linux/templates/epitrochoid/epitrochoid_c.txt index 6566b3ad..8572db3f 100644 --- a/platform/linux/templates/epitrochoid/epitrochoid_c.txt +++ b/platform/linux/templates/epitrochoid/epitrochoid_c.txt @@ -11,7 +11,7 @@ void updateRadius(int baseL, int outerL, int pointL, int *pBaseR, int *pOuterR, totalL+=pointL; else totalL+=outerL; - int totalR = 420; + int totalR = 340; int remainder = totalR % totalL; if (remainder!=0) { if (remainder < totalL / 2) { @@ -31,21 +31,21 @@ int main() { int outerL=13; int pointL=3; int baseR,outerR,pointR; - int cx=450,cy=450; + int cx=350,cy=350; int speed = 1; Color trackColor = BLUE; updateRadius(baseL, outerL, pointL, &baseR, &outerR, & pointR); - InitWindow(1300,900,"Epitrochoid"); + InitWindow(1000,700,"Epitrochoid"); SetTraceLogLevel(LOG_WARNING); SetTargetFPS(60); GuiSetStyle(DEFAULT,TEXT_SIZE,20); - Image trackImage=GenImageColor(900,900,WHITE); + Image trackImage=GenImageColor(700,700,WHITE); //border - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); - Image circlesImage = GenImageColor(900,900,BLANK); + Image circlesImage = GenImageColor(700,700,BLANK); float r=0; int lastx,lasty; lasty=cy; @@ -57,9 +57,9 @@ int main() { int newBaseL = GuiSliderBar((Rectangle){ 70, 60, 200, 30 },"Base",TextFormat("%i", (int)baseL), baseL, 1, 50); int newPointL = GuiSliderBar((Rectangle){ 70, 100, 200, 30 },"Point",TextFormat("%i", (int)pointL), pointL, 1, 50); speed = GuiSliderBar((Rectangle){ 70, 150, 200, 30 },"Speed",TextFormat("%i", (int)speed), speed, 1, 50); - GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%X%X%X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b))); + GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%02X%02X%02X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b))); trackColor= GuiColorPicker((Rectangle){ 50, 250, 196, 192 }, NULL, trackColor); - int doClear = GuiButton((Rectangle){ 120, 700, 80, 30 },"Clear"); + int doClear = GuiButton((Rectangle){ 120, 500, 80, 30 },"Clear"); if (newOuterL!=outerL || newBaseL!=baseL || newPointL!=pointL) { if (newOuterL!=outerL) pointL=newOuterL; @@ -72,12 +72,12 @@ int main() { lastx=cx+(baseR+outerR-pointR); r=0; ImageClearBackground(&trackImage,WHITE); - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); } else if (doClear) { ImageClearBackground(&trackImage,WHITE); - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); } //update datas r+=0.01; diff --git a/platform/linux/templates/epitrochoid/info.template b/platform/linux/templates/epitrochoid/info.template index 7cab5b79..a272593c 100644 --- a/platform/linux/templates/epitrochoid/info.template +++ b/platform/linux/templates/epitrochoid/info.template @@ -11,6 +11,7 @@ Category[zh_CN]=游戏 [Unit0] CName=main.c C=epitrochoid_c.txt +C[zh_CN]=epitrochoid_zh_CN.c [Project] UnitCount=1 diff --git a/platform/linux/templates/hypotrochoid/hypotrochoid_c.txt b/platform/linux/templates/hypotrochoid/hypotrochoid_c.txt index e962516d..8de7a991 100644 --- a/platform/linux/templates/hypotrochoid/hypotrochoid_c.txt +++ b/platform/linux/templates/hypotrochoid/hypotrochoid_c.txt @@ -17,7 +17,7 @@ void updateRadius(int baseL, int innerL,int pointL, int *pBaseR, int *pInnerR, i if (pointL>innerL) totalL = baseL-innerL+pointL; } - int totalR = 420; + int totalR = 320; int remainder = totalR % totalL; if (remainder!=0) { if (remainder < totalL / 2) { @@ -37,21 +37,21 @@ int main() { int innerL=3; int pointL=6; int baseR,innerR,pointR; - int cx=450,cy=450; + int cx=350,cy=350; int speed = 1; Color trackColor = BLUE; updateRadius(baseL, innerL, pointL, &baseR, &innerR, &pointR); - InitWindow(1300,900,"Hypotrochoid"); + InitWindow(1100,700,"Hypotrochoid"); SetTraceLogLevel(LOG_WARNING); SetTargetFPS(60); GuiSetStyle(DEFAULT,TEXT_SIZE,20); - Image trackImage=GenImageColor(900,900,WHITE); + Image trackImage=GenImageColor(700,700,WHITE); //border - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); - Image circlesImage = GenImageColor(900,900,BLANK); + Image circlesImage = GenImageColor(700,700,BLANK); float r=0; int lastx,lasty; bool skip=true; @@ -64,9 +64,9 @@ int main() { int newBaseL = GuiSliderBar((Rectangle){ 70, 60, 200, 30 },"Base",TextFormat("%i", (int)baseL), baseL, 1, 50); int newPointL = GuiSliderBar((Rectangle){ 70, 100, 200, 30 },"Point",TextFormat("%i", (int)pointL), pointL, 1, 50); speed = GuiSliderBar((Rectangle){ 70, 150, 200, 30 },"Speed",TextFormat("%i", (int)speed), speed, 1, 50); - GuiLabel((Rectangle){ 20, 220, 80, 30 },TextFormat("Color: 0x%X%X%X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b))); + GuiLabel((Rectangle){ 20, 220, 200, 30 },TextFormat("Color: 0x%02X%02X%02X ",(int)(trackColor.r), (int)(trackColor.g),(int)(trackColor.b))); trackColor= GuiColorPicker((Rectangle){ 50, 250, 196, 192 }, NULL, trackColor); - int doClear = GuiButton((Rectangle){ 120, 700, 80, 30 },"Clear"); + int doClear = GuiButton((Rectangle){ 120, 500, 80, 30 },"Clear"); if (newInnerL!=innerL || newBaseL!=baseL || newPointL!=pointL) { if (newInnerL!=innerL) pointL=newInnerL; @@ -78,12 +78,12 @@ int main() { r=0; skip=true; ImageClearBackground(&trackImage,WHITE); - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); } else if (doClear) { ImageClearBackground(&trackImage,WHITE); - ImageFillRectangleEx(&trackImage,0,0,900,900,LIGHTGRAY); - ImageFillRectangleEx(&trackImage,5,5,890,890,WHITE); + ImageFillRectangleEx(&trackImage,0,0,700,700,LIGHTGRAY); + ImageFillRectangleEx(&trackImage,5,5,690,690,WHITE); } //update datas float innerCX=cx+ (baseR-innerR)*cos(r); @@ -137,4 +137,4 @@ int main() { UnloadImage(circlesImage); UnloadImage(trackImage); CloseWindow(); -} +} \ No newline at end of file