X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=hexaboard_test.html;h=86abc2e0a1317820fc0705acd8eb5b1b60c6125d;hb=a1c48034e89a8d5af915ef3874c84888a281ca37;hp=800e1896cbe624fdc7f9bb31532a2ca12a927a48;hpb=067c675b75072c496f9665c4bf801cdc3d40398d;p=vchess.git diff --git a/hexaboard_test.html b/hexaboard_test.html index 800e1896..86abc2e0 100644 --- a/hexaboard_test.html +++ b/hexaboard_test.html @@ -37,13 +37,21 @@ for(var a=0;a<8;a++) { }} }} +let x=100, y=100, size=40; +ctx.beginPath(); +ctx.moveTo(x + size * Math.cos(0), y + size * Math.sin(0)); +for (let side=0; side < 7; side++) { + ctx.lineTo(x + size * Math.cos(side * 2 * Math.PI / 6), y + size * Math.sin(side * 2 * Math.PI / 6)); +} +ctx.fillStyle = "#333333"; +ctx.fill(); + var img = new Image(); img.onload = function() { ctx.drawImage(img, 0, 0, 60, 60); } img.src = "public/images/pieces/wb.svg"; -