문제

I am trying to rotate a canvas with canvas.rotate and move an object on it at the same time. The problem is that with the rotation, the coordinate system of the canvas rotates as well, so I get cases when my object is supposed to be moving along the y axis, but the y axis is rotated on place of the x axis. It is a mess. Is there a way to go around this?

도움이 되었습니까?

해결책

It's using matrix math; if you do things in the opposite order (translate then rotate, or vice versa), you'll get the opposite effect.

Also, use SetMatrix(null) to clear the matrix to the identity between operations; not sure if that's the kind of mess you're having trouble with.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top