1{
2   "MaxCount": 4000,
3   "Drawable": {
4      "Type": "SkCircleDrawable",
5      "Radius": 2
6   },
7   "Code": [
8      "void effectSpawn(inout Effect effect) {",
9      "  effect.lifetime = 4;",
10      "}",
11      "",
12      "void effectUpdate(inout Effect effect) {",
13      "  effect.color.r = 0;",
14      "  effect.color.g = 1 - effect.age;",
15      "  effect.color.b = effect.age;",
16      "",
17      "  effect.rate = effect.age < 0.75 ? 800 : 0;",
18      "}",
19      "",
20      "uniform float2 mouse_pos;",
21      "",
22      "void spawn(inout Particle p) {",
23      "  p.lifetime = 4;",
24      "  p.pos = mouse_pos;",
25      "  p.frame = effect.age / 0.75 + mix(-0.05, 0.05, rand(p.seed));",
26      "}",
27      "",
28      "void update(inout Particle p) {",
29      "  p.pos = mix(p.pos, text(p.frame).xy, 0.05);",
30      "}",
31      ""
32   ],
33   "Bindings": [
34      {
35         "Type": "SkTextBinding",
36         "Name": "text",
37         "Text": "HELLO WORLD",
38         "FontSize": 96
39      }
40   ]
41}