• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2   "MaxCount": 4000,
3   "Drawable": {
4      "Type": "SkCircleDrawable",
5      "Radius": 2
6   },
7   "EffectCode": [
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   ],
21   "Code": [
22      "uniform float2 mouse_pos;",
23      "",
24      "void spawn(inout Particle p) {",
25      "  p.lifetime = 4;",
26      "  p.pos = mouse_pos;",
27      "  p.frame = effect.age / 0.75 + mix(-0.05, 0.05, rand);",
28      "}",
29      "",
30      "void update(inout Particle p) {",
31      "  p.pos = mix(p.pos, text(p.frame).xy, 0.05);",
32      "}",
33      ""
34   ],
35   "Bindings": [
36      {
37         "Type": "SkTextBinding",
38         "Name": "text",
39         "Text": "HELLO WORLD",
40         "FontSize": 96
41      }
42   ]
43}