Just trying to find a way of using a single sprite from a sprite sheet with multiple sprites as the texture for a custom editor window label/button.
So to make it a bit clearer:
-Get a individual sprite from a multiple sprite sheet
-Get it’s texture
-Assign it to EditorGUI Label/Button
-???
-Profit!
Currently using the selected sprite’s texture works, but displays the entire sheet instead of just the one sprite.
You can’t easily specify texture coordinates with EditorGUI.LabelField, GUI.Label, or GUI.Button. You could pass them a custom GUIStyle with clipping=true and imagePosition set to the correct sprite in the texture, but this seems kind of klunky. Can you use GUI.DrawTextureWithTexCoords instead?