Class TimelineHandle
A grip on a boundary of a Timeline's axis, the end of a range whose extent the lane already shows, for instance.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class TimelineHandle : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The handle has no look of its own beyond its focus ring: the host draws the edge, and this is
the hit area astride it that drags it. Add it to a TimelineTrack. Dragging with
the primary button reports the time under the pointer through dragMove, snapped
to step and clamped to [min, max], and commits it once on
release through changed. The boundary follows the pointer from where it was
grabbed, and a press that never moves commits nothing. A lost pointer raises
dragCanceled.
It is focusable. The left and right arrows move it by keyStep, Home and End to either bound, and a keyboard move pans the Timeline to keep it in view. It sits above the playhead for picking, so a grip parked at the playhead's time is still the one grabbed.
Examples
var end = new TimelineHandle { time = 48f };
end.changed += t => clipLength = t;
track.Add(end);
Constructors
TimelineHandle()
Default constructor.
Declaration
public TimelineHandle()
Fields
ussClassName
The TimelineHandle main styling class.
Declaration
public const string ussClassName = "appui-timeline__handle"
Field Value
| Type | Description |
|---|---|
| string |
Properties
keyStep
How far one arrow key moves it, in time units. Zero, the default, uses the Timeline's step, else a hundredth of the range.
Declaration
[Tooltip("How far one arrow key moves it. Zero uses the Timeline's step, else a hundredth of the range.")]
[CreateProperty]
[UxmlAttribute]
public float keyStep { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
max
The latest time it can be dragged to. Negative, the default, is the Timeline's duration.
Declaration
[Tooltip("The latest time it can be dragged to. Negative is the Timeline's duration.")]
[CreateProperty]
[UxmlAttribute]
public float max { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
min
The earliest time it can be dragged to. Zero by default.
Declaration
[Tooltip("The earliest time it can be dragged to.")]
[CreateProperty]
[UxmlAttribute]
public float min { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
resolvedMax
The upper bound actually applied: max, or the Timeline's duration.
Declaration
public float resolvedMax { get; }
Property Value
| Type | Description |
|---|---|
| float |
time
Where the handle sits, in time units.
Declaration
[Tooltip("Where the handle sits, in time units.")]
[CreateProperty]
[UxmlAttribute]
public float time { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
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.
Events
changed
Raised with the committed time: once on a drag's release, and on every key that moves it.
Declaration
public event Action<float> changed
Event Type
| Type | Description |
|---|---|
| Action<float> |
dragCanceled
Raised when a drag is lost before release. Discard any preview held from dragMove.
Declaration
public event Action dragCanceled
Event Type
| Type | Description |
|---|---|
| Action |
dragMove
Raised on every pointer move during a drag with the time under the pointer, for a live preview.
Declaration
public event Action<float> dragMove
Event Type
| Type | Description |
|---|---|
| Action<float> |