MCP HubMCP Hub
返回技能列表

raylib

EvanLavender13
更新于 Yesterday
175 次查看
0
在 GitHub 上查看
开发api

关于

This skill helps developers leverage raylib's existing API to avoid reinventing solutions for graphics, input, or audio. It directs you to consult the official cheatsheet to find built-in functions before writing custom code. Use it to quickly check for available utilities in modules like shapes, textures, and audio.

快速安装

Claude Code

推荐
插件命令推荐
/plugin add https://github.com/EvanLavender13/audio-jones
Git 克隆备选方式
git clone https://github.com/EvanLavender13/audio-jones.git ~/.claude/skills/raylib

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

raylib Development

Check raylib's built-in functions before writing custom implementations.

Cheatsheet First

Reference: https://www.raylib.com/cheatsheet/cheatsheet.html

Before implementing any rendering, input, or audio feature:

  1. Identify the module (shapes, textures, text, models, shaders, audio)
  2. Scan that module's functions in the cheatsheet
  3. Only write custom code if no raylib function exists

Use WebFetch to retrieve and search the cheatsheet when uncertain.

Module Categories

ModuleCoversCommon Functions
rcoreWindow, input, timingGetFrameTime, IsKeyPressed, GetMousePosition
rshapes2D primitivesDrawLineEx, DrawRectangleRounded, DrawCircleSector
rtexturesImages, texturesDrawTexturePro, LoadRenderTexture, BeginTextureMode
rtextFont renderingDrawTextEx, MeasureTextEx
rmodels3D geometryDrawMesh, LoadModel
raudioSound, musicLoadSound, PlaySound, SetSoundVolume
rlglLow-level OpenGLUse only when raylib lacks the feature

Before You Implement

Check these functions first for common tasks:

TaskCheck First
Thick linesDrawLineEx(start, end, thickness, color)
Rounded rectanglesDrawRectangleRounded, DrawRectangleRoundedLines
Rotated/scaled spritesDrawTexturePro(texture, source, dest, origin, rotation, tint)
Bezier curvesDrawLineBezier, DrawLineBezierQuad, DrawLineBezierCubic
Render to textureLoadRenderTexture, BeginTextureMode, EndTextureMode
Screen captureTakeScreenshot, LoadImageFromScreen
Shader uniformsGetShaderLocation, SetShaderValue
Delta timeGetFrameTime() returns seconds since last frame

Naming Conventions

raylib uses consistent verb prefixes:

  • Load* / Unload* — Resource lifecycle
  • Begin* / End* — Scoped state (drawing, shader, texture mode)
  • Draw* — Immediate rendering
  • Get* / Set* — Property access
  • Is* — Boolean queries (IsKeyPressed, IsWindowResized)
  • Check* — Collision detection

rlgl: Last Resort

rlgl exposes raw OpenGL. Use only when:

  • raylib provides no built-in function
  • Performance requires batched custom geometry
  • Custom vertex attributes needed

For simple shapes, rshapes functions outperform hand-rolled rlgl.

Verification

When implementing graphics features, verify:

  • Searched cheatsheet for existing function
  • Checked rshapes before rlgl
  • Used DrawTexturePro for any sprite transforms
  • Paired all Begin*/End* calls

GitHub 仓库

EvanLavender13/audio-jones
路径: .claude/skills/raylib

相关推荐技能