原文链接:https://github.com/jsuarezruiz/figma-to-maui-graphics
Original author: jsuarezruiz
Translation: Wolf at the end of the desert (Google Translate added), translation is awkward, it is recommended to read the original directly
Use FigmaSharp.Maui.Graphics to convert a Figma design to. NET MAUI Graphics code. Based on the MIT protocol, it is free and open source. Give a picture about the MIT protocol to understand for yourself.

** Continue introduction: **
Two thumbnails to see the effect:


Tools available on Windows and macOS perform the following steps:
- Use a personal access token to access the Figma document.
- Get all the information and create a node hierarchy that we can iterate or manipulate.
- 获取节点后,它会为.NET MAUI Graphics生成 C# 代码。
- After generating the code, it compiles the code to ensure that there are no generation errors.
You can copy and paste the code or export it directly to a file.
注意: 这个项目使用并扩展了 FigmaSharp。
Keep in mind that this tool generates C#code for. NET MAUI Graphics, not XAML or C#code using. NET MAUI views.
entry
访问figma.com的文档您需要生成个人访问令牌(Personal Access Token)。登录 Figma 并在主菜单中,转到Help and Account → Account Settings并选择Create new token。这将是您复制令牌的唯一机会,因此请确保将副本保存在安全的地方。
您有问题、需要支持或想要贡献吗?使用 GitHub Issues 反应 bug 和功能请求。
Known limitations or issues
- 目前,所需的更改依赖于 .NET MAUI Graphics 或 FigmaSharp ,该工具不会生成矢量或自定义字体。
- Although it will be fixed soon, for now you need to set the root node in Figma to position 0,0.
copyright and license
Code released under MIT license.