FlixelCommunity / Flixel-Power-Tools

The Flixel Power Tools are a package of classes designed to provide extra functionality to your Flixel games. Originally created by Richard Davey (Photon Storm), this is the Flixel Community fork of the library, striving to keep the library living and up to date with the latest version of Flixel.
http://www.photonstorm.com/flixel-power-tools
Other
8 stars 3 forks source link

FlxScrollZone stops scrolling #27

Open DigiEggz opened 8 years ago

DigiEggz commented 8 years ago

After a certain amount of time, the scrollMatrix stops functioning because it eventually goes out of bounds.

This can be fixed by resetting the scrollMatrix after it has scrolled the length of the input graphic. Add the following code after data.source.pixels.draw(zone.buffer, zone.drawMatrix); in scroll()

if(zone.scrollMatrix.tx <= -zone.region.width)      
    zone.scrollMatrix.tx = 0;