Author Topic: rainyday.js, 雨滴效果js库  (Read 2271 times)

Contra

  • SuperManager
  • Sr. Member
  • *****
  • Posts: 347
  • AC, game dev, new media art&tech.
    • i'm Contra
rainyday.js, 雨滴效果js库
« on: October 31, 2013, 09:44:09 AM »
Rainyday.js:
"The idea behind rainyday.js is to create a JavaScript library that makes use of the HTML5 canvas to render an animation of raindrops falling on a glass surface. "

demo:
http://maroslaw.github.io/rainyday.js/demo012_1.html
官网:
http://maroslaw.github.io/rainyday.js/

How to use:
Code
var engine = new RainyDay({
    element: 'background',  // ID of image element
    blur: 10,               // Defines blur due to rain effect
    opacity: 1,             // Opacity of rain drops
    fps: 30                 // Frame rate per second
});
engine.rain([ [3, 3, 0.88], [5, 5, 0.9], [6, 2, 1] ], 100);

Tags: