Class TimelineRuler
The time ruler at the top of a Timeline.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelineRuler : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The ruler draws one tick per minorTick across the duration and labels
every majorTick. Dragging it seeks the playhead; Shift + dragging draws
a range selection into selection. Set seekOnClick to
false for a purely decorative ruler.
A Timeline creates its own ruler — reach it through ruler rather than adding a second one.
Constructors
TimelineRuler()
Default constructor.
Declaration
public TimelineRuler()
Fields
majorTickUssClassName
The styling class of a major, labelled tick.
Declaration
public const string majorTickUssClassName = "appui-timeline__ruler-tick--major"
Field Value
| Type | Description |
|---|---|
| string |
tickLabelUssClassName
The styling class of a major tick's label.
Declaration
public const string tickLabelUssClassName = "appui-timeline__ruler-label"
Field Value
| Type | Description |
|---|---|
| string |
tickUssClassName
The styling class of one ruler tick.
Declaration
public const string tickUssClassName = "appui-timeline__ruler-tick"
Field Value
| Type | Description |
|---|---|
| string |
ticksTopUssClassName
The styling class applied while the ticks hang from the ruler's top edge.
Declaration
public const string ticksTopUssClassName = "appui-timeline__ruler--ticks-top"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The TimelineRuler main styling class.
Declaration
public const string ussClassName = "appui-timeline__ruler"
Field Value
| Type | Description |
|---|---|
| string |
Properties
seekOnClick
Whether dragging the ruler seeks the playhead.
Declaration
[Tooltip("Whether dragging the ruler seeks the playhead.")]
[CreateProperty]
[UxmlAttribute]
public bool seekOnClick { 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.