Class Image
A VisualElement representing a source texture.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class Image : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
Image()
Constructor.
Declaration
public Image()
Fields
ussClassName
USS class name of elements of this type.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Properties
image
The texture to display in this image.
Declaration
public Texture image { get; set; }
Property Value
Type | Description |
---|---|
Texture |
scaleMode
ScaleMode used to display the Image.
Declaration
public ScaleMode scaleMode { get; set; }
Property Value
Type | Description |
---|---|
ScaleMode |
sourceRect
The source rectangle inside the texture relative to the top left corner.
Declaration
public Rect sourceRect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
sprite
The sprite to display in this image.
Declaration
public Sprite sprite { get; set; }
Property Value
Type | Description |
---|---|
Sprite |
tintColor
Tinting color for this Image.
Declaration
public Color tintColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
uv
The base texture coordinates of the Image relative to the bottom left corner.
Declaration
public Rect uv { get; set; }
Property Value
Type | Description |
---|---|
Rect |
vectorImage
The VectorImage to display in this image.
Declaration
public VectorImage vectorImage { get; set; }
Property Value
Type | Description |
---|---|
VectorImage |
Methods
DoMeasure(Single, VisualElement.MeasureMode, Single, VisualElement.MeasureMode)
Declaration
protected override Vector2 DoMeasure(float desiredWidth, VisualElement.MeasureMode widthMode, float desiredHeight, VisualElement.MeasureMode heightMode)
Parameters
Type | Name | Description |
---|---|---|
Single | desiredWidth | |
VisualElement.MeasureMode | widthMode | |
Single | desiredHeight | |
VisualElement.MeasureMode | heightMode |
Returns
Type | Description |
---|---|
Vector2 |