Repository navigation
v1.0.0
First public version.
Exporter (Affinity)
- One screen per artboard, or the whole spread. A dialog asks for the folder, the name, the artboards and the sprite scale (0.5x to 4x) and remembers them in the document.
- Text stays live: fonts, sizes, colours, tracking, leading, alignment, paragraph spacing, shadow, glow, outline, linear gradients and colour overlays. Text with other effects is baked.
- Everything else is rendered by Affinity itself, with its effects and blend modes. Layers with Add, Screen or Multiply, and outer glows with Screen or Add, stay separate and blend with what is below them in the game.
- Anchors are inferred from the layout. The painted scene behind the UI is recognised and left out.
- Layer name tags for what cannot be guessed:
[anchor:...],[stretch],[9slice:...],[split],[bake],[live],[mock]. - A report in the file says what was decided about the layers, and which fonts are missing.
Importer (Unity)
.affuifiles become uGUI prefabs withImageandTextMeshProUGUI. New exports update the prefab by the ids of the layers, and Prefab Variants keep their overrides.- The sprites of a screen share a compressed atlas. Uniform middles are cut out and sliced, smooth pictures are stored smaller.
- Backgrounds cover screens of other proportions (
AffinityCover). - A Font Map connects the fonts of the design with TextMesh Pro font assets, and a menu command creates them.
AffinityGammaUIFeaturefor URP blends the UI in sRGB in Linear projects, as Affinity does.- "Demo Screens" sample.
Install
- Affinity: import
export-to-unity.afscriptbelow into the Scripts Library, as in the quick start. - Unity: Package Manager, Install package from git URL:
https://github.com/matbcontrol/affinity-ui-exporter.git?path=/unity/com.matbcontrol.affinity-ui-exporter#v1.0.0