public sealed class EditorIconAttributeDeclares what a type looks like, as SVG path data or a file beside its assembly.
As a annotation
- Valid on
- Class, Struct
Remarks
Doc 36 § D6, spelled the way doc 36 spells it. This was documented as a mechanism that could not be built — "there is no SVG path parser in this repository and its absence is a decision" — and the decision was that turning M12 2L2 22h20z into segments belongs to an asset pipeline. There is a parser now (SvgPath), it is a hundred and fifty lines, and the argument it was resting on does not survive that: a component's icon is one string, and asking every game to register one in code was asking them to transcribe path data into LineTo calls by hand.
[EditorIcon("M12 2 2 22h20z", Tint = "#7cc4ff")] public struct Health { … } [EditorIcon("Icons/health.svg")] public struct Stamina { … }
⚠ Two forms, told apart by the extension, because both are what people actually have. An icon copied out of Material or Lucide is a d string and wants no file and no IO; an icon a designer drew is an .svg on disk beside the plugin. Anything ending in .svg is a path relative to the declaring plugin's directory, and anything else is the data itself.
⚠ A bad icon is a diagnostic, never an exception. The string is written by somebody who is not here, and one component with a stray character in its path data must not be a plugin that will not load — the same rule PluginDiscovery keeps for a manifest that does not parse.
Fields and properties (4)
public string SourceThe path data, or the file.
public string TintWhat to fill it with — #rrggbb, or empty for the inherited text colour.
public float ViewBoxThe grid the data was drawn against. Twenty-four square unless it says otherwise.
public int OrderWhich of two declarations for one type wins; the higher one.
Methods (2)
public EditorIconAttribute(string source)Declares what a type looks like, as SVG path data or a file beside its assembly.
public IconArt? Resolve(string directory, out string? reason)Turns the declaration into art.
Used by (1)
- DeclaredContributionsVixen.Editor.App