mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Implemented basic keyframes
This commit is contained in:
1 parent
b734fa2f8f
commit
8a1759a575
41 files changed
+951
-123
No files matched your search
@@ -10,10 +10,14 @@ namespace Artemis.Core.Models.Profile.KeyframeEngines
|
||||
{
|
||||
public sealed override List<Type> CompatibleTypes { get; } = new List<Type> {typeof(SKPoint)};
|
||||
|
||||
public override object GetCurrentValue()
|
||||
protected override object GetInterpolatedValue()
|
||||
{
|
||||
// Nothing fancy for now, just return the base value
|
||||
return ((LayerProperty<SKPoint>) LayerProperty).Value;
|
||||
var currentKeyframe = (Keyframe<SKPoint>) CurrentKeyframe;
|
||||
var nextKeyframe = (Keyframe<SKPoint>) NextKeyframe;
|
||||
|
||||
var xDiff = nextKeyframe.Value.X - currentKeyframe.Value.X;
|
||||
var yDiff = nextKeyframe.Value.Y - currentKeyframe.Value.Y;
|
||||
return new SKPoint(currentKeyframe.Value.X + xDiff * KeyframeProgress, currentKeyframe.Value.Y + yDiff * KeyframeProgress);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user