【发布时间】:2011-07-07 03:06:25
【问题描述】:
我在网上找到了这个动作脚本来围绕它的中心点旋转一个精灵,但是当我使用它时出现两个错误。 1084:语法错误:在左括号之前需要标识符。 1084: 语法错误:在 leftbrace 之前需要 rightparen。 另外,在 angleDegrees 的位置,我是否输入了我希望精灵旋转的角度?
var point:Point=new Point(spr_box.x+spr_box.width/2, spr_box.y+spr_box.height/2);
rotateAroundCenter(spr_box,45);
function rotateAroundCenter (ob:*, angleDegrees) {
var m:Matrix=ob.transform.matrix;
m.tx -= point.x;
m.ty -= point.y;
m.rotate (angleDegrees*(Math.PI/180));
m.tx += point.x;
m.ty += point.y;
ob.transform.matrix=m;
}
【问题讨论】:
标签: actionscript-3 sprite image-rotation