A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Which is faster copyPixel() or scrollRect()?

  1. #1
    Member
    Join Date
    Jun 2008
    Posts
    34

    resolved [RESOLVED] Which is faster copyPixel() or scrollRect()?

    Is it better/faster/smoother to use copyPixel() of scrollRect for fast animations?

    Is there some way to time those methods beside FPS?
    Is there some better way for fast and smooth scroling large bitmaps?

    And one more question, does Flash 9 has something like vertical sync, to wait for monitor refresh and than to draw picture?

  2. #2
    Member
    Join Date
    Jun 2008
    Posts
    34

    Smile

    Here are some measures I did:

    stage.frameRate = 1000;

    Debug Flash:

    160 fps scrollRect! very stable +-10
    110-227 fps bmp.x
    100 fps copyPixel


    FireFox from html:

    252 fps scrollRect
    161 fps copyPixels
    155-208 bmp.x,y

    It's very important to limit copyPixel i scrollRect if moveRect_XY = 0
    AND stage fps > 100


    I am still searching answers for my last two questions:

    -Is there some better way for fast and smooth scroling large bitmaps?

    -Is there something like vertical sync(), to wait for monitor refresh and than to redraw picture?

  3. #3
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    There is no vertical sync. I remember reading in tinic uro's blog that they were experimenting with vsync in the fullscreen mode of the flash9 player, but I've not seen that in action.

    Also, there may well be vsync with the hardware accelerated mode in the flash10 player, but that's speculation, it would seem logical though.

    Copypixels so far seems to be the smoothest I've used for scrolling, but I haven't played around with scrollrect. I don't think there's much difference in the output though.

    Your numbers look like scrollrect might be faster - Might have to give that a go.

  4. #4
    Member
    Join Date
    Jun 2008
    Posts
    34

    Thumbs up

    VENGEANCE MX said that "scrollRect is fast, VERY fast"
    But I didn't have numbers to compare. Smoothness is the same At least for what my eyes can see
    Good for small moveX,Y; bad for larger values.

    I would be twice better if there was vertical sync();

    I am scrolling with scrollRect = rect;
    Less CPU intensive and gives Flash more free time between frames.

    All questions have been answered. Though not in a way I was hoping.
    Waiting for Flash 10 we are - said master Yoda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center