不断增加点
来源:互联网 发布:网络相关的专业 编辑:程序博客网 时间:2024/04/28 23:14
<html><head><style type="text/css">.canvas{background:#000;}</style></head><body><canvas class="canvas" ></canvas><script type="text/javascript">var S = {start: function(){Drawing.init();var d = new Dot(5,20);Drawing.loop(function (){d.move();});}};Dot = function(x,y){this.x = x;this.y = y;this.z = 5;this.h =1;};Dot.prototype = {move: function(){this.x = Math.random() * window.innerWidth ;this.y = Math.random() * window.innerHeight ;Drawing.drawDot(this);}};Drawing = (function(){var canvas,context,animatefn,requestFrame = window.requestAnimateFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimateFrame || window.msRequestAnimateFrame || function(callback){ window.setTimeout(callback,1000/60); };return {init: function(){canvas = document.querySelector('.canvas');context = canvas.getContext('2d');canvas.width = window.innerWidth;canvas.height = window.innerHeight;},drawDot: function(dot){context.fillStyle = '#fff';context.beginPath();context.arc(dot.x ,dot.y ,dot.z,0,2 * Math.PI,true);context.closePath();context.fill();},clearAnimate: function(){context.clearRect(0,0,canvas.width,canvas.height);},loop: function(fn){animatefn = !animatefn ? fn : animatefn;//this.clearAnimate();animatefn();requestFrame.call(window,this.loop.bind(this));}}}());S.start();</script></body></html>
0 0
- 不断增加点
- linux 操作技巧.(不断增加)
- JS不断循环增加表格
- 面向对象的经典语录:(不断增加)
- [整理]有用的SQL语句(不断增加)
- Runtime.getRuntime().totalMemory() 数值一直不断增加
- 利润领域还在不断增加
- 内存使用率不断增加的原因之一
- Unity Profile 内存不断增加问题
- 阿里巴巴不断增加其云数据中心覆盖率
- 增加标注点
- 增加点最小公倍数方法。
- VC串口控件编程,解决内存不断增加的问题
- VC串口控件编程,解决内存不断增加的问题
- SQL SERVER的内存会不断增加,问题分析
- SQL SERVER的内存会不断增加,问题分析
- SQL SERVER的内存不断增加问题分析
- SQL SERVER的内存不断增加问题分析
- WebBrowser设置为ie8模式
- UVA - 490 Rotating Sentences
- GDB的字符终端的替换工具——CGDB的使用与介绍
- 阿里巴巴上市首日上涨38% 市值2314亿美元
- 单词翻转
- 不断增加点
- 【c语言】三角形外心坐标
- JQuery触发元素事件
- NYOJ-最少乘法次数
- ui方面
- UVA - 11205 The broken pedometer
- telnet登录邮箱收发邮件
- GCC __attribute__((constructor)|(destructor))
- 【LeetCode】【Python题解】Rotate Image