- Home /
Can I add an image as a label in a custom Inspector?
I have a custom inspector for a maze generation script. I made a custom inspector for it, with different fields for different types of blocks to tile (corners, branching walls, etc) so you can add your models needed to build the maze. To simplify the process, I want a small image next to each field to appear, so the user of the script can see how the blocks should be oriented when added. I cannot figure out how to add an image to the Inspector. It would just be like a label, but displaying an image instead of text.
Answer by tyjkenn · Jan 05, 2013 at 06:06 AM
I figured it out. I put the images in a folder called `Resources so I could use this:
private var myTexture : Texture = Resources.Load("file_name_without_extension");
Then I could use it as a label just like any GUI:
GUILayout.Label(myTexture);
Your answer
Follow this Question
Related Questions
Asset: Pimp my Editor - Javascript Help 0 Answers
Implementing a 2D array as a field on a ScriptableObject? 1 Answer
Edit existing editor inspector? 1 Answer
How do I create a JavaScript class that creates an object with viewable variables in the inspector? 3 Answers
Why is my class hidden in inspector with C# and not JS? 1 Answer