HTML5, JavaScript and drawing multiple rectangles in a canvas

后端 未结 2 1879
慢半拍i
慢半拍i 2020-12-19 03:44

Why won\'t my multiple rectangles draw in the canvas?



  
    

        
2条回答
  •  一个人的身影
    2020-12-19 04:10

    Don't you need to give it the fill color?

    context.fillStyle = i.fill;
    context.fillRect(i.x,i.y,i.w,i.h);
    

提交回复
热议问题