我有一些对象,我将它们作为SurfaceView的一部分绘制到Canvas上。我想通过程序实现对它们进行旋转,例如myParticle.setRotation(90);
这是我目前绘制粒子的简化代码:
public class Particle {
public void draw(Canvas canvas){
image.setBounds((int)(xPos), (int)(yPos), (int)(xPos+radius), (int)(yPos+radius));
image.draw(canvas);
}
}