chanteP/npcanvas
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
#demo var npc = new NPCanvas(canvasNode); var ball = npc.create(function(ctx, fps){ ctx.fillStyle = this.color; ctx.beginPath(); ctx.arc(0,0,15,0,2*Math.PI); ctx.closePath(); ctx.fill(); this.y -= 30/fps; if(this.y < -30){ this.die = true; } }); npc.add(ball.extend({ x : 0, y : 100 })) npc.play(); $config 1.fitSize : true //初始适应canvas节点尺寸 2.pixelRatio : window.devicePixelRatio || 1 //分辨率 3.lineFix : true //0.5像素边缘修正 4.fpsLimit : null //限制渲染数 #event 1.renderCallback 2.fpsCount
About
easy canvas,傻逼也能用canvas做动画系列
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published