ความคิดเห็น: ฉันเชื่อว่าคุณตระหนักดีถึง HTML5 อยู่แล้ว คุณสามารถทำสิ่งต่าง ๆ มากมายด้วย HTML5 มาแบ่งปันวิธีการวาดรถถังโดยใช้ HTML5 รหัสเฉพาะมีดังนี้ ใครก็ตามที่สนใจสามารถอ้างถึงได้
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillstyle = "#99ff66";
ctx.fillrect (10,10,15,80);
//ctx.fillrect(10,80,15,80);
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillstyle = "#99ff66";
ctx.fillrect (60,10,15,80);
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillstyle = "#0033cc";
CTX.Fillrect (26,27,33,50);
ctx.fillstyle = "สีแดง";
ctx.beginpath ();
ctx.arc (43,52,17,0, math.pi*2, จริง);
ctx.closepath ();
ctx.fill ();
ctx.stroketyle = "#cccc00";
ctx.lineWidth = 2;
ctx.moveto (43,52);
ctx.lineto (43,10);
ctx.stroke ();