Skip to content

creating particles effect, can be triggered at touch, click, move, auto, e.t.c

Notifications You must be signed in to change notification settings

chocoluffy/canvas-particles_effect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

canvas-particles_effect

在定义了particle作为一个类的基础属性, 以及update\draw等方法对每一个particle对象; 还需要在render里面用循环每一个particaled的draw和update, 注意画布的优先顺序, 后画的东西在上面。

// loop over each particle, draw it, update it var i = particles.length; while( i-- ) { particles[ i ].draw(); particles[ i ].update( i ); }

在总的需要无数循环的函数里面loop\main等等, 更新一些属性, hue+=0.5, context.globalCompositeOperation="lighter"等

context.globalCompositeOperation = 'destination-out';

context.fillStyle = 'rgba(0, 0, 0, 0.5)'; context.fillRect( 0, 0, canvas.width, canvas.height );

context.globalCompositeOperation = 'lighter';

About

creating particles effect, can be triggered at touch, click, move, auto, e.t.c

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published