Class TimelineGrid
The faint per-frame guide lines drawn across a Timeline's lanes.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelineGrid : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The grid is painted with Painter2D in one pass rather than as hundreds of
elements, so a fully zoomed-out timeline costs the same as an empty one. Its two colours are
custom style properties — --grid-minor-color and --grid-major-color — bound to App UI
tokens in Timeline.uss, so the painted lines follow the theme like everything else.
Minor lines are dropped below minMinorPxPerUnit effective pixels per unit, where they would alias into a solid wash.
Constructors
TimelineGrid()
Default constructor.
Declaration
public TimelineGrid()
Fields
ussClassName
The TimelineGrid main styling class.
Declaration
public const string ussClassName = "appui-timeline__grid"
Field Value
| Type | Description |
|---|---|
| string |
Properties
minMinorPxPerUnit
The effective pixels-per-unit below which minor lines are dropped.
Declaration
[Tooltip("The effective pixels-per-unit below which minor lines are dropped.")]
[CreateProperty]
[UxmlAttribute]
public float minMinorPxPerUnit { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
showMajor
Whether major-tick lines are drawn.
Declaration
[Tooltip("Whether major-tick lines are drawn.")]
[CreateProperty]
[UxmlAttribute]
public bool showMajor { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
showMinor
Whether minor-tick lines are drawn.
Declaration
[Tooltip("Whether minor-tick lines are drawn.")]
[CreateProperty]
[UxmlAttribute]
public bool showMinor { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
OnAxisChanged()
Re-project this part onto the current axis.
Declaration
protected override void OnAxisChanged()
Overrides
Remarks
Called on attach and on every axis change — a scale, zoom, pan, playhead, tick or
selection change. Guard against a null axis.