| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
11年前发布

基于HTML5 Canvas实现雨滴效果: Rainday.js

一个简单的脚本来模拟雨滴落在玻璃表面效果。rainyday.js拥有功能可扩展的API,碰撞检测,并很容易用自己不同的动画组件实现扩展。Rainyday.js是一个纯的JavaScript库,用到了HTML5的特性,所以都支持大多数现代浏览器它。

How to use:    var engine = new RainyDay({      element: image,         // Image element                              // This value is required      parentElement: someDiv, // Element to be used as a parent for the canvas                              // If not provided assuming the 'body' element      crop: [0, 0, 50, 60],   // Coordinates if only a part of the image should be used                              // If not provided entire image will be used      blur: 10,               // Defines blur due to rain effect                              // Assuming 10 if not provided                              // Use 0 value to disable the blur      opacity: 1              // Opacity of rain drops                              // Assuming 1 if not provided  });  engine.rain(      [          [1, 0, 20],         // add 20 drops of size 1...          [3, 3, 1]           // ... and 1 drop of size from 3 - 6 ...      ],                             100);        
dm2.jpg

项目主页:http://www.open-open.com/lib/view/home/1406863000218

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1406863000218.html
HTML5 前端技术 Rainday.js