public sealed class TimelineTracks against time: keys, a playhead, a zoom and a snap.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Three parts, and only one of them is elements. The headers down the left are controls, because a track name is text and a mute button is a button. Everything to the right of them is drawn, because it is eight thousand diamonds whose positions are two multiplications each. That split is the same one TreeView makes between its rows and its scroll range, one level coarser.
⚠ Time and pixels are related by one number. PixelsPerSecond is the zoom and TimeStart is the pan, and everything — the ruler's tick spacing, a key's x, the playhead, the hit radius — goes through the two. A timeline that kept a separate visible range would have three numbers that could disagree.
⚠ Snapping is to frames, not to a grid. An animation is played back at a frame rate and a key between two frames is a key that plays on one of them anyway — so the snap that matters is FrameRate, and a pixel grid would put keys where no frame is.
⚠ A track holds instants or intervals, never both, and the two are drawn and hit tested differently — see TimelineTrackKind. A span is a bar with its ramps drawn on it rather than a pair of keys, because a pair of keys loses the association between the two the moment either is dragged, and because the shape of a fade is the thing an author is trying to see.
Fields and properties (41)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public TimelineRuler RulerThe strip of times along the top.
public UiElement HeadersThe column of names down the left.
public TimelineLanes LanesEverything to the right of the names.
public IReadOnlyList<TimelineTrack> TracksThe tracks, top to bottom.
public IReadOnlyList<TimelineHeader> HeaderRowsThe header elements that exist, including the parked ones.
public IReadOnlyCollection<TimelineKey> SelectionWhich keys are selected.
public IReadOnlyCollection<TimelineSpan> SpanSelectionWhich spans are selected.
public float Timepublic float Durationpublic float TimeStartpublic float PixelsPerSecondpublic float FrameRatepublic bool SnapToFramespublic float ScrollToppublic float TrackHeightHow tall a track is, from --track-height.
public float KeySizepublic float GripSizepublic int FirstVisibleTrackThe first track with any of it on screen.
public Rectangle? MarqueeThe rubber band, if one is being dragged.
public float TickStepHow far apart the ruler's ticks are, in seconds.
public Color4 GridColorThe tick and grid colour.
public Color4 StripeColorThe colour of every other lane.
public Color4 KeyColorA keyframe's colour.
public Color4 KeyActiveColorA selected keyframe's colour.
public Color4 PlayheadColorThe playhead's colour.
public Color4 MarqueeColorThe rubber band's colour.
public Color4 CurveColorThe colour of the trace behind a track's keys.
public Color4 SpanColorA span's colour.
public Color4 SpanActiveColorA selected span's colour.
public Color4 SpanGripColorThe colour of the handles at a span's ends.
public static readonly UiPropertyKey TimePropertyIdentity for Time.
public static readonly UiPropertyKey DurationPropertyIdentity for Duration.
public static readonly UiPropertyKey TimeStartPropertyIdentity for TimeStart.
public static readonly UiPropertyKey PixelsPerSecondPropertyIdentity for PixelsPerSecond.
public static readonly UiPropertyKey FrameRatePropertyIdentity for FrameRate.
public static readonly UiPropertyKey SnapToFramesPropertyIdentity for SnapToFrames.
public static readonly UiPropertyKey ScrollTopPropertyIdentity for ScrollTop.
public static readonly UiPropertyKey KeySizePropertyIdentity for KeySize.
public static readonly UiPropertyKey GripSizePropertyIdentity for GripSize.
Events (6)
public Action<Timeline, float>? TimeChangedRaised when the playhead moves.
public Action<Timeline>? SelectionChangedRaised when the selection changes.
public Action<Timeline>? KeysMovedRaised after a drag has moved some keys.
public Action<Timeline, TimelineSpan>? SpanMovedRaised after a drag has moved a span's ends.
public Action<Timeline, TimelineTrack, TimelineSpan>? SpanRemovedRaised after a double-tap has taken a span off its track.
public Action<Timeline, TimelineTrack, float>? SpanRequestedRaised when a double-tap asks for a span on an empty stretch of a span track.
Methods (25)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public TimelineTrack AddTrack(string name, TimelineTrackKind kind = Keys)Adds a track at the bottom.
public bool Remove(TimelineTrack track)Removes a track, and takes its keys and spans out of the selection.
public void Refresh()Brings the headers back into agreement with the tracks.
public void ZoomToFit()Zooms and pans until the whole duration fits.
public float ToScreen(float time)Where a time is, in document space.
public float ToTime(float x)Which time a document-space x is.
public int TrackAt(float y)Which track a document-space y is over, or -1.
public TimelineKey? KeyAt(float x, float y)The key nearest a document-space point, if one is within reach.
public TimelineSpan? SpanAt(float x, float y, out SpanGrip grip)The span under a document-space point, and which part of it.
public float Snap(float time)Brings a time onto a frame, if snapping is on.
public void Select(TimelineKey? key, ModifierKeys modifiers = None)Selects a key, or adds it to or removes it from the selection.
public void SelectNone()Selects nothing at all, keys and spans alike.
public void Select(TimelineSpan? span, ModifierKeys modifiers = None)Selects a span, or adds it to or removes it from the selection.
public void SelectAll()Selects every key and every span on every track.
public void DeleteSelection()Removes every selected key and span.
public void ClearTime()Unsets Time, so it takes its default or its ancestor's value again.
public void ClearDuration()Unsets Duration, so it takes its default or its ancestor's value again.
public void ClearTimeStart()Unsets TimeStart, so it takes its default or its ancestor's value again.
public void ClearPixelsPerSecond()Unsets PixelsPerSecond, so it takes its default or its ancestor's value again.
public void ClearFrameRate()Unsets FrameRate, so it takes its default or its ancestor's value again.
public void ClearSnapToFrames()Unsets SnapToFrames, so it takes its default or its ancestor's value again.
public void ClearScrollTop()Unsets ScrollTop, so it takes its default or its ancestor's value again.
public void ClearKeySize()Unsets KeySize, so it takes its default or its ancestor's value again.
public void ClearGripSize()Unsets GripSize, so it takes its default or its ancestor's value again.
Used by (7)
- TimelineLanesVixen.Ui.Controls.Advanced
- TimelineRulerVixen.Ui.Controls.Advanced
- TimelineSpanTestsVixen.Ui.Controls.Advanced.Tests
- TimelineTestsVixen.Ui.Controls.Advanced.Tests
- AnimationClipViewVixen.Editor.AssetEditors
- MilestoneE5TestsVixen.Editor.App.Tests
- SequenceViewVixen.Editor.AssetEditors