skia2/resources/particles/variable_rate.json
Brian Osman df18296f98 Add accessors to get/set SkParticleEffect fields
Simplify burst handling. Scripts should just add to burst (if
they want to handle programmatic bursting, as well).

Update most effects to handle dynamic updates to position better,
and add a sample effect meant to be used with mouse tracking.

Change-Id: Ia302e1d04e62e2b07974807c44067786cc10a8ad
Bug: skia:9513
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248798
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-10-15 14:54:50 +00:00

25 lines
559 B
JSON

{
"MaxCount": 4000,
"Drawable": {
"Type": "SkCircleDrawable",
"Radius": 3
},
"EffectCode": [
"void effectUpdate(inout Effect effect) {",
" effect.rate = (sin(radians(effect.age * 720)) + 0.7) * 200;",
"}",
""
],
"Code": [
"void spawn(inout Particle p) {",
" p.lifetime = 6;",
" float a = radians(rand * 360);",
" float2 ofs = float2(cos(a), sin(a)) * 40;",
" p.pos += ofs;",
" p.vel = ofs;",
" p.scale = 0.5;",
"}",
""
],
"Bindings": []
}