摘要: AS3中,使用DisplayObject的transform/matrix,需要先clone出来,再变换,再赋值回去,这样才会对DisplayObject产生影响,不能直接对原Matrix操作。详细见下边的代码:var a:Sprite = new Sprite();a.graphics.beginFill(0);a.graphics.drawRect(0,0,100,100);a.graphics.endFill();a.x = a.y = 10;addChild(a);trace (a.transform.matrix ); var m:Matrix = a.transform.matri 阅读全文
posted @ 2013-09-06 12:52 拂晓风起-Kenko 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 简单来说,原理就是利用matrix运算,先把旋转点移到原点位置,旋转变换后再恢复到原来的位置var a:Sprite = new Sprite();a.graphics.beginFill(0);a.graphics.drawRect(0,0,100,100);a.graphics.drawCircle(0,0,6);a.graphics.endFill();addChild(a);a.x = a.y = 100;trace (a.transform.matrix);var m:Matrix = a.transform.matrix.clone();var dx :Number = m.tx; 阅读全文
posted @ 2013-09-06 12:51 拂晓风起-Kenko 阅读(1033) 评论(0) 推荐(0) 编辑