Draknek/FlashPunk — pull request #77 by haydn (2012-04-11 14:26:07+00:00)
Title: A syncWith method for Pixelmask.

I've added a method to `Pixelmask` that makes it easy to sync it with an instance of `Image`. For example in an entity you might have this:

```actionscript
public function MyEntity()
{
var image:Image = new Image(IMAGE);

image.originX = -200;
image.angle = 45;

graphic = image;
mask = new Pixelmask(image);
}
```

That will automatically create a pixel mask with the same bounds and matching data to the image.

If the image is constantly updating the Pixelmask can be updated with it. Just use the `syncWith` method:

```actionscript
override public function update():void
{
super.update();

(graphic as Image).angle += 5;
(mask as Pixelmask).syncWith(graphic as Image);
}
```