UIBlock2D.SetImage
SetImage(Texture2D)
Render the provided texture
in the body of this UIBlock2D. Replaces any existing image assignment.
Declaration
public void SetImage(Texture2D texture)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to render in the body of this UIBlock2D. |
SetImage(RenderTexture)
Render the provided renderTexture
in the body of this UIBlock2D. Replaces any existing image assignment.
Declaration
public void SetImage(RenderTexture renderTexture)
Parameters
Type | Name | Description |
---|---|---|
RenderTexture | renderTexture | The texture to render in the body of this UIBlock2D. |
SetImage(Sprite)
Render the provided sprite
in the body of this UIBlock2D. Replaces any existing image assignment.
Remarks
Sliced sprites and UnityEngine.SpritePackingMode.Tight packed sprites are not supported.
Declaration
public void SetImage(Sprite sprite)
Parameters
Type | Name | Description |
---|---|---|
Sprite | sprite | The sprite to render in the body of this UIBlock2D. |