Rotating Drawables


Last Updated:

  1. rock_on2109

    rock_on2109 New Member This Topic's Starter

    Joined:
    Jan 10, 2010
    Messages:
    4
    Likes Received:
    0
    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!
     

    Advertisement

Share This Page

Loading...