Flex/ActionScript - rotate Sprite around its center

前端 未结 6 1527
一向
一向 2021-02-07 13:15

I have created a Sprite in Actionscript and rendered it to a Flex Canvas. Suppose:

var fooShape:Sprite = new FooSpriteSubclass();

fooCanvas.rawChildren.addChild         


        
6条回答
  •  星月不相逢
    2021-02-07 13:59

    Actually I had to add this code to make above solutions work for me.

    private var _rotateCount = 0;
    var _origginalMatrix:Matrix=new Matrix();
    .........
    if (_rotateCount++ >= 360 / angleDegrees)
    {
        myObject.transform.matrix = _origginalMatrix;
        _rotateCount = 0;
                return;
    }
    
    var matrix:Matrix = myObject.transform.matrix;
    .... 
    

    Without that after some long time rotated object slowly moves somewhere right top.

提交回复
热议问题