From: Elijah Cohen Date: Wed, 8 May 2019 09:09:58 +0000 (-0500) Subject: very basic ending text X-Git-Url: https://git.eli173.com/?a=commitdiff_plain;h=478346bbab9bd6be945c69f36c9f471e8a1de8d1;p=pong_br very basic ending text --- diff --git a/web/draw.js b/web/draw.js index 1312ccd..0b3ca4d 100644 --- a/web/draw.js +++ b/web/draw.js @@ -110,7 +110,15 @@ var drawLine = function(ctx, color, c1, c2) { } var drawOverlay = function(ctx, place) { - + ctx.save(); + //ctx.font = what should it equal? mind sizes on mobile + ctx.setTransform(1,0,0,1,0,0); + ctx.fillStyle = 'rgba(225,225,225,100)' + var string1 = "you placed: " + place; + var string2 = "click or press =g= to play again" + ctx.fillText(string1, 0, 100); + ctx.fillText(string2, 0, 200); // magic number... + ctx.restore(); } diff --git a/web/main.js b/web/main.js index 024b6ba..bc021a1 100644 --- a/web/main.js +++ b/web/main.js @@ -52,6 +52,7 @@ var main = function() { // starts everything, gets us going, setup ish if(status) { // add event listener if dead canvas.onclick = function(e) {location.reload()} // okay, outside of 'input' file... + canvas.onkeydown = function(e) {if(e.keyCode == '71') location.reload()}; } }