API ReferenceSandbox.UI

CurveEditorclass

Edits a Curve, CurveRange or named collection of curves. Keys retain the normalized coordinates used by Curve.Frame; numeric fields and axes display actual time and value units. View navigation never edits data.

object→Panel→CurveEditor
Namespace
Sandbox.UI
Assembly
Sandbox.Engine
Declaration
public class Sandbox.UI.CurveEditor : Sandbox.UI.Panel

Constructors1

Showing 1 constructors

Methods23

Showing 23 methods

public void AddKey(float time, float value)PUBLIC

Add a normalized key to the active curve. Near-duplicate times select the existing key.

ParameterTypeDescription
timefloat—
valuefloat—
Returns:void—

public void ApplyPreset(Sandbox.Curve preset, bool includeRanges = False)PUBLIC

Replace the active curve's keys, optionally applying the preset's axis ranges too.

ParameterTypeDescription
presetCurve—
includeRanges = Falsebool—
Returns:void—

public void DeletePreset(int index)PUBLIC

Remove a saved preset.

ParameterTypeDescription
indexint—
Returns:void—

public void FitSelection()PUBLIC

Returns:void—

public void FitView()PUBLIC

Returns:void—

public void InsertKey(float time)PUBLIC

Split the curve at a normalized time while retaining its shape, including stepped and linear segments.

ParameterTypeDescription
timefloat—
Returns:void—

public void MoveKey(int index, float time, float value)PUBLIC

Move one key, clamping its time before either neighbour.

ParameterTypeDescription
indexint—
timefloat—
valuefloat—
Returns:void—

public void MoveSelection(Vector2 delta)PUBLIC

Translate the selection by a delta in curve A's normalized display space, keeping group spacing intact.

ParameterTypeDescription
deltaVector2—
Returns:void—

public virtual void OnButtonTyped(Sandbox.UI.ButtonEvent e)PUBLICVIRTUAL

ParameterTypeDescription
eButtonEvent—
Returns:void—

public void Redo()PUBLIC

Returns:void—

public void RemoveSelected()PUBLIC

Delete selected keys while keeping at least one key per populated boundary.

Returns:void—

public void ReplacePreset(int index)PUBLIC

Replace a saved preset with the active curve.

ParameterTypeDescription
indexint—
Returns:void—

public void SavePreset()PUBLIC

Save the active curve, including its axis ranges, as a reusable preset.

Returns:void—

public void SelectAll()PUBLIC

Returns:void—

public void SelectCurve(int index)PUBLIC

Select a boundary without changing its data or the view.

ParameterTypeDescription
indexint—
Returns:void—

public void SelectKey(int index)PUBLIC

ParameterTypeDescription
indexint—
Returns:void—

public void SelectKeys(System.Collections.Generic.IEnumerable`1<Sandbox.UI.CurveEditor.CurveKey> keys)PUBLIC

ParameterTypeDescription
keysIEnumerable<CurveKey>—
Returns:void—

public void SetKeyMode(int index, Sandbox.Curve.HandleMode mode)PUBLIC

ParameterTypeDescription
indexint—
modeHandleMode—
Returns:void—

public void SetSelectedMode(Sandbox.Curve.HandleMode mode)PUBLIC

Set interpolation on all selected keys, across both boundaries, as a single edit.

ParameterTypeDescription
modeHandleMode—
Returns:void—

public void SetTangent(int index, bool incoming, float slope)PUBLIC

ParameterTypeDescription
indexint—
incomingbool—
slopefloat—
Returns:void—

public void SetViewBounds(Vector2 min, Vector2 max)PUBLIC

Set the visible time/value bounds in actual units.

ParameterTypeDescription
minVector2—
maxVector2—
Returns:void—

public void SmoothSelected()PUBLIC

Calculate monotone, locally clamped slopes. This is a one-shot operation stored as ordinary mirrored tangents.

Returns:void—

public void Undo()PUBLIC

Returns:void—

Properties19

Showing 19 properties

public int Sandbox.UI.CurveEditor.ActiveCurve { get; set; }PUBLICGETSET

Returns:int—

public bool Sandbox.UI.CurveEditor.CanRedo { get; set; }PUBLICGETSET

Returns:bool—

public bool Sandbox.UI.CurveEditor.CanUndo { get; set; }PUBLICGETSET

Returns:bool—

public System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel> Sandbox.UI.CurveEditor.Channels { get; set; }PUBLICGETSET

Display and edit multiple independent curves. Assigning clears undo history without notifying.

Returns:IReadOnlyList<CurveChannel>—

public System.Action`1<System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel>> Sandbox.UI.CurveEditor.ChannelsChanged { get; set; }PUBLICGETSET

Raised once per multi-curve edit, including undo and cancellation. The collection is a snapshot.

Returns:Action<IReadOnlyList<CurveChannel>>—

public bool Sandbox.UI.CurveEditor.IsRange { get; set; }PUBLICGETSET

Returns:bool—

public Sandbox.CurveRange Sandbox.UI.CurveEditor.RangeValue { get; set; }PUBLICGETSET

The two range boundaries. Assigning enables filled range editing; curves can have different ranges and key times.

Returns:CurveRange—

public System.Action`1<Sandbox.CurveRange> Sandbox.UI.CurveEditor.RangeValueChanged { get; set; }PUBLICGETSET

Raised once for each change to either boundary in range mode.

Returns:Action<CurveRange>—

public System.Collections.Generic.IReadOnlyList`1<Sandbox.Curve> Sandbox.UI.CurveEditor.SavedPresets { get; set; }PUBLICGETSET

User presets shared between curve editors and retained between sessions.

Returns:IReadOnlyList<Curve>—

public int Sandbox.UI.CurveEditor.SelectedIndex { get; set; }PUBLICGETSET

Returns:int—

public bool Sandbox.UI.CurveEditor.ShowInspector { get; set; }PUBLICGETSET

Show the advanced key inspector beside the canvas. Hidden by default.

Returns:bool—

public Vector2 Sandbox.UI.CurveEditor.SnapIncrement { get; set; }PUBLICGETSET

Time and value snap increments in actual units, independent of zoom and grid labels. Non-positive values disable an axis.

Returns:Vector2—

public bool Sandbox.UI.CurveEditor.SnapToGrid { get; set; }PUBLICGETSET

Snap dragged keys to SnapIncrement in actual time/value units. Ctrl temporarily enables snapping.

Returns:bool—

public Sandbox.Curve Sandbox.UI.CurveEditor.Value { get; set; }PUBLICGETSET

The active curve. Assigning switches to single-curve mode and clears undo history without a change event.

Returns:Curve—

public System.Action`1<Sandbox.Curve> Sandbox.UI.CurveEditor.ValueChanged { get; set; }PUBLICGETSET

Raised for user edits to the active curve, including undo and cancellation.

Returns:Action<Curve>—

public Vector2 Sandbox.UI.CurveEditor.ViewMin { get; set; }PUBLICGETSET

Visible time/value bounds in actual curve units. Changing the view does not edit keys.

Returns:Vector2—

On this page

Constructorspublic CurveEditor()Methodspublic System.Void AddKey(System.Single time, System.Single value)public System.Void ApplyPreset(Sandbox.Curve preset, System.Boolean includeRanges = False)public System.Void DeletePreset(System.Int32 index)public System.Void FitSelection()public System.Void FitView()public System.Void InsertKey(System.Single time)public System.Void MoveKey(System.Int32 index, System.Single time, System.Single value)public System.Void MoveSelection(Vector2 delta)public virtual System.Void OnButtonTyped(Sandbox.UI.ButtonEvent e)public System.Void Redo()public System.Void RemoveSelected()public System.Void ReplacePreset(System.Int32 index)public System.Void SavePreset()public System.Void SelectAll()public System.Void SelectCurve(System.Int32 index)public System.Void SelectKey(System.Int32 index)public System.Void SelectKeys(System.Collections.Generic.IEnumerable`1<Sandbox.UI.CurveEditor.CurveKey> keys)public System.Void SetKeyMode(System.Int32 index, Sandbox.Curve.HandleMode mode)public System.Void SetSelectedMode(Sandbox.Curve.HandleMode mode)public System.Void SetTangent(System.Int32 index, System.Boolean incoming, System.Single slope)public System.Void SetViewBounds(Vector2 min, Vector2 max)public System.Void SmoothSelected()public System.Void Undo()Propertiespublic System.Int32 Sandbox.UI.CurveEditor.ActiveCurve { get; set; }public System.Boolean Sandbox.UI.CurveEditor.CanRedo { get; set; }public System.Boolean Sandbox.UI.CurveEditor.CanUndo { get; set; }public System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel> Sandbox.UI.CurveEditor.Channels { get; set; }public System.Action`1<System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel>> Sandbox.UI.CurveEditor.ChannelsChanged { get; set; }public System.Boolean Sandbox.UI.CurveEditor.IsRange { get; set; }public System.Nullable`1<Sandbox.Rect> Sandbox.UI.CurveEditor.NavigationBounds { get; set; }public Sandbox.CurveRange Sandbox.UI.CurveEditor.RangeValue { get; set; }public System.Action`1<Sandbox.CurveRange> Sandbox.UI.CurveEditor.RangeValueChanged { get; set; }public System.Collections.Generic.IReadOnlyList`1<Sandbox.Curve> Sandbox.UI.CurveEditor.SavedPresets { get; set; }public System.Int32 Sandbox.UI.CurveEditor.SelectedIndex { get; set; }public System.Collections.Generic.IReadOnlyCollection`1<Sandbox.UI.CurveEditor.CurveKey> Sandbox.UI.CurveEditor.SelectedKeys { get; set; }public System.Boolean Sandbox.UI.CurveEditor.ShowInspector { get; set; }public Vector2 Sandbox.UI.CurveEditor.SnapIncrement { get; set; }public System.Boolean Sandbox.UI.CurveEditor.SnapToGrid { get; set; }public Sandbox.Curve Sandbox.UI.CurveEditor.Value { get; set; }public System.Action`1<Sandbox.Curve> Sandbox.UI.CurveEditor.ValueChanged { get; set; }public Vector2 Sandbox.UI.CurveEditor.ViewMax { get; set; }public Vector2 Sandbox.UI.CurveEditor.ViewMin { get; set; }Metadata