|
|
@ -23,6 +23,12 @@ |
|
|
|
position: relative; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
#message { |
|
|
|
position: absolute; |
|
|
|
z-index: 1; |
|
|
|
top: 20px; |
|
|
|
right: 50px |
|
|
|
} |
|
|
|
</style> |
|
|
|
</head> |
|
|
|
<body> |
|
|
@ -34,7 +40,10 @@ |
|
|
|
<canvas id="textoverlay"></canvas> |
|
|
|
<div id="controls"></div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<form id="message" method="POST" action='#'> |
|
|
|
<input type="text" name="message_data" id="message_data" placeholder="Message"> |
|
|
|
<input type="submit" value="Send"> |
|
|
|
</form> |
|
|
|
|
|
|
|
<!--<h2 id="start">Press a button on your controller to start</h2>--> |
|
|
|
|
|
|
@ -148,6 +157,11 @@ socket.on('data', (data) => { |
|
|
|
ctx.font = "24px Arial"; |
|
|
|
ctx.fillStyle = "blue"; |
|
|
|
//ctx.fillText("Hello World", canvas.width/3, 30); |
|
|
|
|
|
|
|
$('form#message').submit(function(event) { |
|
|
|
gp_socket.emit('text', {data: $('#message_data').val()}); |
|
|
|
return false; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
</script> |
|
|
|