Image
7/14/25About 2 min
Image
Info
Image inherits from [Behaviour](/docs/create/lua/API/Behaviour/index.html)
The Image control displays a non-interactive image to the user. You can use this for purposes such as decorations or icons, and you can change the image from a script to reflect changes in other controls.
Members
Properties
| Name | Description |
|---|---|
Image.color | The color to apply to the image. |
Image.material | The Material to use for rendering the image. |
Image.preserveAspect | Ensure the image retains its existing dimension. |
Image.raycastTarget | Enable Raycast Target if you want Unity to consider the image a target for raycasting. |
Image.sprite | The Texture that represents the image to display (which must be imported as a Sprite). |
Methods
| Name | Description |
|---|---|
Image.SetNativeSize() | Set the dimensions of the image box to the original pixel size of the Texture. |
Inherited Members
Inherited Properties
| Name | Description |
|---|---|
Image.enabled | Enabled Behaviours are Updated, disabled Behaviours are not. |
Image.isActiveAndEnabled | Has the Behaviour had active and enabled called? |
Image.gameObject | The game object this component is attached to. A component is always attached to a game object. |
Image.tag | The tag of this game object. |
Image.transform | The Transform attached to this GameObject. |
Image.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
Image.name | The name of the object. |
Inherited Methods
| Name | Description |
|---|---|
Image.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
Image.CompareTag(tag) | Is this game object tagged with tag ? |
Image.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
Image.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
Image.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
Image.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
Image.GetComponents(type) | Returns all components of Type type in the GameObject. |
Image.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
Image.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
Image.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
Image.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
Image.TryGetComponent(type) | Gets the component of the specified type, if it exists. |
Image.GetInstanceID() | Returns the instance id of the object. |

