• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2   "MaxCount": 2000,
3   "Drawable": {
4      "Type": "SkCircleDrawable",
5      "Radius": 1
6   },
7   "EffectCode": [
8      "void effectSpawn(inout Effect effect) {",
9      "  effect.rate = 1000;",
10      "}",
11      ""
12   ],
13   "Code": [
14      "void spawn(inout Particle p) {",
15      "  p.lifetime = mix(1, 3, rand);",
16      "  float a = radians(mix(250, 290, rand));",
17      "  float s = mix(10, 30, rand);",
18      "  p.vel.x = cos(a) * s;",
19      "  p.vel.y = sin(a) * s;",
20      "  p.pos += text(rand).xy;",
21      "}",
22      "",
23      "void update(inout Particle p) {",
24      "  float4 startColor = float4(1, 0.196, 0.078, 1);",
25      "  float4 endColor   = float4(1, 0.784, 0.078, 1);",
26      "  p.color = mix(startColor, endColor, p.age);",
27      "}",
28      ""
29   ],
30   "Bindings": [
31      {
32         "Type": "SkTextBinding",
33         "Name": "text",
34         "Text": "SKIA",
35         "FontSize": 96
36      }
37   ]
38}