Class TimelinePlayhead
The playhead scrubber of a Timeline.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelinePlayhead : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
A full-height line with a grab handle at the top, sitting at value. Dragging it seeks; it is focusable and answers the left and right arrows by one step, and Home and End by jumping to either end of the duration. Turn on showLabel for a bubble showing the formatted current time.
A Timeline creates its own playhead — reach it through playhead.
Constructors
TimelinePlayhead()
Default constructor.
Declaration
public TimelinePlayhead()
Fields
handleUssClassName
The styling class of the playhead's grab handle.
Declaration
public const string handleUssClassName = "appui-timeline__playhead-handle"
Field Value
| Type | Description |
|---|---|
| string |
labelUssClassName
The styling class of the playhead's time bubble.
Declaration
public const string labelUssClassName = "appui-timeline__playhead-label"
Field Value
| Type | Description |
|---|---|
| string |
lineUssClassName
The styling class of the playhead's vertical line.
Declaration
public const string lineUssClassName = "appui-timeline__playhead-line"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The TimelinePlayhead main styling class.
Declaration
public const string ussClassName = "appui-timeline__playhead"
Field Value
| Type | Description |
|---|---|
| string |
Properties
showHandle
Whether the grab handle is drawn at the top of the line.
Declaration
[Tooltip("Whether the grab handle is drawn at the top of the line.")]
[CreateProperty]
[UxmlAttribute]
public bool showHandle { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
showLabel
Whether the formatted current time is shown in a bubble.
Declaration
[Tooltip("Whether the formatted current time is shown in a bubble.")]
[CreateProperty]
[UxmlAttribute]
public bool showLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
ContainsPoint(Vector2)
The playhead is drawn above the lanes, so it gives way to a TimelineHandle under the same point: a grip parked at the playhead's time stays grabbable.
Declaration
public override bool ContainsPoint(Vector2 localPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | localPoint | The point, in this element's space. |
Returns
| Type | Description |
|---|---|
| bool | Whether the playhead takes the point. |
Overrides
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.