FlixelCommunity / flixel

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.
http://flixelcommunity.org/
Other
84 stars 17 forks source link

possible FlxCamera screen conflict #168

Open Beeblerox opened 11 years ago

Beeblerox commented 11 years ago

It may appear if you create:

 FlxSprite.makeGraphic(FlxG.width, FlxG.height, 0);

The problem is in following: default camera's screen:FlxSprite have the same size and color, so this newly created sprite and camera's screen will share the same pixels BitmapData.

Possible solution for this issue is to replace lines from FlxCamera:

screen = new FlxSprite();
screen.makeGraphic(width,height,0,true);
screen.setOriginToCorner();
buffer = screen.pixels;

with

buffer = new BitmapData(width,height,true,0);
screen = new FlxSprite();
screen.pixels = buffer;
Dovyski commented 11 years ago

I'm moving this to the future release milestone.