📅  最后修改于: 2022-03-11 15:03:18.597000             🧑  作者: Mango
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);
}
}