Skip to content

API > Image


Image⚓︎

Image inherits from Behaviour

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.colorProperty The color to apply to the image.
Image.materialProperty The Material to use for rendering the image.
Image.preserveAspectProperty Ensure the image retains its existing dimension.
Image.raycastTargetProperty Enable Raycast Target if you want Unity to consider the image a target for raycasting.
Image.spriteProperty The Texture that represents the image to display (which must be imported as a Sprite).

Methods⚓︎

Name Description
Image.SetNativeSize() Method Set the dimensions of the image box to the original pixel size of the Texture.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
Image.enabledProperty Enabled Behaviours are Updated, disabled Behaviours are not.
Image.isActiveAndEnabledProperty Has the Behaviour had active and enabled called?
Image.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
Image.tagPropertyReadonly Property The tag of this game object.
Image.transformPropertyReadonly Property The Transform attached to this GameObject.
Image.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
Image.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
Image.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
Image.CompareTag(tag)Method Is this game object tagged with tag ?
Image.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
Image.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
Image.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
Image.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
Image.GetComponents(type)Method Returns all components of Type type in the GameObject.
Image.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
Image.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
Image.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
Image.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
Image.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
Image.GetInstanceID()Method Returns the instance id of the object.