Canvas javascript drawImage method
问题 Result : It doesn't load the image to the canvas. I'm getting white rectangle, any idea why? I thought I could just call the draw method directly from the variable , like e.g : bg.draw, or does that mean that I need to re-draw the Image again on the canvas and re-run the bg.draw? const cvs = document.getElementById("firstplatform"); const ctx = cvs.getContext("2d"); // GAME VARS AND CONSTS let frames = 0; // LOAD IMAGE const sprite = new Image(); sprite.src = "img/sprite.png"; //BACKGROUND