Skip to main content

Graphic

The Graphic class is a component which interacts with Unity Images on UI.

caution

The Graphic class is only compatible with Image and RawImage.

To get a Graphic from an item, use the GetComponent method.

let graphicComponent = item.GetComponent("Graphic")

You can then use the graphicComponent property to access the Graphic class.

Methods

Method NameReturn TypeParametersDescription
SetImageFromAssetvoidstringSets the image's texture from the World's Resources
SetImageFromTexturevoidTextureSets the image from a Texture object

Properties

Property NameTypeDescription
EnabledboolChecks the active state of the component
RawEnabledboolChecks the active state of the RawImage component