docs.unity3d.com
    Show / Hide Table of Contents

    Struct Background

    Describes a VisualElement background.

    Namespace: UnityEngine.UIElements
    Syntax
    public struct Background : IEquatable<Background>

    Constructors

    Background(Texture2D)

    Creates from a .

    Declaration
    public Background(Texture2D t)
    Parameters
    Type Name Description
    Texture2D t

    Properties

    renderTexture

    The to display as a background.

    Declaration
    public RenderTexture renderTexture { get; set; }
    Property Value
    Type Description
    RenderTexture

    sprite

    The sprite to display as a background.

    Declaration
    public Sprite sprite { get; set; }
    Property Value
    Type Description
    Sprite

    texture

    The texture to display as a background.

    Declaration
    public Texture2D texture { get; set; }
    Property Value
    Type Description
    Texture2D

    vectorImage

    The VectorImage to display as a background.

    Declaration
    public VectorImage vectorImage { get; set; }
    Property Value
    Type Description
    VectorImage

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean

    Equals(Background)

    Declaration
    public bool Equals(Background other)
    Parameters
    Type Name Description
    Background other
    Returns
    Type Description
    Boolean

    FromRenderTexture(RenderTexture)

    Creates a background from a .

    Declaration
    public static Background FromRenderTexture(RenderTexture rt)
    Parameters
    Type Name Description
    RenderTexture rt

    The render texture to use as a background.

    Returns
    Type Description
    Background

    A new background object.

    FromSprite(Sprite)

    Creates a background from a .

    Declaration
    public static Background FromSprite(Sprite s)
    Parameters
    Type Name Description
    Sprite s

    The sprite to use as a background.

    Returns
    Type Description
    Background

    A new background object.

    FromTexture2D(Texture2D)

    Creates a background from a .

    Declaration
    public static Background FromTexture2D(Texture2D t)
    Parameters
    Type Name Description
    Texture2D t

    The texture to use as a background.

    Returns
    Type Description
    Background

    A new background object.

    FromVectorImage(VectorImage)

    Creates a background from a VectorImage.

    Declaration
    public static Background FromVectorImage(VectorImage vi)
    Parameters
    Type Name Description
    VectorImage vi

    The vector image to use as a background.

    Returns
    Type Description
    Background

    A new background object.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Operators

    Equality(Background, Background)

    Declaration
    public static bool operator ==(Background lhs, Background rhs)
    Parameters
    Type Name Description
    Background lhs
    Background rhs
    Returns
    Type Description
    Boolean

    Inequality(Background, Background)

    Declaration
    public static bool operator !=(Background lhs, Background rhs)
    Parameters
    Type Name Description
    Background lhs
    Background rhs
    Returns
    Type Description
    Boolean
    In This Article
    • Constructors
      • Background(Texture2D)
    • Properties
      • renderTexture
      • sprite
      • texture
      • vectorImage
    • Methods
      • Equals(Object)
      • Equals(Background)
      • FromRenderTexture(RenderTexture)
      • FromSprite(Sprite)
      • FromTexture2D(Texture2D)
      • FromVectorImage(VectorImage)
      • GetHashCode()
      • ToString()
    • Operators
      • Equality(Background, Background)
      • Inequality(Background, Background)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023