AS3补间动画抖动
我目前有一个精灵网格,其中包含位图数据(照片)作为容器精灵的子级。我正在使用这个补间库来移动容器精灵以将图像居中。我的问题是,在动画结束时它有点抽搐。这种情况仅在您第一次移动到图像时发生,第二次则非常平滑。我想知道以前是否有人遇到过这个问题,或者如果是缓冲区问题,是否有办法将所有内容强制放入闪存缓冲区?它不会在动画之前动态加载图像,它们都是在开始时加载的。
非常感谢任何帮助!
I currently have a grid of sprites that contain bitmap data (photographs) as children of a container sprite. I'm using this tweener library to move the container sprite to centre an image. My issue is that at the end of the animation it jerks a little. This only happens the first time you move to an image, the second time it's very smooth. I was wondering if anyone has had this problem before or if it's a buffer problem is there a way to force everything into the flash buffer? It's not dynamically loading the images before animating them, they're all loaded at the beginning.
Any help is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果没有看到代码,很难说,但我会研究两件事:
使用补间库的延迟功能或使用计时器来延迟第一个动画。第一次可能有一些东西与动画同时执行,这是查看是否是这种情况的快速方法。
查看容器精灵的 .cacheAsBitmap 属性。无论精灵(位图)内容如何,此设置仍然会影响精灵移动/动画的方式。 Tween 库可以在幕后设置此属性。尝试在动画之前将其显式设置为 true 或 false。
祝你好运
It's tough to say without seeing code, but I would look into two things:
Delay the first animation using the tween lib's delay feature, or with a Timer. There might be something executing at the same time as the animation the first time around, and this is a quick way to see if it's the case.
Look into the container sprite's .cacheAsBitmap property. Regardless of the sprite's (bitmap) contents, this settings still can effect how a sprite moves / animates. Tween libraries may set this property behind the scenes. Try explicitly setting it to true or false before your animation.
good luck
从您提供的少量信息来看,我只能推断第二次位图数据已被缓存并被删除。不需要从内存中加载它。在这种情况下,cacheAsBitmap 属性肯定会有所帮助。
另外,如果是上述情况,则 Blitting 是最好的方法。了解有关 blitting 的更多信息,此处。
From the little information you provided, all I can reason is that the second time the bitmap data has been cached & does not require to load it from memory. In that case the cacheAsBitmap property will definitely help.
Also if the above was the case, Blitting is the best way to go. learn more about blitting, here.