Skip to main content

Image

info

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

NameDescription
Image.colorThe color to apply to the image.
Image.materialThe Material to use for rendering the image.
Image.preserveAspectEnsure the image retains its existing dimension.
Image.raycastTargetEnable Raycast Target if you want Unity to consider the image a target for raycasting.
Image.spriteThe Texture that represents the image to display (which must be imported as a Sprite).

Methods

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

Inherited Members

Inherited Properties

NameDescription
Image.enabledEnabled Behaviours are Updated, disabled Behaviours are not.
Image.isActiveAndEnabledHas the Behaviour had active and enabled called?
Image.gameObjectThe game object this component is attached to. A component is always attached to a game object.
Image.tagThe tag of this game object.
Image.transformThe Transform attached to this GameObject.
Image.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
Image.nameThe name of the object.

Inherited Methods

NameDescription
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.