AS3 Rotate an object around its center point

后端 未结 2 451
小蘑菇
小蘑菇 2020-12-19 02:11

I want this object to rotate around its center rather than the top left corner. The code looks like this:

        switch (event.keyCode)
        {
                   


        
2条回答
  •  独厮守ぢ
    2020-12-19 02:55

    The easiest way to accomplish this is to add your car sprite/movieclip onto another sprite, where the x and the y coordinates are half the width and height properties. If the car is drawn in adobe flash you can also drag it to the top left, so that the center point is in the middle.

提交回复
热议问题