mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-20 03:13:47 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
|
|
@ -0,0 +1,50 @@
|
|||
using Godot;
|
||||
using GTweens.Easings;
|
||||
using GTweens.Interpolators;
|
||||
|
||||
namespace GTweensGodot.Interpolators;
|
||||
|
||||
public sealed class GodotColorInterpolator : IInterpolator<Color>
|
||||
{
|
||||
public static readonly GodotColorInterpolator Instance = new();
|
||||
|
||||
GodotColorInterpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Color Evaluate(
|
||||
Color initialValue,
|
||||
Color finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Color(
|
||||
easingDelegate(initialValue.R, finalValue.R, time),
|
||||
easingDelegate(initialValue.G, finalValue.G, time),
|
||||
easingDelegate(initialValue.B, finalValue.B, time),
|
||||
easingDelegate!(initialValue.A, finalValue.A, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Color Subtract(Color initialValue, Color finalValue)
|
||||
{
|
||||
return new Color(
|
||||
finalValue.R - initialValue.R,
|
||||
finalValue.G - initialValue.G,
|
||||
finalValue.B - initialValue.B,
|
||||
finalValue.A - initialValue.A
|
||||
);
|
||||
}
|
||||
|
||||
public Color Add(Color initialValue, Color finalValue)
|
||||
{
|
||||
return new Color(
|
||||
finalValue.R + initialValue.R,
|
||||
finalValue.G + initialValue.G,
|
||||
finalValue.B + initialValue.B,
|
||||
finalValue.A + initialValue.A
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://doups41b5yb7m
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using Godot;
|
||||
using GTweens.Easings;
|
||||
using GTweens.Interpolators;
|
||||
|
||||
namespace GTweensGodot.Interpolators;
|
||||
|
||||
public sealed class GodotVector2IInterpolator : IInterpolator<Vector2I>
|
||||
{
|
||||
public static readonly GodotVector2IInterpolator Instance = new();
|
||||
|
||||
GodotVector2IInterpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vector2I Evaluate(
|
||||
Vector2I initialValue,
|
||||
Vector2I finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Vector2I(
|
||||
(int)easingDelegate(initialValue.X, finalValue.X, time),
|
||||
(int)easingDelegate(initialValue.Y, finalValue.Y, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Vector2I Subtract(Vector2I initialValue, Vector2I finalValue)
|
||||
{
|
||||
return finalValue - initialValue;
|
||||
}
|
||||
|
||||
public Vector2I Add(Vector2I initialValue, Vector2I finalValue)
|
||||
{
|
||||
return finalValue + initialValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://bo7xndtcu3plt
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using Godot;
|
||||
using GTweens.Easings;
|
||||
using GTweens.Interpolators;
|
||||
|
||||
namespace GTweensGodot.Interpolators;
|
||||
|
||||
public sealed class GodotVector2Interpolator : IInterpolator<Vector2>
|
||||
{
|
||||
public static readonly GodotVector2Interpolator Instance = new();
|
||||
|
||||
GodotVector2Interpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vector2 Evaluate(
|
||||
Vector2 initialValue,
|
||||
Vector2 finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Vector2(
|
||||
easingDelegate(initialValue.X, finalValue.X, time),
|
||||
easingDelegate(initialValue.Y, finalValue.Y, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Vector2 Subtract(Vector2 initialValue, Vector2 finalValue)
|
||||
{
|
||||
return finalValue - initialValue;
|
||||
}
|
||||
|
||||
public Vector2 Add(Vector2 initialValue, Vector2 finalValue)
|
||||
{
|
||||
return finalValue + initialValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://cirrcbdxbt6da
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
using Godot;
|
||||
using GTweens.Easings;
|
||||
using GTweens.Interpolators;
|
||||
|
||||
namespace GTweensGodot.Interpolators;
|
||||
|
||||
public sealed class GodotVector3Interpolator : IInterpolator<Vector3>
|
||||
{
|
||||
public static readonly GodotVector3Interpolator Instance = new();
|
||||
|
||||
GodotVector3Interpolator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vector3 Evaluate(
|
||||
Vector3 initialValue,
|
||||
Vector3 finalValue,
|
||||
float time,
|
||||
EasingDelegate easingDelegate
|
||||
)
|
||||
{
|
||||
return new Vector3(
|
||||
easingDelegate(initialValue.X, finalValue.X, time),
|
||||
easingDelegate(initialValue.Y, finalValue.Y, time),
|
||||
easingDelegate(initialValue.Z, finalValue.Z, time)
|
||||
);
|
||||
}
|
||||
|
||||
public Vector3 Subtract(Vector3 initialValue, Vector3 finalValue)
|
||||
{
|
||||
return finalValue - initialValue;
|
||||
}
|
||||
|
||||
public Vector3 Add(Vector3 initialValue, Vector3 finalValue)
|
||||
{
|
||||
return finalValue + initialValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://d36nv4qwd3pj8
|
||||
Loading…
Add table
Add a link
Reference in a new issue