mcpField
D
defold-examples-fetch

defold-examples-fetch

github.com/indiesoftby开发10450 次安装27 周前更新
代码仓库

关于 defold-examples-fetch

面向 Defold 开发者的示例索引技能,将常见实现主题对应到 Markdown 示例文件,并按类别整理链接以供获取。

主要功能

  1. 01按开发主题索引示例
  2. 02提供纯 Markdown 示例链接
  3. 03涵盖动画、物理、GUI 等内容

适用场景

  1. 01查找 Defold 功能的实现示例
  2. 02为游戏开发任务获取示例指导

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/indiesoftby/defold-agent-config --skill defold-examples-fetch

安装后在 Claude Code 中输入/defold-examples-fetch确认已加载。

详细介绍

Defold 示例参考

从下方链接获取示例代码(这些 URL 指向纯 Markdown 文件)。

动画

示例URL
动画状态机https://defold.com/llms/examples/animation/animation_states.md
光标动画https://defold.com/llms/examples/animation/cursor.md
缓动函数(补间)https://defold.com/llms/examples/animation/easing.md
欧拉旋转https://defold.com/llms/examples/animation/euler_rotation.md
翻页动画https://defold.com/llms/examples/animation/flipbook.md
Spine 动画https://defold.com/llms/examples/animation/spine.md
旋转动画https://defold.com/llms/examples/animation/spinner.md
补间动画https://defold.com/llms/examples/animation/basic_tween.md
补间动画链https://defold.com/llms/examples/animation/chained_tween.md

基础

示例URL
消息传递https://defold.com/llms/examples/basics/message_passing.md
父级/子级https://defold.com/llms/examples/basics/parent_child.md
随机数https://defold.com/llms/examples/basics/random_numbers.md
Z 顺序https://defold.com/llms/examples/basics/z_order.md

集合

示例URL
代理https://defold.com/llms/examples/collection/proxy.md
启动画面https://defold.com/llms/examples/collection/splash.md
时间步长https://defold.com/llms/examples/collection/timestep.md

调试

示例URL
物理调试https://defold.com/llms/examples/debug/physics.md
可视化性能分析器https://defold.com/llms/examples/debug/profile.md

工厂

示例URL
动态工厂https://defold.com/llms/examples/factory/dynamic.md
发射子弹https://defold.com/llms/examples/factory/bullets.md
使用集中管理器生成敌人https://defold.com/llms/examples/factory/spawn_manager.md
使用脚本属性生成敌人https://defold.com/llms/examples/factory/spawn_properties.md
生成游戏对象https://defold.com/llms/examples/factory/basic.md

文件

示例URL
加载 JSON 数据https://defold.com/llms/examples/file/json_load.md
保存和加载https://defold.com/llms/examples/file/sys_save_load.md

GUI

示例URL
按钮https://defold.com/llms/examples/gui/button.md
拖动https://defold.com/llms/examples/gui/drag.md
获取和设置 GUI 字体资源https://defold.com/llms/examples/gui/get_set_font.md
获取和设置 GUI 材质资源https://defold.com/llms/examples/gui/get_set_material.md
获取和设置 GUI 纹理资源https://defold.com/llms/examples/gui/get_set_texture.md
GUI 颜色https://defold.com/llms/examples/gui/color.md
GUI 进度指示器https://defold.com/llms/examples/gui/progress.md
生命值条https://defold.com/llms/examples/gui/healthbar.md
布局https://defold.com/llms/examples/gui/layouts.md
加载纹理https://defold.com/llms/examples/gui/load_texture.md
指针悬停https://defold.com/llms/examples/gui/pointer_over.md
九宫格切片https://defold.com/llms/examples/gui/slice9.md
模板https://defold.com/llms/examples/gui/stencil.md

输入

示例URL
八方向移动https://defold.com/llms/examples/input/move.md
按下时长https://defold.com/llms/examples/input/down_duration.md
实体拾取https://defold.com/llms/examples/input/entity_picking.md
鼠标和触摸事件https://defold.com/llms/examples/input/mouse_and_touch.md
文本输入https://defold.com/llms/examples/input/text.md

材质

示例URL
自定义精灵https://defold.com/llms/examples/material/custom_sprite.md
噪声着色器https://defold.com/llms/examples/material/noise.md
重复背景https://defold.com/llms/examples/material/repeating_background.md
屏幕空间https://defold.com/llms/examples/material/screenspace.md
精灵局部 UVhttps://defold.com/llms/examples/material/sprite_local_uv.md
精灵顶点颜色属性https://defold.com/llms/examples/material/vertexcolor.md
无光照https://defold.com/llms/examples/material/unlit.md
UV 渐变https://defold.com/llms/examples/material/uvgradient.md

网格

示例URL
网格(三角形)https://defold.com/llms/examples/mesh/triangle.md
纹理网格https://defold.com/llms/examples/mesh/textured.md

模型

示例URL
AABBhttps://defold.com/llms/examples/model/aabb.md
角色https://defold.com/llms/examples/model/character.md
立方体贴图反射https://defold.com/llms/examples/model/cubemap.md
GLTFhttps://defold.com/llms/examples/model/gltf.md
GPU 蒙皮https://defold.com/llms/examples/model/skinning.md
模型顶点颜色https://defold.com/llms/examples/model/modelvertexcolor.md
天空盒https://defold.com/llms/examples/model/skybox.md

移动

示例URL
第一人称 3D 摄像机和移动https://defold.com/llms/examples/movement/3d_fps.md
跟随输入https://defold.com/llms/examples/movement/follow.md
朝向目标https://defold.com/llms/examples/movement/look_at.md
朝向旋转https://defold.com/llms/examples/movement/look_rotation.md
向前移动https://defold.com/llms/examples/movement/move_forward.md
移动到目标https://defold.com/llms/examples/movement/move_to.md
移动速度https://defold.com/llms/examples/movement/movement_speed.md
移动游戏对象https://defold.com/llms/examples/movement/simple_move.md

粒子

示例URL
修改器https://defold.com/llms/examples/particles/modifiers.md
粒子效果https://defold.com/llms/examples/particles/particlefx.md
粒子效果发射空间https://defold.com/llms/examples/particles/particlefx_emission_space.md
彩纸屑https://defold.com/llms/examples/particles/confetti.md
火焰和烟雾https://defold.com/llms/examples/particles/fire_and_smoke.md
烟花https://defold.com/llms/examples/particles/fireworks.md

物理

示例URL
动态物理https://defold.com/llms/examples/physics/dynamic.md
铰链关节物理https://defold.com/llms/examples/physics/hinge_joint.md
运动学物理https://defold.com/llms/examples/physics/kinematic.md
击退https://defold.com/llms/examples/physics/knockback.md
摆锤物理https://defold.com/llms/examples/physics/pendulum.md
射线检测https://defold.com/llms/examples/physics/raycast.md
触发器https://defold.com/llms/examples/physics/trigger.md

渲染

示例URL
摄像机https://defold.com/llms/examples/render/camera.md
环绕摄像机https://defold.com/llms/examples/render/orbit_camera.md
后期处理https://defold.com/llms/examples/render/post_processing.md
屏幕坐标转世界坐标https://defold.com/llms/examples/render/screen_to_world.md
世界坐标转屏幕坐标https://defold.com/llms/examples/render/world_to_screen.md

资源

示例URL
创建图集https://defold.com/llms/examples/resource/create_atlas.md
修改图集https://defold.com/llms/examples/resource/modify_atlas.md

音效

示例URL
淡入淡出https://defold.com/llms/examples/sound/fade_in_out.md
获取和设置音效https://defold.com/llms/examples/sound/get_set_sound.md
音乐https://defold.com/llms/examples/sound/music.md
声像https://defold.com/llms/examples/sound/panning.md

精灵

示例URL
Bunnymarkhttps://defold.com/llms/examples/sprite/bunnymark.md
更改精灵图像https://defold.com/llms/examples/sprite/changeimage.md
翻转https://defold.com/llms/examples/sprite/flip.md
多个精灵采样器https://defold.com/llms/examples/sprite/samplers.md
精灵光标https://defold.com/llms/examples/sprite/cursor.md
精灵大小https://defold.com/llms/examples/sprite/size.md
精灵色调https://defold.com/llms/examples/sprite/tint.md

瓦片地图

示例URL
获取和设置瓦片https://defold.com/llms/examples/tilemap/get_set_tile.md
瓦片地图碰撞https://defold.com/llms/examples/tilemap/collisions.md

计时器

示例URL
取消计时器https://defold.com/llms/examples/timer/cancel_timer.md
重复计时器https://defold.com/llms/examples/timer/repeating_timer.md
触发计时器https://defold.com/llms/examples/timer/trigger_timer.md

用法

当你需要了解如何在 Defold 中实现某项功能的实用示例时:

  1. 确定主题(例如“工厂生成”“物理射线检测”“GUI 按钮”)
  2. 在上面的表格中找到匹配的条目
  3. 获取对应的 URL(所有 URL 都是纯 Markdown 格式——获取并阅读原始内容)
  4. 示例:获取 https://defold.com/llms/examples/factory/basic.md

评论

支持 Markdown