canvas-helper.js

1.0.2 • Public • Published

CanvasHelper.js

HTML5 Canvas init help library

Installation

$ npm install canvas-helper.js
 import CanvasHelper from "canvas-helper.js";

or

<script src="./CanvasHelper.js"></script>

Usage

var width=512;
var height=512;
var helper=new CanvasHelper(width,height);

// document.querySelector(".container").appendChild(helper.canvas);
/*
helper.preload(function(resolve){
      var img=new Image();
      img.onload=function(){
           resolve();
      };
      img.src="a.jpg";
})
.setup(function(){

})
*/
// helper.stop();

helper.draw(function(){
    // this.stop();

    ctx.clearRect(0,0,width,height);
    //do something...
});

Readme

Keywords

Package Sidebar

Install

npm i canvas-helper.js

Weekly Downloads

6

Version

1.0.2

License

ISC

Unpacked Size

4.61 kB

Total Files

3

Last publish

Collaborators

  • anderpang