Hello,
I want to use the com.unity.vectorgraphics
package to get SVG images in my UI Toolkit views. But it seems to skip holes in the imported asset. I tried any “Generated Asset Type” element, and it doesn’t draw holes at all.
The SVG I have (exported from Figma and display in browser):
The imported SVG in Unity:
I know it is an experimental package, but it is a really important feature for our game
Last I checked the vector graphic package “strikes” your vector image to a particular pixel size, hence all the teselation and resolution settings… and from what you post above, it clearly can’t handle all SVG features.
Given the importance of this feature to your game, you might have better luck either:
- striking it to a PNG yourself and importing it at whatever size you need, importing and using that
OR
- if you need crisp unlimited scaling, importing the SVG into a 3D program (such as Blender3D), then turning it into a flat piece of geometry and importing that. In that case I think you use the
MeshGenerationContext
class to create a custom VisualElement
but don’t quote me on that exact flow since I haven’t used it personally yet.
1 Like