Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

draw rectangle html canvas

function drawRectangle(point: Vector, width: number, height: number) {
  this.context.beginPath();
  this.context.rect(point.x, point.y, width, height);
  this.context.fill();
  this.context.stroke();
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #draw #rectangle #html #canvas
ADD COMMENT
Topic
Name
8+4 =