简体   繁体   中英

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 Packager 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM