-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextParticle.cs
More file actions
22 lines (21 loc) · 829 Bytes
/
TextParticle.cs
File metadata and controls
22 lines (21 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using Godot;
public partial class TextParticle : Label
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Tween tween = GetTree().CreateTween();
ZIndex = 2;
Position += Vector2.Left * (GD.Randf() * 40 - 20);
tween.SetTrans(Tween.TransitionType.Elastic);
tween.SetEase(Tween.EaseType.Out);
tween.TweenProperty(this, "position", Position + Vector2.Up * 10, .25f).AsRelative();
tween.TweenProperty(this, "position", Position + Vector2.Down * 20, .1f).AsRelative();
tween.SetParallel();
tween.SetTrans(Tween.TransitionType.Quad);
tween.TweenProperty(this, "modulate:a", 0, .15f);
tween.SetParallel(false);
tween.TweenCallback(Callable.From(QueueFree));
}
}