1 Reply Latest reply on Aug 6, 2010 5:56 AM by rejwan2

    bitmapdata.copyPixels issue

    rejwan2

      Hi everyone,

      I'm currently working on a hexagon map that will work with blit scrolling, meaning I draw only what is needed plus a small buffer and redraw whenever needed.

       

      Now - Going left and right works perfectly - however, when I try to scroll down, a very peculiar issue occurs.

       

      The map is first copied without the row that was removed from view, and then the new buffer rows are being drawn.

       

      I've isolated the issue to the initial cropping of the photo and found a very unusual bug and was hoping someone here could help me.

       

      Here's the screenshots from my debugs:

       

      bufferBD.copyPixels(bufferBD, new Rectangle(0, 0, bufferBD.width, bufferBD.height), new Point());

      yIs0.jpg

       

      bufferBD.copyPixels(bufferBD, new Rectangle(0, 400, bufferBD.width, bufferBD.height), new Point());

      yIs0.jpg

       

      Now here the crazy begins, any Y given between (more or less) 0 and 400 causes this issue:

      In this sample, HEX_HEIGHT = 87

      bufferBD.copyPixels(bufferBD, new Rectangle(0, HEX_HEIGHT, bufferBD.width, bufferBD.height), new Point());

      yIsHexHeight.jpg

       

      Please help!

      Thanks,

      Ron