showing results for - "get item position in canvas"
Joséphine
12 Jan 2019
1function Rectangle(props){
2  var posX = this.posX = props.x;
3  var posY = this.posY = props.y;
4
5  this.width = props.width;
6  this.height = props.height;
7  this.fill = props.fill;
8
9  this.draw = function(){
10    ctx.fillStyle = this.fill;
11    ctx.fillRect(this.posX, this.posY, this.width, this.height);
12  }
13}