I want to rotate an image IN javascript. The variable used for the image in javascript is heroImage. I am using jquery rotate, it works fine only when rotating images in html, but not in javascript. Normally it looks something like this
$("#image").rotate(angle);
But that only works for images created in html.
This is part of the code im currently using
var heroImage = new Image();
heroImage.src = "images/hero.png";
and its drawn of canvas , if that helps. the problem is #image can only refer to a html div element afaik.. The answer that im not looking for is this:
$("#image").rotate(angle);
Because that only works for html images
Its for a game, so everything has to be in javascript , anything css related doesnt seem to work. It also has to be IE9 compatible