- Home /
Gizmos.DrawIcon - is it possible to scale the icon?
I'm writing an editor tool and am trying to use Gizmos.DrawIcon to provide additional information about my object (you know, more than a shaded box communicates).
Gizmos.DrawIcon does not specify a draw size. There's an optional third parameter:
static void DrawIcon(Vector3 center, string name, bool allowScaling = true);
Which just toggles whether the icon is drawn in screen space or world space. Not useful.
Scaling the source art has no impact, which is additionally baffling.
I tried scaling the Gizmos matrix before calling DrawIcon, like so:
Gizmos.matrix = Gizmos.matrix * Matrix4x4.Scale(new Vector3(5.0f,5.0f,5.0f));
That didn't work either.
I even tried adjusting the draw location of the icon along z-space and it has no impact.
Do people just not use this feature?? I don't understand how it even exists if you can't control how the icon image is drawn in the editor!
Open to alternatives! Thanks :)
David
I'm pretty sure gizmos all end up being the same size. You can save your gizmo as a png with a transparent background. That way you can make the gizmo smaller in relation to other gizmos
Answer by AAK_Lebanon · Jan 13, 2017 at 08:51 PM
allowScaling parameter allow you to change the icon size in the editor when you play with the slide of the 3D Icons (from the Gizoms menu)
It is very annoying that I can't change the icon in the editor before the user is enforced to change this size to be able to see it in the editor...
Answer by zwxbest · Aug 27, 2016 at 01:18 PM
I think the allowScaling parameter means the scale of icon is parallel with the scale of gameobject which icon binding to when you use you middle button of mouse to scale the gameobject in scene view.
Your answer
![](https://koobas.hobune.stream/wayback/20220613155456im_/https://answers.unity.com/themes/thub/images/avi.jpg)