d12f2786e2
Currently just for image drawable, but going to use this for references to other kinds of data in bindings, too. Change-Id: Ic6673530013337bbaadd2d3f1c040626ec24ffb8 Bug: skia:9513 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256776 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
33 lines
734 B
JSON
33 lines
734 B
JSON
{
|
|
"MaxCount": 32,
|
|
"Drawable": {
|
|
"Type": "SkImageDrawable",
|
|
"Path": "images",
|
|
"Name": "index8.png",
|
|
"Columns": 1,
|
|
"Rows": 1
|
|
},
|
|
"EffectCode": [
|
|
"void effectSpawn(inout Effect effect) {",
|
|
" effect.rate = 0.5;",
|
|
" effect.scale = 0.1;",
|
|
"}",
|
|
""
|
|
],
|
|
"Code": [
|
|
"void spawn(inout Particle p) {",
|
|
" p.lifetime = 5;",
|
|
" float a = radians(mix(-30, -80, rand));",
|
|
" float s = mix(150, 200, rand);",
|
|
" p.vel.x = cos(a) * s;",
|
|
" p.vel.y = sin(a) * s;",
|
|
"}",
|
|
"",
|
|
"void update(inout Particle p) {",
|
|
" p.vel.y += 50 * dt;",
|
|
" p.dir = normalize(p.vel);",
|
|
"}",
|
|
""
|
|
],
|
|
"Bindings": []
|
|
} |