docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class DensityContext

    The Density context of the application.

    Inheritance
    object
    DensityContext
    Implements
    IContext
    IEquatable<DensityContext>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Core
    Assembly: Unity.AppUI.dll
    Syntax
    public record DensityContext : IContext, IEquatable<DensityContext>
    Remarks

    Density is the design-system sizing axis. Valid values are normal, compact and comfort, matching the density token sets shipped by @unity/app-ui-tokens. It is unrelated to scaleFactor, which is the native display DPI.

    Constructors

    DensityContext(string)

    The Density context of the application.

    Declaration
    public DensityContext(string density)
    Parameters
    Type Name Description
    string density

    The density.

    Remarks

    Density is the design-system sizing axis. Valid values are normal, compact and comfort, matching the density token sets shipped by @unity/app-ui-tokens. It is unrelated to scaleFactor, which is the native display DPI.

    Properties

    density

    The current density.

    Declaration
    public string density { get; }
    Property Value
    Type Description
    string

    Implements

    IContext
    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)