开发者

Drawing images off-screen results in performance drop

Im writing an IOS game using AS3. Here's the problem- I have an image on the screen that moves around. When the image's y value goes negative (the image is partly off the screen), the frame rates bottom out. I've gone over my code pretty thoroughly, even threw together a few test projects just to experiment. In all the test I do, whenever there is an object that is off screen, even partially, the frame rates drop. It's making scrolling backgrounds impossible. BTW, I'm using Pac开发者_StackOverflow中文版kager for iPhone and a 3G (not 3GS). Frame rates are normally 24 with no problems


What technique do you use to hide the invisible part of the screen? Mask + scrolling content, scrolling content or scroll rect? You should consider using scroll rect if that's not the technique you are using right now.


You need to clip all drawing to the visible image. Anytime you draw offscreen you lose hardware acceleration, which only works on video memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜