• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Rotating Drawables

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!
 
Back
Top Bottom