1
似乎将矩阵rotate()应用于显示对象与DisplayObject.rotation不同。我想要的是使用matrix.rotate()获得使用rect.rotation = 45的相同结果。但实际结果是不一样的。actionscript矩阵rotate()和DisplayObject.rotation属性
代码示例:
public class Demo extends Sprite {
public function Demo() {
testRotation();
}
private function testRotation():void {
var rect:Shape = new Shape();
rect.graphics.beginFill(0xff0000,1);
rect.graphics.beginFill(0xff0000, 1);
rect.graphics.drawRect(0,0,100,100);
rect.graphics.endFill();
rect.x = 100;
rect.y = 100;
addChild(rect);
var matrix:Matrix = new Matrix();
trace(matrix);
matrix.rotate(Math.PI*45/180);
rect.transform.matrix = matrix;
}
}
你需要解释什么是 “不工作”。你想要什么效果?你有什么?我也不认为这个问题与Flex框架有什么关系,所以我不确定这个标签是否合适。 – JeffryHouser
@ www.Flextras.com,我已经重述了我的问题,谢谢你的建议 – jason