Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

GridLine

struct in UnityEngine.UIElements

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A single placement value for grid-column-start, grid-column-end, grid-row-start and grid-row-end: auto, an explicit line (an integer >= 1), or span <n> (n >= 1).

The value is sign-encoded into a single blittable int so it mirrors the native field 1:1: 0 = auto, > 0 = line, < 0 = span(-value). This mirrors how aspect-ratio uses a sentinel value rather than a separate flag.

Static Properties

Property Description
Auto auto: the edge is resolved by grid auto-placement.

Properties

Property Description
isAutoWhether this value is auto.
isLineWhether this value is an explicit line.
isSpanWhether this value is a span.
lineThe 1-based line index when GridLine.isLine is true; otherwise 0.
placementWhich kind of placement this value represents.
spanThe span count when GridLine.isSpan is true; otherwise 0.

Public Methods

Method Description
ToStringThe USS text form: auto, span <n>, or the line number.

Static Methods

Method Description
AtLineAn explicit 1-based grid line.
SpanA span of count tracks from the opposite edge.

Operators

Operator Description
GridLineConverts a positive integer to an explicit line; 0 and negatives throw.