Convert Figma designs to. NET MAUI Graphics code

Convert Figma designs to. NET MAUI Graphics code

Use FigmaSharp. Maui.Graphics to convert Figma designs to. NET MAUI Graphics code.

最后更新 9/23/2022 11:42 AM
jsuarezruiz
预计阅读 2 分钟
分类
.NET
标签
.NET C# MAUI Figma

原文链接: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:

  1. Use a personal access token to access the Figma document.
  2. Get all the information and create a node hierarchy that we can iterate or manipulate.
  3. 获取节点后,它会为.NET MAUI Graphics生成 C# 代码。
  4. 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 AccountAccount 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.

Code released under MIT license.

Keep Exploring

延伸阅读

更多文章
同分类 / 同标签 9/21/2023

Comparative analysis of cross-platform frameworks based on XAML

Over the years, XAML-based UI frameworks have developed a lot. These frameworks mainly include: Avalonia UI, Uno Platform and. NET MAUI that support cross-platform applications. If Microsoft had launched a cross-platform UI framework like Flutter earlier, we might not have had so many options.

继续阅读
同分类 / 同标签 4/22/2026

Support for. NET by operating system versions (250707 update)

Use virtual machines and test machines to test the support of each version of the operating system for. NET. After installing the operating system, it is passed by measuring the corresponding running time of the installation and being able to run the Stardust Agent.

继续阅读