skills/figma2cocos/SKILL.md
在用户提供CSS样式且包含 width / height / left / top 4个属性时使用figma2cocos技能
npx skillsauth add 958877748/skills figma2cocosInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
figma中设计分辨率是w1080 h2340 figma中坐标都是以左上角为0,0 cocos中是以屏幕中心为0,0
一个例子 用户输入css 其实是某个figma节点的属性 width: 68; height: 68; top: 438px; left: 968px;
这个节点在cocos中的计算是 x = left - 1080/2 + 68/2 y = 2340/2 - top - 68/2
1.进行计算 x = 968 - 1080/2 + 68/2 = 968 - 540 + 34 = 462 y = 2340/2 - 438 - 68/2 = 1170 - 438 - 34 = 698
2.再次重算核对结果
3.给用户返回计算出的x和y的值
4.如果包含 font-size 属性,给用户返回加上 字体大小是xx
注意:其余属性忽视
tools
Cocos Creator 2.4.x 场景/预制体命令行工具,支持读写 .fire/.prefab、JSON 生成 UI、截图预览
development
查询公网IP地址的地理位置信息,包括国家、省份、城市、ISP、时区等
tools
Cocos Creator 有限状态机 (FSM) 实现,用于管理游戏对象的状态转换
tools
Cocos Creator 2.4.x 粒子系统修饰器开发框架。用于创建、使用和调试自定义粒子修饰器,支持修改粒子位置、颜色、大小、旋转、速度等属性。当需要在 Cocos Creator 中实现复杂的粒子效果控制时使用此技能。