1.1.0 • Published 10 years ago

np-canvas v1.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
10 years ago

#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

1.1.0

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago