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

[CLOSED] FlxScrollZone - non-alpha? #1

Closed FlixelCommunityBot closed 10 years ago

FlixelCommunityBot commented 10 years ago

Issue by SeiferTim from Monday May 16, 2011 at 17:38 GMT Originally opened as https://github.com/photonstorm/Flixel-Power-Tools/issues/1


ScrollZone doesn't work too well if you're messing with alpha transparencies. To fix, in the scroll function, right I set data.source.pixels to a new, empty, transparent BitmapData. It seems to work without any speed/performance problems (but I'm using a tiny Png).

This is my 'fix':

zone.buffer.graphics.endFill();
data.source.pixels = new BitmapData(data.source.pixels.width, data.source.pixels.height, true, 0x00000000); /// <- added
data.source.pixels.draw(zone.buffer, zone.drawMatrix);
...```
FlixelCommunityBot commented 10 years ago

Comment by photonstorm from Monday May 16, 2011 at 18:39 GMT


Thanks - this is fixed in FlxScrollZone v1.4 which I'll push to dev tonight. I've done it a little different to the way you suggested (I use bitmapData.fillRect rather than create a new bitmapData every loop) but it works just the same! It can be applied to the whole image or just one scroll zone.

FlixelCommunityBot commented 10 years ago

Comment by photonstorm from Tuesday May 17, 2011 at 00:49 GMT


This is now fixed in v1.6 Beta 1 which is up on the dev branch.