闪存穿越 - 矩阵是对我意味着:(旋转矩阵+ + JSFL通过JSFL
我必须编写创建我的Flash场景中的文本JSFL脚本,并用任意角度旋转。 我想象要创建并以45度旋转!“Hello World”的,我的代码看起来像这样:
rotateAngle = 45;
//creates my new text at x:0, y:0 coordinates
fl.getDocumentDOM().addNewText({left:0, top:0, right:10, bottom:10});
fl.getDocumentDOM().setTextString('Hello World!');
var mat = fl.getDocumentDOM().selection[0].matrix; //get the current matrix
// set rotation
mat.a = Math.cos(rotateAngle);
mat.b = Math.sin(rotateAngle);
mat.c = - Math.sin(rotateAngle);
mat.d = Math.cos(rotateAngle);
fl.getDocumentDOM().selection[0].matrix = mat; //apply new matrix
的问题是:适用于我的文字旋转是58.3,而不是45
我有承认我对矩阵有点小...所以我使用了“ma trix transformation for rotation“这里:http://www.senocular.com/flash/tutorials/transformmatrix/
想法?
谢谢。
你是我的超级明星(我对我的错误感到非常惭愧)。 非常感谢。 – lvictorino 2010-10-27 20:54:37
我会永远在你身边(这个网站是一个私人聊天权吗?:D) – 2010-10-27 20:58:57