Closed amravazzi closed 5 years ago
Hello, thanks for the report, I'll look into this!
It seems rotate()
was available since at least 0.6.0
, so it's probably not related to vue-p5
still being on p5@0.7.2
.
Have you tried doing the same thing without vue-p5
? Can you share a code sample that doesn't work even though it looks like it should?
Looks like rotate()
is just slightly counterintuitive. You have to call it before drawing the object you want to rotate, not after, because instead of rotating the already drawn image it rotates the matrix used to draw new stuff.
In your case it should be enough to call rotate()
in the beginning of the draw()
method.
I'll change the example.
I updated the example repo.
Closing this for now; I'd love to hear whether you managed to make it work!
Thank you very much and sorry for the late reply. The example you posted was very helpful!!
You're welcome :)
Hi, I'm trying to use the p5's method
rotate()
(https://p5js.org/reference/#/p5/rotate) but I'm just not able. I want the canvas to render already rotated. I triedsketch.rotate(45)
inside many methods such assetup()
,draw()
but it does not rotate the canvas. How can I overcome that?