I use the draw function to display objects of the class Mover.
After the objects are displayed I want to rotate the result around the center.
function draw() {
if(frameCount < 600){
for (var i = 0; i < myMover1.length; i++) {
myMover1[i].update(count);
myMover1[i].distance(myMover1);
}
for (var i = 0; i < myMover2.length; i++) {
myMover2[i].update(count);
myMover2[i].distance(myMover2);
}
for (var z = 0; z < myMover3.length; z++) {
myMover3[z].update(count);
myMover3[z].distance(myMover3);
}
for (var z = 0; z < myMover4.length; z++) {
myMover4[z].update(count);
myMover4[z].distance(myMover4);
}
}
else{
//Rotate Canvas
}
}
Is it possible to rotate the whole canvas around its center?
thanks for the reply. The thing is that:
The object is generated in draw (out of many object lines). After the generation finished the result should be rotated around its center.
I used frameCount to stop the generation. But not the complete result is rotated but only single lines.
My idea was to save the canvas as image and re-load it…