0

Help with Game Dev w/ Js 18.2

Always says null reading 'getContext' not sure why. I did copy it to JS still same result. This what I should input the code; var canvas= document.getElementById ('canvas'); var context= canvas.getcontext('2d'); var x=300; var y=350; context.arc( x, y, 50, 0, 2 * Math.PI); context.fillStyle='red'; context.fill();

6th Mar 2022, 8:53 PM
Neto
7 Respuestas
0
I'm still learning, but there was a problem with your solution which is an error according to the app. But the question is, is this wrong? Window onload()=function() {var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); var x = 300; var y = 350; } context.arc(x, y, 50, 0, 2 * Math.PI); context.fillStyle="red"; context.fill();
6th Mar 2022, 9:24 PM
Neto
0
Help
7th Mar 2023, 4:12 PM
M. Deepak
0
This not working
7th Mar 2023, 4:12 PM
M. Deepak