Actionscript 3 as3中组的旋转
请帮我解决一个大问题 我需要从中心旋转布局(火花组件组),我可以从中心旋转布局。但一旦我旋转它,它就会给我锯齿状的边缘。比如,如果我旋转一个图像,我可以将它的位图平滑设置为true,这样就不会出现锯齿状的边缘。但在小组中没有平滑变量,请告诉我如何实现这一点Actionscript 3 as3中组的旋转,actionscript-3,blackberry-playbook,Actionscript 3,Blackberry Playbook,请帮我解决一个大问题 我需要从中心旋转布局(火花组件组),我可以从中心旋转布局。但一旦我旋转它,它就会给我锯齿状的边缘。比如,如果我旋转一个图像,我可以将它的位图平滑设置为true,这样就不会出现锯齿状的边缘。但在小组中没有平滑变量,请告诉我如何实现这一点 var rotateMatrix:Matrix = group_icons.transform.matrix; var rotatePoint:Point = rotateMatrix.
var rotateMatrix:Matrix = group_icons.transform.matrix;
var rotatePoint:Point =
rotateMatrix.transformPoint(
new Point((515/2), (515/2)));
rotateMatrix.translate(-rotatePoint.x, -rotatePoint.y);
var num : Number = getAngleFromMouseCoord(mouseX , mouseY , new Point(0,600) ) ;
/* if(currentAngle != 0 && currentAngle > num)
{
currentAngle = num ;
num = -num ;
}
else
currentAngle = num ; */
if(direction == true )
rotateMatrix.rotate(num/30);
else
rotateMatrix.rotate(-num/30);
rotateMatrix.translate(rotatePoint.x, rotatePoint.y);
group_icons.transform.matrix = rotateMatrix ;
我在输入帧事件时调用此函数。查看将cacheAsBitmap设置为true是否有帮助:
group_icons.cacheAsBitmap = true;
如果没有,您可以将组绘制成位图并显示,但它的子对象将不具有交互性
var bmdData:BitmapData = new BitmapData(group_icons.width,group_icons.height,true,0x0000000);
bmdData.draw(group_icons);
var bmp:Bitmap = new Bitmap(bmdData,"auto",true);
// apply transformations to the bmp here
var uicomponent:UIComponent = new UIComponent();
uiComponent.addChild(bmp);
someUIElement.addElement(uicomponent);
您需要使用UIComponent包装位图,才能将其添加到flex组件。是的,我尝试过。。但正如你从我的代码中看到的。。我正在让组的矩阵旋转它。但若我要这样做,我需要得到这个位图的矩阵,通过它我将无法在组上设置它&组元素也不是难解的。