闪光CS5 ...元素捕捉到像素,而移动? [英] Flash CS5...elements are snapping to pixels while moving?
问题描述
我有一个导入PNG在info_icon'符号。 我还有一个PNG在info_content'符号输入。
I have an imported png in a 'info_icon' symbol. I have another imported png in a 'info_content' symbol.
我有一些code,使您可以拖动一个地图符号的一个实例。在这个地图符号是info_icon和info_content。
I have some code that allows you to drag an instance of a 'map' symbol around. Inside this map symbol are instances of 'info_icon' and 'info_content'.
当我拖动地图,慢慢的,我可以看到info_icon实例和info_content情况下,轻摇非常轻微......我想排队像素。
When I drag the map slowly, I can see the info_icon instances and info_content instances, jiggle ever so slightly...I think to line up to pixels.
我试图找出如何停止。我看的pixelSnapping属性,它似乎并不能帮助......也许我用错了。
I'm trying to figure out how to stop that. I'm looking at the pixelSnapping property and it doesn't seem to be helping...perhaps I'm using it wrong.
info_button_mc.pixelSnapping = PixelSnapping.NEVER;
推荐答案
确认设置平滑为true的位图。
Make sure to set smoothing to true on the bitmap.
尝试设置的scaleX为0.999或类似的东西(换句话说,足够接近1,你不能告诉它是被缩放)。
Try setting scaleX to 0.999 or something like that (in other words, close enough to 1 that you can't tell it's being scaled).
由于某种原因,平滑似乎并没有真正得到应用,除非对象的比例为1比其它的东西。
For some reason smoothing doesn't seem to actually get applied unless the scale of the object is something other than 1.
记住,你应该使用位图在这里工作,所以一定要导出PNG为ActionScript(右键点击PNG->属性),并给它一个类名,然后:
Remember you should be working with bitmaps here, so make sure to export the PNG for ActionScript (right click on PNG->properties) and give it a class name and then:
var bitmap : Bitmap = new Bitmap(new YourPNG(), PixelSnapping.NEVER);
addChild(bitmap);
bitmap.smoothing = true;
bitmap.scaleX = 0.999;
这篇关于闪光CS5 ...元素捕捉到像素,而移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!