I will assume this is some sort of compatibility issue. Everything works perfectly in chrome, but in firefox the <canvas> simply doesn't draw anything.  function drawStage(stageNum) {     var cap = canvasArray.length; //keeps the canvasElem...
I'm using canvas for a game. I have a Sprite object which draws itself to the canvas, in the Sprite class I create the Image member along with it's src attribute when i create the object.  Here's the code that's not working:  Sprite.p...
I am working on a school project (only couple months of JS knowledge), and i stumbled upon this problem with drawing sprites on my canvas. To draw i use these bits of code.  treeImage = new Image(); treeImage.src = "sprites/treeSprites.png";...
I have an image on Canvas.  After rendering an image, I rotate the canvas to 90 degrees clockwise and then have to scale to fit the canvas.   Scaling an image to fit on canvas Resize image and rotate canvas 90 degrees  there is so many solutions avai...
Here's the code:  window.onload = function() {     var c = document.getElementById("myCanvas");     var ctx = c.getContext("2d");     var img = document.getElementById("scream");     ctx.drawImage(img, 0, 0, img.height, im...
I have an issue I'm having a hard time believing... It seems that when I draw to a dynamically created canvas in Firefox it wont render the first time that source is run... It seems to happen the first time the JavaScript in question is run eithe...
I wrote a simple script that take a frame from a video and draw it to a canvas. My problem is that the colors are changing between the video and the drawn image.  I put here the result next to the original to make it easier to see. The original one i...
I am experimenting with animation in <canvas> and can't work out how to draw an image at an angle. The desired effect is a few images drawn as usual, with one image rotating slowly. (This image is not at the centre of the screen, if that ma...
I am drawing on the canvas each time a user presses a button, however sometimes the image is not getting drawn on the canvas. I think this could be that the image isn't loaded in time before the context.drawimage function runs, as some of the sma...
I'm working on a simple JavaScript game using HTML5 canvas. It's a very typical game-loop setup involving:   init() function that initializes objects to be used the playfield, randomizing some start x/y positions and similar setup tasks draw(...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.