Class LinearCurveEditor<T>
The linear curve editor control.
Inheritance
Implements
Namespace: FlaxEditor.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
public class LinearCurveEditor<T> : CurveEditor<T>, IComparable, IDrawable, IKeyframesEditor where T : new()
Type Parameters
T
The keyframe value type. |
Constructors
LinearCurveEditor()
Initializes a new instance of the LinearCurveEditor<T> class.
Declaration
public LinearCurveEditor()
Fields
_keyframes
The keyframes collection.
Declaration
protected List<LinearCurve<T>.Keyframe> _keyframes
Field Value
System.Collections.Generic.List<LinearCurve.Keyframe<>>
|
Properties
Keyframes
Gets the keyframes collection (read-only).
Declaration
public IReadOnlyList<LinearCurve<T>.Keyframe> Keyframes { get; }
Property Value
System.Collections.Generic.IReadOnlyList<LinearCurve.Keyframe<>>
|
KeyframesCount
Declaration
public override int KeyframesCount { get; }
Property Value
System.Int32
|
Overrides
Methods
AddKeyframe(Float2)
Adds a new keyframe at the given location (in keyframes space).
Declaration
protected override void AddKeyframe(Float2 keyframesPos)
Parameters
Float2
keyframesPos
The new keyframe position (in keyframes space). |
Overrides
AddKeyframe(LinearCurve<T>.Keyframe)
Adds the new keyframe.
Declaration
public int AddKeyframe(LinearCurve<T>.Keyframe k)
Parameters
LinearCurve.Keyframe<>
k
The keyframe to add. |
Returns
System.Int32
The index of the keyframe. |
AddKeyframe(Single, Object)
Declaration
public override int AddKeyframe(float time, object value)
Parameters
System.Single
time
|
System.Object
value
|
Returns
System.Int32
|
Overrides
AddKeyframe(Single, Object, Object, Object)
Declaration
public override int AddKeyframe(float time, object value, object tangentIn, object tangentOut)
Parameters
System.Single
time
|
System.Object
value
|
System.Object
tangentIn
|
System.Object
tangentOut
|
Returns
System.Int32
|
Overrides
DrawCurve(ref Rectangle)
Draws the curve.
Declaration
protected override void DrawCurve(ref Rectangle viewRect)
Parameters
Rectangle
viewRect
The main panel client area used as a view bounds. |
Overrides
Evaluate(out T, Single, Boolean)
Evaluates the animation curve value at the specified time.
Declaration
public override void Evaluate(out T result, float time, bool loop = false)
Parameters
T
result
The interpolated value from the curve at provided time. |
System.Single
time
The time to evaluate the curve at. |
System.Boolean
loop
If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped. |
Overrides
GetAllKeyframesEditingProxy()
Gets proxy object for all keyframes list.
Declaration
protected override CurveEditor<T>.IAllKeyframesProxy GetAllKeyframesEditingProxy()
Returns
CurveEditor.IAllKeyframesProxy<>
The proxy object. |
Overrides
GetKeyframe(Int32)
Declaration
public override object GetKeyframe(int index)
Parameters
System.Int32
index
|
Returns
System.Object
|
Overrides
GetKeyframe(Int32, out Single, out Object, out Object, out Object)
Declaration
public override void GetKeyframe(int index, out float time, out object value, out object tangentIn, out object tangentOut)
Parameters
System.Int32
index
|
System.Single
time
|
System.Object
value
|
System.Object
tangentIn
|
System.Object
tangentOut
|
Overrides
GetKeyframePoint(Int32, Int32)
Declaration
public override Float2 GetKeyframePoint(int index, int component)
Parameters
System.Int32
index
|
System.Int32
component
|
Returns
Float2
|
Overrides
GetKeyframes()
Declaration
public override object[] GetKeyframes()
Returns
System.Object[]
|
Overrides
GetKeyframeTangentInternal(Int32, Boolean, Int32)
Gets the keyframe tangent value (internally).
Declaration
protected override float GetKeyframeTangentInternal(int index, bool isIn, int component)
Parameters
System.Int32
index
The keyframe index. |
System.Boolean
isIn
True if tangent is |
System.Int32
component
The value component index. |
Returns
System.Single
The tangent component value. |
Overrides
GetKeyframeTime(Int32)
Gets the time of the keyframe.
Declaration
protected override float GetKeyframeTime(int index)
Parameters
System.Int32
index
The keyframe index. |
Returns
System.Single
The keyframe time. |
Overrides
GetKeyframeTime(Object)
Gets the time of the keyframe.
Declaration
protected override float GetKeyframeTime(object keyframe)
Parameters
System.Object
keyframe
The keyframe object. |
Returns
System.Single
The keyframe time. |
Overrides
GetKeyframeValue(Object)
Gets the value of the keyframe.
Declaration
protected override T GetKeyframeValue(object keyframe)
Parameters
System.Object
keyframe
The keyframe object. |
Returns
T
The keyframe value. |
Overrides
GetKeyframeValue(Object, Int32)
Gets the value of the keyframe (single component).
Declaration
protected override float GetKeyframeValue(object keyframe, int component)
Parameters
System.Object
keyframe
The keyframe object. |
System.Int32
component
The keyframe value component index. |
Returns
System.Single
The keyframe component value. |
Overrides
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnKeyframesChanged()
Called when keyframes collection gets changed (keyframe added or removed).
Declaration
protected override void OnKeyframesChanged()
Overrides
OnKeyframesGet(String, Action<String, Single, Object>)
Declaration
public override void OnKeyframesGet(string trackName, Action<string, float, object> get)
Parameters
System.String
trackName
|
System.Action<System.String, System.Single, System.Object>
get
|
Overrides
OnKeyframesSet(List<KeyValuePair<Single, Object>>)
Declaration
public override void OnKeyframesSet(List<KeyValuePair<float, object>> keyframes)
Parameters
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.Single, System.Object>>
keyframes
|
Overrides
RemoveKeyframesInternal(HashSet<Int32>)
Removes the keyframes data (internally).
Declaration
protected override void RemoveKeyframesInternal(HashSet<int> indicesToRemove)
Parameters
System.Collections.Generic.HashSet<System.Int32>
indicesToRemove
The list of indices of the keyframes to remove. |
Overrides
SetKeyframeInternal(Int32, Object)
Sets the keyframe data (internally).
Declaration
protected override void SetKeyframeInternal(int index, object keyframe)
Parameters
System.Int32
index
The keyframe index. |
System.Object
keyframe
The keyframe to set. |
Overrides
SetKeyframeInternal(Int32, Single, Single, Int32)
Sets the keyframe data (internally).
Declaration
protected override void SetKeyframeInternal(int index, float time, float value, int component)
Parameters
System.Int32
index
The keyframe index. |
System.Single
time
The time to set. |
System.Single
value
The value to set. |
System.Int32
component
The value component. |
Overrides
SetKeyframes(IEnumerable<LinearCurve<T>.Keyframe>)
Sets the keyframes collection.
Declaration
public void SetKeyframes(IEnumerable<LinearCurve<T>.Keyframe> keyframes)
Parameters
System.Collections.Generic.IEnumerable<LinearCurve.Keyframe<>>
keyframes
The keyframes. |
SetKeyframes(Object[])
Declaration
public override void SetKeyframes(object[] keyframes)
Parameters
System.Object[]
keyframes
|
Overrides
SetKeyframeTangentInternal(Int32, Boolean, Int32, Single)
Sets the keyframe tangent value (internally).
Declaration
protected override void SetKeyframeTangentInternal(int index, bool isIn, int component, float value)
Parameters
System.Int32
index
The keyframe index. |
System.Boolean
isIn
True if tangent is |
System.Int32
component
The value component index. |
System.Single
value
The tangent component value. |
Overrides
SetKeyframeValue(Int32, Object)
Declaration
public override void SetKeyframeValue(int index, object value)
Parameters
System.Int32
index
|
System.Object
value
|
Overrides
SetKeyframeValue(Int32, Object, Object, Object)
Declaration
public override void SetKeyframeValue(int index, object value, object tangentIn, object tangentOut)
Parameters
System.Int32
index
|
System.Object
value
|
System.Object
tangentIn
|
System.Object
tangentOut
|
Overrides
UpdateFPS()
Updates the keyframes to match the FPS.
Declaration
protected override void UpdateFPS()
Overrides
UpdateKeyframes()
Declaration
public override void UpdateKeyframes()
Overrides
UpdateTangents()
Declaration
public override void UpdateTangents()