Team:StuyGem NYC

From 2014hs.igem.org

(Difference between revisions)
Line 209: Line 209:
       }
       }
-
  canvas.addEventListener('mousemove', function(evt){
+
function writeMessage(canvas, message) {
-
  var mousePos = getMousePos(canvas, evt);
+
        var context = canvas.getContext('2d');
-
                if ((parseInt(mousePos.x) < 250) && (parseInt(mousePos.y) < 250)) {
+
        context.clearRect(0, 0, canvas.width, canvas.height);
-
                imageObj.src = 'https://static.igem.org/mediawiki/2014hs/4/42/TeamOn.png';
+
        context.font = '18pt Calibri';
-
imageObj2.src = 'https://static.igem.org/mediawiki/2014hs/7/79/Parts.png';
+
        context.fillStyle = 'black';
-
imageObj3.src = 'https://static.igem.org/mediawiki/2014hs/1/16/Sponsors.png';
+
        context.fillText(message, 10, 25);
-
imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
+
      }
-
}
+
 
-
}
+
      canvas.addEventListener('mousemove', function(evt) {
-
);
+
        var mousePos = getMousePos(canvas, evt);
 +
        var message = 'Mouse position: ' + mousePos.x + ',' + mousePos.y;
 +
        writeMessage(canvas, message);
 +
      }, false);
 +
 
 +
 
   
   
</script>
</script>
   </body>
   </body>
</html>
</html>

Revision as of 03:35, 18 April 2014


StuyGem NYC





Get in touch!

Visit Our Twitter Page!