You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

5 months ago
using Godot;
using System;
4 months ago
using EGFramework.EGTween;
5 months ago
namespace EGFramework.Examples.TweenAnime{
4 months ago
public partial class TweenTest : Control
5 months ago
{
[Export] Control Target {set;get;}
4 months ago
[Export] Node2D Target2D {set;get;}
5 months ago
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
// Tween tween = GetTree().CreateTween();
// tween.TweenProperty(Target,"color",Colors.Red,1.0f);
// tween.TweenProperty(Target,"color",Colors.Green,1.0f);
// tween.TweenProperty(Target,"color",Colors.Blue,1.0f);
// tween.SetLoops();
5 months ago
// Tween tween2 = GetTree().CreateTween();
// tween2.TweenProperty(Target,"position",new Vector2(100,0),1.0f);
// tween2.TweenProperty(Target,"position",new Vector2(100,100),1.0f);
// tween2.TweenProperty(Target,"position",new Vector2(0,100),1.0f);
// tween2.TweenProperty(Target,"position",new Vector2(0,0),1.0f);
// tween2.TweenCallback(Callable.From(TweenOver));
// tween2.SetLoops();
4 months ago
// Tween tween3 = this.CreateTween();
// tween3.SetEase(Tween.EaseType.InOut);
// tween3.SetTrans(Tween.TransitionType.Cubic);
// tween3.TweenInterval(0.5f);
// tween3.TweenProperty(Target,"size",new Vector2(100,40),0.5f);
// tween3.TweenProperty(Target,"size",new Vector2(40,100),0.5f);
// tween3.TweenProperty(Target,"size",new Vector2(40,40),0.5f);
// tween3.SetLoops();
4 months ago
Target2D.TweenRotationByAngle(360f,1.0f).KillOnEnd();
5 months ago
}
public void TweenOver(){
GD.Print("----end----");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}
}