From 704a86f86e0660839fac7bc992ddde867f226b90 Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 12:52:07 +0800
Subject: Update raylib_shapes.c
---
cheatsheet/zh/raylib_shapes.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/cheatsheet/zh/raylib_shapes.c b/cheatsheet/zh/raylib_shapes.c
index 510770c..1cc8c4b 100644
--- a/cheatsheet/zh/raylib_shapes.c
+++ b/cheatsheet/zh/raylib_shapes.c
@@ -2,8 +2,8 @@
//模块:rshapes
//设置要用于形状绘图的Texture和Rectangle
//注意:当使用基本形状和单个Font时,
- //定义 Font字符白色Rectangle将允许在一次绘制调用中绘制所有内容
- void SetShapesTexture(Texture2D texture, Rectangle source); //设置要用于形状绘图的Texture和Rectangle
+ //自定义字体绘制的字符颜色设置为白色时的Rectangle(defining a font char white rectangle)将允许在一次绘制调用中绘制所有内容(这可能涉及到有关rlgl及更底层的知识)
+ void SetShapesTexture(Texture2D texture, Rectangle source); //设置要用于形状绘图的Texture和Rectangle,这可能也涉及到rlgl及更底层的知识,如果你不是很熟悉这是做什么的就请慎用,以免产生奇怪的效果
//基本形状绘图功能
void DrawPixel(int posX, int posY, Color color); //绘制像素
@@ -23,26 +23,26 @@
void DrawCircleLines(int centerX, int centerY, float半径, Color color); //绘制圆轮廓
void DrawEllipse(int centerX, int centerY, float半径H, float半径V, Color color); //绘制椭圆
void DrawEllipseLines(int centerX, int centerY, float半径H, float半径V, Color color); //绘制椭圆轮廓
- void DrawRing(Vector2中心, float innerRadius, float outerRadius, float startAngle, float endAngle, int段, Color color); //牵引环
- void DrawRingLines(Vector2中心, float innerRadius, float outerRadius, float startAngle, float endAngle, int段, Color color); //绘制环形轮廓
+ void DrawRing(Vector2中心, float innerRadius, float outerRadius, float startAngle, float endAngle, int 段/*segments,可能指圆缺*/, Color color); //牵引环
+ void DrawRingLines(Vector2中心, float innerRadius, float outerRadius, float startAngle, float endAngle, int段/*segments,可能指圆缺*/, Color color); //绘制环形轮廓
void DrawRectangle(int posX, int posY, int width, int height, Color Color); //绘制填充颜色的Rectangle
- void DrawRectangle V(Vector2位置, Vector2大小, Color color); //绘制彩色填充Rectangle(矢量版)
+ void DrawRectangle V(Vector2 位置, Vector2大小, Color color); //绘制彩色填充Rectangle(矢量版)
void DrawRectangleRec(Rectangle rec, Color color); //绘制填充颜色的Rectangle
- void DrawRectanglePro(Rectangle rec, Vector2原点, float旋转, Color color); //用pro参数绘制一个填充颜色的Rectangle
+ void DrawRectanglePro(Rectangle rec, Vector2 原点/*开始渐变的点*/, float旋转, Color color); //用pro参数绘制一个填充颜色的Rectangle
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); //绘制垂直渐变填充Rectangle
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); //绘制水平渐变填充Rectangle
- void DrawRectangleGradientEx(Rectangle rec, 颜色col1, 颜色col2, 颜色col3, 颜色col4); //使用自定义顶点颜色绘制渐变填充Rectangle
+ void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); //使用自定义顶点颜色绘制渐变填充Rectangle
void DrawRectangleLines(int posX, int posY, int width, int height, Color Color); //绘制Rectangle轮廓
void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); //使用扩展参数绘制Rectangle轮廓
- void DrawRectangleRounded(Rectangle rec, float圆度, int段, Color color); //绘制圆角Rectangle
- void DrawRectangleRoundedLines(Rectangle rec, float圆度, int段, float线厚, Color color); //绘制带有圆角边缘轮廓的Rectangle
+ void DrawRectangleRounded(Rectangle rec, float 圆度/*roundness*/, int段, Color color); //绘制圆角Rectangle
+ void DrawRectangleRoundedLines(Rectangle rec, float 圆度/*roundness*/, int段, float 线条粗细, Color color); //绘制带有圆角边缘轮廓的Rectangle
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); //绘制一个彩色填充三角形(顶点按逆时针顺序!)
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); //绘制三角形轮廓(顶点按逆时针顺序!)
- void DrawTriangleFan(Vector2*点, int点计数, Color color); //绘制由点定义的三角形扇形(第一个顶点是中心)
- void DrawTriangleStrip(Vector2*点, int点计数, Color color); //绘制由点定义的三角形条带
- void DrawPoly(Vector2中心, int边, float半径, float旋转, Color color); //绘制正多边形(矢量版本)
- void DrawPolyLines(Vector2中心, int边, float半径, float旋转, Color color); //绘制n条边的多边形轮廓
- void DrawPolyLinesEx(Vector2中心, int边, float半径, float旋转, float线厚, Color color); //使用扩展参数绘制n条边的多边形轮廓
+ void DrawTriangleFan(Vector2*点, int 点的数量/*pointCount*/, Color color); //绘制由点定义的三角形扇形(第一个顶点是中心)
+ void DrawTriangleStrip(Vector2*点, int 点的数量/*pointCount*/, Color color); //绘制由点定义的三角形条带
+ void DrawPoly(Vector2中心, int边, float半径, float旋转/*填入一个角度,使画出来的多边形可以旋转*/, Color color); //绘制正多边形(矢量版本)
+ void DrawPolyLines(Vector2中心, int边, float半径, float旋转/*填入一个角度,使画出来的多边形可以旋转*/, Color color); //绘制n条边的多边形轮廓
+ void DrawPolyLinesEx(Vector2中心, int边, float半径, float旋转/*填入一个角度,使画出来的多边形可以旋转*/, float 线条粗细, Color color); //使用扩展参数绘制n条边的多边形轮廓
//基本形状碰撞检测功能
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); //检查两个Rectangle之间的碰撞
@@ -51,8 +51,8 @@
bool CheckCollisionPointRec(Vector2点, Rectangle rec); //检查点是否在Rectangle内
bool CheckCollisionPointCircle(Vector2点, Vector2中心, float半径); //检查点是否在圆内
bool CheckCollisionPointTriangle(Vector2点, Vector2 p1, Vector2 p2, Vector2 p3); //检查点是否在三角形内
- bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, 向量2 startPos2, Vector2 endPos2, 向量2*碰撞点); //检查由每个两点定义的两条直线之间的碰撞, 通过引用返回碰撞点
- bool CheckCollisionPointLine(Vector2点, Vector2 p1, Vector2 p2, int阈值); //检查点是否属于两点[p1]和[p2]之间创建的线, 并以像素为单位定义了边距[threshold]
+ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2* collisionPoint); //检查两条线段之间(两点定义)是否碰撞, 通过Vector2 *collisionPoint指针指向相关Vector2类变量以获取碰撞点
+ bool CheckCollisionPointLine(Vector2点, Vector2 p1, Vector2 p2, int 阈值); //检查点是否属于两点[p1]和[p2]之间创建的线, 并以像素为单位定义了边距[threshold]
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); //获取两个Rectangle碰撞的碰撞Rectangle
-
\ No newline at end of file
+
--
cgit v1.2.3
From 527c61cd1c822020f14e31f2e656ad5efbee8370 Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 13:19:02 +0800
Subject: Update raylib_textures.c
---
cheatsheet/zh/raylib_textures.c | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/cheatsheet/zh/raylib_textures.c b/cheatsheet/zh/raylib_textures.c
index 34add4d..9310b0f 100644
--- a/cheatsheet/zh/raylib_textures.c
+++ b/cheatsheet/zh/raylib_textures.c
@@ -1,4 +1,5 @@
+
//模块:rtextures
//Image加载功能
//注意:此功能不需要GPU访问
@@ -25,12 +26,12 @@
Image ImageCopy(Image Image); //创建图像副本(用于变换)
Image ImageFromImage(Image Image, Rectangle记录); //从其他图像片段创建图像
Image ImageText(const char *text, int fontSize, Color Color); //从文本创建图像(默认字体)
- Image ImageTextEx(Font, const char *文本, float Font大小, float间距, 颜色色调); //从文本创建图像(自定义精灵字体)
+ Image ImageTextEx(Font, const char *text/*文本*/, float Fontsize, float间距, 颜色色调); //从文本创建图像,我猜可能是将字绘制成Image然后返回(使用自定义的字体)
void ImageFormat(Image *Image, int newFormat); //将图像数据转换为所需格式
- void ImageToPOT(Image *Image, 颜色填充); //将图像转换为POT(2的幂)
- void ImageCrop(Image *Image, Rectangle裁剪); //将图像裁剪为定义的Rectangle
- void ImageAlphaCrop(Image *Image, float阈值); //根据alpha值裁剪图像
- void ImageAlphaClear(Image *Image, Color color, float阈值); //将alpha通道清除为所需颜色
+ void ImageToPOT(Image *Image, Color fill/*填充*/); //将图像转换为POT(2的幂)
+ void ImageCrop(Image *Image, Rectangle Crop); //将图像裁剪为定义的Rectangle
+ void ImageAlphaCrop(Image *Image, float 阈值); //根据alpha值裁剪图像
+ void ImageAlphaClear(Image *Image, Color color, float 阈值); //将alpha通道清除为所需颜色
void ImageAlphaMask(Image *Image, Image alphaMask); //对图像应用alpha遮罩
void ImageAlphaPremultiply(Image *Image); //预乘alpha通道
void ImageResize(Image *Image, int newWidth, int newHeight); //调整图像大小(双三次缩放算法)
@@ -79,38 +80,36 @@
TextureCubemap LoadTextureCubemap(Image Image, int布局); //从图像 Load立方体贴图, 支持多个图像立方体贴图布局
RenderTexture2D LoadRenderTexture(int宽度, int高度); //加载用于渲染的Texture(帧缓冲区)
void UnloadTexture(Texture2D texture); //从GPU内存(VRAM)卸载Texture
- void UnloadRenderTexture(RenderTexture2D目标); //从GPU内存(VRAM)卸载渲染Texture
- void UpdateTexture(Texture2D texture, const void *像素); //使用新数据更新GPUTexture
+ void UnloadRenderTexture(RenderTexture2D target); //从GPU内存(VRAM)卸载渲染Texture
+ void UpdateTexture(Texture2D texture, const void *像素/*pixel*/); //使用新数据更新GPUTexture
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *像素); //使用新数据更新GPUTextureRectangle
//Texture配置功能
void GenTextureMipmaps(Texture2D *texture); //为Texture生成GPU mipmap
- void SetTextureFilter(Texture2D texture, int过滤器); //设置Texture缩放过滤器模式
+ void SetTextureFilter(Texture2D texture, int 过滤器); //设置Texture缩放过滤器模式
void SetTextureWrap(Texture2D texture, int wrap); //设置Texture包裹模式
- //Texture绘制功能
+ //Texture绘制功能,部分可能涉及rlgl以及更底层的知识
void DrawTexture(Texture2D texture, int posX, int posY, Color tint); //绘制Texture2D
void DrawTextureV(Texture2D texture, Vector2位置, Color tint); //绘制位置定义为Vector2的Texture2D
void DrawTextureEx(Texture2D texture, Vector2位置, float旋转, float比例, Color tint); //使用扩展参数绘制Texture2D
- void DrawTextureRec(Texture2D texture, Rectangle源, Vector2位置, Color tint); //绘制由Rectangle 定义的Texture的一部分
- void DrawTextureQuad(Texture2D texture, Vector2平铺, Vector2偏移, Rectangle四边形, Color tint); //使用平铺和偏移参数绘制Texture四边形
- void DrawTextureTiled(Texture2D texture, Rectangle源, Rectangle目标, Vector2原点, float旋转, float比例, Color tint); //绘制Texture的一部分(由Rectangle 定义), 旋转并缩放平铺到dest。
- void DrawTexturePro(Texture2D texture, Rectangle源, Rectangle目标, Vector2原点, float旋转, Color tint); //使用“pro”参数绘制由Rectangle 定义的Texture的一部分
- void DrawTextureNPatch(Texture2D texture, NPatchInfo NPatchInfo, Rectangle目标, Vector2原点, float旋转, Color tint); //绘制可以很好地拉伸或收缩的Texture(或其一部分)
+ void DrawTextureRec(Texture2D texture, Rectangle source, Vector2位置, Color tint); //绘制由Rectangle 定义的Texture的一部分
+ void DrawTextureQuad(Texture2D texture, Vector2 平铺, Vector2偏移, Rectangle四边形, Color tint); //使用平铺和偏移参数绘制Texture四边形
+ void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle目标, Vector2原点, float旋转, float比例, Color tint); //绘制Texture的一部分(由Rectangle 定义), 旋转并缩放平铺到dest。
+ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle目标, Vector2原点, float旋转, Color tint); //使用“pro”参数绘制由Rectangle 定义的Texture的一部分
+ void DrawTextureNPatch(Texture2D texture, NPatchInfo NPatchInfo, Rectangle 目标, Vector2原点, float旋转, Color tint); //绘制可以很好地拉伸或收缩的Texture(或其一部分)
void DrawTexturePoly(Texture2D texture, Vector2中心, Vector2 *点, Vector2 *Texture坐标, int pointCount, Color tint); //绘制Texture多边形
//颜色/像素相关功能
Color Fade(Color color, float alpha); //使用alpha获取颜色, alpha从0.0f变为1.0f
int ColorToInt(Color color); //获取颜色的十六进制值
Vector4 ColorNormalize(Color color); //获取标准化为float的颜色[0..1]
- Color ColorFromNormalized(Vector4规格化); //从规格化值[0..1]获取颜色
+ Color ColorFromNormalized(Vector4 规格化); //从规格化值[0..1]获取颜色
Vector3 ColorToHSV(Color color); //获取颜色, 色调[0..360], 饱和度/值[0..1]的HSV值
Color ColorFromHSV(float色调, float饱和度, float值); //从HSV值, 色调[0..360], 饱和度/值[0..1]获取颜色
Color ColorAlpha(Color color, float alpha); //使用alpha获取颜色, alpha从0.0f变为1.0f
Color AlphaBlend(Color dst, Color src, Color tint); //将src alpha混合到带有色调的dst颜色中
Color GetColor(unsigned int hexValue); //从十六进制值获取颜色struct
- Color GetPixelColor(void *srcPtr, int格式); //从特定格式的源像素指针获取颜色
- void SetPixelColor(void *dstPtr, Color coloe, int格式); //设置格式化为目标像素指针的颜色
- int GetPixelDataSize(int宽度, int高度, int格式); //获取特定格式的像素数据大小(字节)
-
-
\ No newline at end of file
+ Color GetPixelColor(void *srcPtr, int 格式/*format*/); //从特定格式的源像素指针获取颜色
+ void SetPixelColor(void *dstPtr, Color coloe, int 格式/*format*/); //设置格式化为目标像素指针的颜色
+ int GetPixelDataSize(int 宽度, int 高度, int 格式/*format*/); //获取特定格式的像素数据大小(字节)
--
cgit v1.2.3
From 6570090d5f40caafb89c1c072d49f926a5bf0167 Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 14:57:38 +0800
Subject: Update raylib_core.c
---
cheatsheet/zh/raylib_core.c | 48 ++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 25 deletions(-)
diff --git a/cheatsheet/zh/raylib_core.c b/cheatsheet/zh/raylib_core.c
index 90c63e5..ae1828e 100644
--- a/cheatsheet/zh/raylib_core.c
+++ b/cheatsheet/zh/raylib_core.c
@@ -65,15 +65,15 @@
void ClearBackground(Color color); //设置背景色(帧缓冲区透明色)
void BeginDrawing(void); //设置画布(帧缓冲区)以开始绘制
void EndDrawing(void); //结束画布绘制和交换缓冲区(双缓冲)
- void BeginMode2D(Camera2D相机); //使用自定义相机开始2D模式(2D)
+ void BeginMode2D(Camera2D camera); //使用自定义相机开始2D模式(2D)
void EndMode2D(void); //使用自定义相机结束2D模式
- void BeginMode3D(Camera3D相机); //使用自定义相机开始3D模式(3D)
+ void BeginMode3D(Camera3D camera); //使用自定义相机开始3D模式(3D)
void EndMode3D(void); //结束三维模式并返回默认的二维正交模式
- void BeginTextureMode(RenderTexture2D目标); //开始绘制以渲染Texture
+ void BeginTextureMode(RenderTexture2D camera); //开始绘制以渲染Texture
void EndTextureMode(void); //结束绘制以渲染Texture
void BeginShaderMode(Shader shader); //开始自定义着色器绘图
void EndShaderMode(void); //结束自定义着色器绘图(使用默认着色器)
- void BeginBlendMode(int模式); //开始混合模式(alpha, 加法, 乘法, 减法, 自定义)
+ void BeginBlendMode(int mode); //开始混合模式(alpha, 加法, 乘法, 减法, 自定义)
void EndBlendMode(void); //结束混合模式(重置为默认值:alpha混合)
void BeginScissorMode(int x, int y, int width, int height); //开始剪式模式(定义下图的屏幕区域)
void EndScissorMode(void); //末端剪式模式
@@ -97,13 +97,13 @@
void UnloadShader(Shader shader); //从GPU内存(VRAM)卸载着色器
//屏幕空间相关功能
- Ray GetMouseRay(Vector2 mousePosition, Camera 相机); //从鼠标位置获取光线跟踪
+ Ray GetMouseRay(Vector2 mousePosition, Camera camera); //从鼠标位置获取光线跟踪
Matrix GetCameraMatrix(Camera camera); //获取相机变换矩阵(视图矩阵)
Matrix GetCameraMatrix2D(Camera2D相机); //获取相机二维变换矩阵
- Vector2 GetWorldToScreen(Vector3位置, 摄像机); //获取三维世界空间位置的屏幕空间位置
- Vector2 GetScreenToWorld2D(Vector2位置, Camera2D相机); //获取2d相机屏幕空间位置的世界空间位置
- Vector2 GetWorldToScreenEx(Vector3位置, 摄像机, int宽度, int高度); //获取三维世界空间位置的大小位置
- Vector2 GetWorldToScreen2D(Vector2位置, Camera2D相机); //获取2d相机世界空间位置的屏幕空间位置
+ Vector2 GetWorldToScreen(Vector3 position/*坐标*/, Camera camera); //获取三维世界空间位置的屏幕空间位置
+ Vector2 GetScreenToWorld2D(Vector2 position/*坐标*/, Camera2D相机); //获取2d相机屏幕空间位置的世界空间位置
+ Vector2 GetWorldToScreenEx(Vector3 position/*坐标*/, Camera camera, int宽度, int高度); //获取三维世界空间位置的大小位置
+ Vector2 GetWorldToScreen2D(Vector2 position/*坐标*/, Camera2D相机); //获取2d相机世界空间位置的屏幕空间位置
//定时相关功能
void SetTargetFPS(int fps);//设置目标FPS(最大值)
@@ -113,7 +113,7 @@
//其他。功能
int GetRandomValue(int最小值, int最大值); //获取最小值和最大值之间的随机值(包括两者)
- void SetRandomSeed(unsigned int种子); //设置随机数生成器的种子
+ void SetRandomSeed(unsigned int seed); //设置随机数生成器的种子
void TakeScreenshot(const char *fileName); //拍摄当前屏幕的屏幕截图(文件扩展名定义格式)
void SetConfigFlags(unsigned int flag); //设置初始化配置标志(查看flags)
void TraceLog(int logLevel, const char *text, …); //显示跟踪日志消息(log_DEBUG, log_INFO, log_WARNING, log_ERROR…)
@@ -124,7 +124,7 @@
void OpenURL(const char*url); //使用默认系统浏览器打开URL(如果可用)
//设置自定义回调
- //警告:回调设置适用于高级用户
+ //警告:回调(callback)设置适用于高级用户
void SetTraceLogCallback(TraceLogCallback回调); //设置自定义跟踪日志
void SetLoadFileDataCallback(LoadFileData回调); //设置自定义文件二进制数据加载器
void SetSaveFileDataCallback(SaveFileData回调); //设置自定义文件二进制数据保护程序
@@ -154,7 +154,7 @@
bool IsPathFile(const char *path); //检查给定路径是文件还是目录
FilePathList LoadDirectoryFiles(const char *dirPath); //加载目录文件路径
FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdir); //使用扩展筛选和递归目录扫描加载目录文件路径
- void UnloadDirectoryFiles(FilePathList文件); //卸载文件路径
+ void UnloadDirectoryFiles(FilePathList files); //卸载文件路径
bool IsFileDropped(void); //检查文件是否已放入窗口
FilePathList LoadDroppedFiles(void); //加载删除的文件路径
void UnloadDroppedFiles(FilePathList files); //卸载删除的文件路径
@@ -167,12 +167,12 @@
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); //解码Base64字符串数据, 内存必须为MemFree()
//------------------------------------------------------------------------------------
- //输入处理功能(模块:核心)
+ //输入处理功能(模块:key)
//------------------------------------------------------------------------------------
//输入相关功能:键盘
- bool IsKeyPressed(int键); //检查是否按下了一次键
- bool IsKeyDown(int键); //检查是否按下了键
+ bool IsKeyPressed(int key ); //检查是否按下了一次键
+ bool IsKeyDown(int key); //检查是否按下了键
bool IsKeyReleased(int key); //检查按键是否已释放一次
bool IsKeyUp(int key); //检查是否未按下按键
void SetExitKey(int key); //设置自定义键以退出程序(默认为ESC)
@@ -205,7 +205,7 @@
void SetMouseScale(float scaleX,float scaleY); //设置鼠标缩放
float GetMouseWheelMove(void); //获取X或Y的鼠标滚轮移动, 以较大者为准
Vector2 GetMouseWheelMoveV(void); //获取X和Y方向的鼠标滚轮移动
- void SetMouseCursor(int鼠标光标); //设置鼠标光标,用于更改屏幕上的光标图像(如:当鼠标放在文本上时会变成另一种图案)
+ void SetMouseCursor(int 鼠标光标); //设置鼠标光标,用于更改屏幕上的光标图像(如:当鼠标放在文本上时会变成另一种图案)
//输入相关功能:触摸
int GetTouchX(void); //获取触摸点0的触摸位置X(相对于屏幕大小)
@@ -218,7 +218,7 @@
//手势和触摸处理功能(模块:手势)
//------------------------------------------------------------------------------------
void SetGesturesEnabled(unsigned int flag); //使用标志启用一组手势
- bool IsGestureDetected(int手势); //检查是否检测到手势
+ bool IsGestureDetected(int gesture); //检查是否检测到手势
int GetGestureDetected(void); //获取最新检测到的手势
float GetGestureHoldDuration(void); //获取手势保持时间(毫秒)
Vector2 GetGestureDragVector(void); //获取手势拖动矢量
@@ -226,13 +226,11 @@
Vector2 GetGesturePinchVector(void); //获取手势捏三角
float GetGesturePinchAngle(void); //获取手势捏角
+ //------------------------------------------------------------------------------------
+ //摄像头系统功能(模块:rcamera)
//------------------------------------------------------------------------------------
- //摄像头系统功能(模块:rcamera)
- //------------------------------------------------------------------------------------
- void SetCameraMode(Camera camera, int mode); //设置相机模式(多种相机模式可用)
- void UpdateCamera(Camera*camera); //更新所选模式的相机位置
- void SetCameraPanControl(int keyPan); //设置相机平移键以与鼠标移动相结合(自由相机)
- void SetCameraAltControl(int keyAlt); //设置相机alt键以与鼠标移动相结合(自由相机)
- void SetCameraSmoothZoomControl(int keySmoothZoom); //设置相机平滑缩放键以与鼠标结合(自由相机)
- void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int key Up, int keyDown); //设置摄像机移动控制(第一人称和第三人称摄像机)
+ void UpdateCamera(Camera*Camera,int mode); //更新所选模式的相机位置,mode参数需要填入一个raylib自带的预制摄像机模式,这会让使用摄像机变得更加方便
+ void UpdateCameraPro(Camera* camera,Vector3 movement,Vector2 rotation/*旋转*/,float zoom/*缩放大小*/) //更新相机移动/旋转
+
+
--
cgit v1.2.3
From 9f41ec0ddfc5cfa4922e6df3f4b37c19b026419d Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 15:05:13 +0800
Subject: Update raylib_core.c
---
cheatsheet/zh/raylib_core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cheatsheet/zh/raylib_core.c b/cheatsheet/zh/raylib_core.c
index ae1828e..c89aff4 100644
--- a/cheatsheet/zh/raylib_core.c
+++ b/cheatsheet/zh/raylib_core.c
@@ -48,10 +48,10 @@
//自定义框架控制功能
//注:这些功能适用于希望完全控制帧处理的高级用户
//默认情况下, EndDrawing()完成以下任务:绘制所有内容+SwapScreenBuffer()+管理帧计时+PollInputEvents()
- //要避免这种行为并手动控制帧进程, 请在配置中启用。h:支持自定义框架控制
+ //要避免这种行为并手动控制帧进程, 请在config.h中启用:SUPPORT_CUSTOM_FRAME_CONTROL
void SwapScreenBuffer(void); //用前缓冲区交换后缓冲区(屏幕绘图)
void PollInputEvents(void); //注册所有输入事件
- void WaitTime(double 双秒); //等待一段时间(停止程序执行)
+ void WaitTime(double second); //等待一段时间(停止程序执行)
//鼠标光标相关功能
void ShowCursor(void); //显示鼠标光标
@@ -99,11 +99,11 @@
//屏幕空间相关功能
Ray GetMouseRay(Vector2 mousePosition, Camera camera); //从鼠标位置获取光线跟踪
Matrix GetCameraMatrix(Camera camera); //获取相机变换矩阵(视图矩阵)
- Matrix GetCameraMatrix2D(Camera2D相机); //获取相机二维变换矩阵
+ Matrix GetCameraMatrix2D(Camera2D camera); //获取相机二维变换矩阵
Vector2 GetWorldToScreen(Vector3 position/*坐标*/, Camera camera); //获取三维世界空间位置的屏幕空间位置
- Vector2 GetScreenToWorld2D(Vector2 position/*坐标*/, Camera2D相机); //获取2d相机屏幕空间位置的世界空间位置
+ Vector2 GetScreenToWorld2D(Vector2 position/*坐标*/, Camera2D camera); //获取2d相机屏幕空间位置的世界空间位置
Vector2 GetWorldToScreenEx(Vector3 position/*坐标*/, Camera camera, int宽度, int高度); //获取三维世界空间位置的大小位置
- Vector2 GetWorldToScreen2D(Vector2 position/*坐标*/, Camera2D相机); //获取2d相机世界空间位置的屏幕空间位置
+ Vector2 GetWorldToScreen2D(Vector2 position/*坐标*/, Camera2D camera); //获取2d相机世界空间位置的屏幕空间位置
//定时相关功能
void SetTargetFPS(int fps);//设置目标FPS(最大值)
--
cgit v1.2.3
From 3c0e0bebbcad28952111a009bd6eb5b32fd9e949 Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 15:20:38 +0800
Subject: Update raylib_audio.c
---
cheatsheet/zh/raylib_audio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cheatsheet/zh/raylib_audio.c b/cheatsheet/zh/raylib_audio.c
index 0441666..c34908f 100644
--- a/cheatsheet/zh/raylib_audio.c
+++ b/cheatsheet/zh/raylib_audio.c
@@ -28,12 +28,12 @@
bool IsSoundPlaying(Sound sound); //检查当前是否正在播放音频
void SetSoundVolume(Sound sound, float音量); //设置音频音量(1.0为最大音量)
void SetSoundPitch(Sound sound, float音调); //设置音频的音调(1.0为基本音量)
- void SetSoundPan(Sound sound, float浮盘); //为音频设置平移(0.5为中心)
+ void SetSoundPan(Sound sound, float pan); //为音频设置平移(0.5为中心)
Wave WaveCopy(Wave wave); //将波复制到新波
void WaveCrop(Wave *Wave, int initSample, int finalSample); //将波裁剪到定义的采样范围
void WaveFormat(Wave *Wave, int sampleRate, int sampleSize, int通道); //将波数据转换为所需格式
float *LoadWaveSamples(Wave wave); //将波采样数据加载为32位float数据数组
- void UnloadWaveSamples(float *样本); //卸载使用加载WaveSamples()加载的样本数据
+ void UnloadWaveSamples(float *样本/*sample*/); //卸载使用加载WaveSamples()加载的样本数据
//Music管理功能
Music LoadMusicStream(const char *fileName); //从文件加载音乐流
@@ -45,10 +45,10 @@
void StopMusicStream(Music music); //停止音乐播放
void PauseMusicStream(Music music); //暂停音乐播放
void ResumeMusicStream(Music music); //继续播放暂停的音乐
- void SeekMusicStream(Music music, float位置); //将音乐搜索到某个位置(以秒为单位)
+ void SeekMusicStream(Music music, float 位置); //将音乐搜索到某个位置,我猜测应该是类似于进度条定位(以秒为单位)
void SetMusicVolume(Music music, float音量); //设置音乐音量(1.0为最大音量)
void SetMusicPitch(Music music, float音高); //设置音乐的音高(1.0为基本级别)
- void SetMusicPan(Music music, 浮盘); //为音乐设置平移(0.5为中心)
+ void SetMusicPan(Music music, float pan); //为音乐设置平移(0.5为中心)
float GetMusicTimeLength(Music music); //获取音乐时间长度(秒)
float GetMusicTimePlayed(Music music); //获取当前播放的音乐时间(秒)
@@ -65,9 +65,9 @@
void SetAudioStreamVolume(AudioStream音频流, float音量); //设置音频流的音量(1.0为最大音量)
void SetAudioStreamPitch(AudioStream音频流, float音调); //设置音频流的音调(1.0为基本级别)
void SetAudioStreamPan(AudioStream音频流, float平移); //设置音频流的平移(0.5居中)
- void SetAudioStreamBufferSizeDefault(int大小); //新音频流的默认大小
+ void SetAudioStreamBufferSizeDefault(int 大小); //新音频流的默认大小
void SetAudioStreamCallback(AudioStream音频流, AudioCallback回调); //音频线程回调以请求新数据
void AttachAudioStreamProcessor(AudioStream音频流, AudioCallback处理器); //将音频流处理器连接到流
void DetachAudioStreamProcessor(AudioStream音频流, AudioCallback处理器); //从流中分离音频流处理器
-
\ No newline at end of file
+
--
cgit v1.2.3
From 2985405980d2fa7ce039ddd81faec473b306b08a Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 15:30:08 +0800
Subject: Update raylib_models.c Chinese
---
cheatsheet/zh/raylib_models.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/cheatsheet/zh/raylib_models.c b/cheatsheet/zh/raylib_models.c
index 837e5de..80470ec 100644
--- a/cheatsheet/zh/raylib_models.c
+++ b/cheatsheet/zh/raylib_models.c
@@ -11,7 +11,7 @@
void DrawCubeWires(Vector3位置, float宽度, float高度, float长度, Color color); //绘制立方体线
void DrawCubeWiresV(Vector3位置, Vector3大小, Color color); //绘制立方体线(矢量版本)
void DrawCubeTexture(Texture2D texture, Vector3位置, float宽度, float高度, float长度, Color color); //绘制立方体Texture
- void DrawCubeTextureRec(Texture2D texture, Rectangle源, Vector3位置, float宽度, float高度, float长度, Color color); //使用Texture区域绘制立方体
+ void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3位置, float宽度, float高度, float长度, Color color); //使用Texture区域绘制立方体
void DrawSphere(Vector3 centerPos, float半径, Color color); //绘制球体
void DrawSphereEx(Vector3 centerPos, float半径, int rings,int slices, Color color); //使用扩展参数绘制球体
void DrawSphereWires(Vector3 centerPos, float半径, int rings,int slices, Color color); //绘制球体导线
@@ -21,7 +21,7 @@
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color Color); //绘制圆柱体导线, 底部位于startPos, 顶部位于endPos
void DrawPlane(Vector3 centerPos, Vector2大小, Color color); //绘制平面XZ
void DrawRay(Ray ray, Color color); //绘制光线线
- void DrawGrid(int slices, float间距); //绘制Mesh(以(0, 0, 0)为中心)
+ void DrawGrid(int slices, float 间距); //绘制Mesh(以(0, 0, 0)为中心)
//------------------------------------------------------------------------------------
//Model 3d加载和绘图功能(模块:Model)
@@ -46,7 +46,7 @@
//Mesh管理功能
void UploadMesh(Mesh *mesh, bool dynamic); //在GPU中上载Mesh顶点数据并提供VAO/VBO ID
- void UpdateMeshBuffer(Mesh mesh, int索引, const void *data, int dataSize, int偏移量); //为特定缓冲区索引更新GPU中的Mesh顶点数据
+ void UpdateMeshBuffer(Mesh mesh, int 索引/*index*/, const void *data, int dataSize, int 偏移量); //为特定缓冲区索引更新GPU中的Mesh顶点数据
void UnloadMesh(Mesh mesh); //从CPU和GPU卸载Mesh数据
void DrawMesh(Mesh mesh, Material material, Matrix transform); //使用材质和变换绘制三维网格
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); //使用材质和不同变换绘制多个Mesh实例
@@ -64,8 +64,8 @@
Mesh GenMeshCone(float半径, float高度, int slices); //生成圆锥体/棱锥体网格
Mesh GenMeshTorus(float半径, float大小, int radSeg, int边); //生成圆环体网格
Mesh GenMeshKnot(float半径, float大小, int radSeg, int边); //生成三叶结网格
- Mesh GenMeshHeightmap(Image高度贴图, Vector3大小); //从图像数据生成高度图网格
- Mesh GenMeshCubicmap(Image立方体贴图, Vector3立方体大小); //从图像数据生成基于立方体的地图网格
+ Mesh GenMeshHeightmap(Image 高度贴图, Vector3大小); //从图像数据生成高度图网格
+ Mesh GenMeshCubicmap(Image 立方体贴图, Vector3 立方体大小); //从图像数据生成基于立方体的地图网格
//材料装载/卸载功能
Material *LoadMaterials(const char *fileName, int *materialCount); //从Model文件加载材质
@@ -76,17 +76,17 @@
//Model动画加载/卸载功能
ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); //从文件加载Model动画
- void UpdateModelAnimation(Model Model, ModelAnimation动画, int帧); //更新Model动画姿势
- void UnloadModelAnimation(ModelAnimation动画); //卸载动画数据
+ void UpdateModelAnimation(Model Model, ModelAnimation 动画, int帧); //更新Model动画姿势
+ void UnloadModelAnimation(ModelAnimation 动画); //卸载动画数据
void UnloadModelAnimations(ModelAnimation *动画, unsigned int计数); //卸载动画阵列数据
- bool IsModelAnimationValid(Model Model, Model动画动画); //检查Model动画骨架匹配
+ bool IsModelAnimationValid(Model Model, ModelAnimation 动画); //检查Model动画骨架匹配
//碰撞检测功能
bool CheckCollisionSpheres(Vector3中心1, float半径1, Vector3中心2, float半径2); //检查两个球体之间的碰撞
bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); //检查两个边界框之间的碰撞
- bool CheckCollisionBoxSphere(BoundingBox框, Vector3中心, float半径); //检查长方体和球体之间的碰撞
+ bool CheckCollisionBoxSphere(BoundingBox box, Vector3中心, float半径); //检查长方体和球体之间的碰撞
RayCollision GetRayCollisionSphere(Ray ray, Vector3中心, float半径); //获取光线和球体之间的碰撞信息
- RayCollision GetRayCollisionBox(Ray ray, BoundingBox框); //获取光线和长方体之间的碰撞信息
+ RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); //获取光线和长方体之间的碰撞信息
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); //获取光线和Mesh之间的碰撞信息
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); //获取光线和三角形之间的碰撞信息
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); //获取光线和四边形之间的碰撞信息
--
cgit v1.2.3
From 3dcc53a63cb1f9f6e9de454d58c33da0c8b831b1 Mon Sep 17 00:00:00 2001
From: MackyinSU <103645024+MackyinSU@users.noreply.github.com>
Date: Sun, 27 Aug 2023 17:25:24 +0800
Subject: Update cheatsheet_zh.html
---
cheatsheet/cheatsheet_zh.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cheatsheet/cheatsheet_zh.html b/cheatsheet/cheatsheet_zh.html
index e736ffb..8a5a68d 100644
--- a/cheatsheet/cheatsheet_zh.html
+++ b/cheatsheet/cheatsheet_zh.html
@@ -132,8 +132,8 @@
此翻译仅做参考与辅助学习, 可能会有点枯燥, 可以去阅读大佬的教程【https://zhuanlan.zhihu.com/p/526271216】
-该翻译稿为非盈利的, 是为了大家更好的学习与享受视频游戏编程的乐趣, 禁止在没有告诉译者的情况下擅自将其用作营利!!!
-译者邮箱:jinquannice@163.com & macky@starsunion.eu.org
+该翻译稿为非盈利的, 是为了大家更好的学习与享受视频游戏编程的乐趣,若要用于营利,请在获取作者以及译者的同意的前提下进行
+译者邮箱:jinquannice@163.com & macky@starsunion.eu.org,修改的话还可以fork此仓库https://github.com/raysan5/raylib.com/tree/master/cheatsheet/zh进行修改并发送拉取请求
本翻译由恒星联盟(starsunion.eu.org)成员Macky和HJQ进行翻译