Adding a canvas-sprite object to a canvas?

I just stepped through your code. MainContext. DrawImage(m.

Canvas, 0, 0, m. Width, m. Height); is occuring before drawFrame gets called because the image isn't ready yet.So the mainContext.

DrawImage is drawing a canvas that has nothing painted on it yet. Then the Sprite's canvas is loaded and ready to go, but its too late! For confirmation, you can call MainContext.

DrawImage(m. Canvas, 0, 0, m. Width, m.

Height); in the browser console and you will see the minotaur appear.

– Alex C Apr 17 at 22:06 thanks Simon. This has worked. – Alex C Apr 17 at 23:09.

As Simon Sarris said, you are drawing the canvas too soon. What you'll need to do is either loop until the sprite is ready, or add a callback to your sprite that is called after it draws. You already have a function attached to the image's onload event, you should be okay to do something similar for the whole sprite.

Thanks, I've added some code that at the very least gets it on the page. I've pushed to git so you can see it working. – Alex C Apr 17 at 23:09.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions