2019-10-17 14:28:46 +00:00
|
|
|
{
|
|
|
|
"MaxCount": 4000,
|
|
|
|
"Drawable": {
|
|
|
|
"Type": "SkCircleDrawable",
|
|
|
|
"Radius": 2
|
|
|
|
},
|
2021-02-01 19:47:30 +00:00
|
|
|
"Code": [
|
2019-10-17 14:28:46 +00:00
|
|
|
"void effectSpawn(inout Effect effect) {",
|
|
|
|
" effect.lifetime = 4;",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void effectUpdate(inout Effect effect) {",
|
|
|
|
" effect.color.r = 0;",
|
|
|
|
" effect.color.g = 1 - effect.age;",
|
|
|
|
" effect.color.b = effect.age;",
|
|
|
|
"",
|
|
|
|
" effect.rate = effect.age < 0.75 ? 800 : 0;",
|
|
|
|
"}",
|
2021-02-01 19:47:30 +00:00
|
|
|
"",
|
2019-10-17 14:28:46 +00:00
|
|
|
"uniform float2 mouse_pos;",
|
|
|
|
"",
|
|
|
|
"void spawn(inout Particle p) {",
|
|
|
|
" p.lifetime = 4;",
|
|
|
|
" p.pos = mouse_pos;",
|
2020-02-10 18:45:22 +00:00
|
|
|
" p.frame = effect.age / 0.75 + mix(-0.05, 0.05, rand(p.seed));",
|
2019-10-17 14:28:46 +00:00
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"void update(inout Particle p) {",
|
|
|
|
" p.pos = mix(p.pos, text(p.frame).xy, 0.05);",
|
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"Bindings": [
|
|
|
|
{
|
|
|
|
"Type": "SkTextBinding",
|
|
|
|
"Name": "text",
|
|
|
|
"Text": "HELLO WORLD",
|
|
|
|
"FontSize": 96
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|