Answers for "get item position in canvas"

0

get item position in canvas

function Rectangle(props){
  var posX = this.posX = props.x;
  var posY = this.posY = props.y;

  this.width = props.width;
  this.height = props.height;
  this.fill = props.fill;

  this.draw = function(){
    ctx.fillStyle = this.fill;
    ctx.fillRect(this.posX, this.posY, this.width, this.height);
  }
}
Posted by: Guest on August-25-2020

Code answers related to "get item position in canvas"

Code answers related to "Javascript"

Browse Popular Code Answers by Language