在 Flash 中编写自己的渲染器的主要性能技巧是什么?
有人有这方面的实践经验吗?
编辑:具体来说,我正在谈论将 2D 图形直接渲染到一个位图缓冲区上。
Does anyone have hands-on experience on this?
EDIT: Specifically, I am talking about rendering 2D graphics directly onto one bitmap buffer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你说的是二维绘图吗?
如果是这样,那么只需要一条建议。无需使用 MovieClip,您可以将内容预渲染到 BitmapData 实例中,然后使用 copyPixels 将它们绘制到屏幕表面,从而获得显着的速度提升。
您不会从
draw
中获得任何速度提升。必须是copyPixels
。工作中的一个很好的例子:
http://www. electrotank.com/junk/mike/flash/copyPixel/
Are you are talking about 2D drawing?
If so, then only one piece of advice is necessary. Instead of using MovieClips, you will have a phenomenal speed increase from prerendering your content into
BitmapData
instances and then usingcopyPixels
to draw them to the screen surface.You won't get any speed increase whatsoever from
draw
. Has to becopyPixels
.A good example of this at work:
http://www.electrotank.com/junk/mike/flash/copyPixel/
使用精灵表是一种方便且有效的技术。
Using sprite sheets is a handy technique that can work well, too.