skia2/resources/particles/path_spawn.json
Brian Osman c81378624f Update all example particle data to new single-code-chunk format
Change-Id: Ic53dc7ecab1b44761fe06e6b528864d24cc5fa58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-02 18:07:53 +00:00

33 lines
700 B
JSON

{
"MaxCount": 800,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 2
},
"Code": [
"void effectSpawn(inout Effect effect) {",
" effect.lifetime = 1;",
" effect.rate = 100;",
"}",
"",
"void spawn(inout Particle p) {",
" float4 pos_and_normal = my_path(rand(p.seed));",
" p.pos = pos_and_normal.xy;",
" p.vel = pos_and_normal.zw * -5;",
"",
" p.lifetime = 2;",
"}",
"",
"void update(inout Particle p) {",
"}",
""
],
"Bindings": [
{
"Type": "SkPathBinding",
"Name": "my_path",
"PathPath": "",
"PathName": "star"
}
]
}