rock_on2109
Lurker
A simple question:
I am working on a game in which I have many Drawables that are drawn to a canvas. What is the easiest/most efficient way to rotate my drawables in the onDraw method.
I have been trying this code and have achieved undesired results:
canvas.save();
drawableX.setBounds(x,y,x2,y2);
drawableX.draw(canvas);
canvas.rotate(rotation,x,y);
canvas.restore();
this is repeated many times with different drawables and x,y,and rotation values.
Any help would be appreciated. Thanks in advance!
I am working on a game in which I have many Drawables that are drawn to a canvas. What is the easiest/most efficient way to rotate my drawables in the onDraw method.
I have been trying this code and have achieved undesired results:
canvas.save();
drawableX.setBounds(x,y,x2,y2);
drawableX.draw(canvas);
canvas.rotate(rotation,x,y);
canvas.restore();
this is repeated many times with different drawables and x,y,and rotation values.
Any help would be appreciated. Thanks in advance!