Back to skills
SKILL.md
Figma2cocos
ASecurity在用户提供CSS样式且包含 width / height / left / top 4个属性时使用figma2cocos技能
- 225 stars
- 0 votes
- 0 copies
- 5 views
- Added September 4, 2026
Security analysis
100/100Pro scans all 13 files and shows the line behind each finding
npx -y skills add NeverSight/skills_feed --skill figma2cocos --agent claude-codeAre you the author of Figma2cocos?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/neversight-figma2cocos)---
name: figma2cocos
description: 在用户提供CSS样式且包含 width / height / left / top 4个属性时使用figma2cocos技能
---
# 背景知识
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
注意:其余属性忽视Files in this skill
- SKILL.md
- description_ar.txt
- description_cn.txt
- description_de.txt
- description_en.txt
- description_es.txt
- description_fr.txt
- description_it.txt
- description_ja.txt
- description_ko.txt
- description_ru.txt
- description_tw.txt
- stats.json
Attribution
Related skills
View all in tools →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.