anodyne/AIR/intra/hsrc/entity/decoration/Map_Preview.hx

39 lines
837 B
Haxe

package entity.decoration
{
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.geom.Point;
import org.flixel.FlxSprite;
/**
* test
* @author Seagaia
*/
class Map_Preview extends FlxSprite
{
var erase_mask:FlxSprite=new FlxSprite();
public function new()
{
makeGraphic(16, 16, 0xffff0000);
erase_mask.makeGraphic(16, 16, 0x00000000);
for(i in 0...256){
if(i % 2==0){
erase_mask.framePixels.setPixel32(i % 16, i / 16, 0xff000000);
} else {
erase_mask.framePixels.setPixel32(i % 16, i / 16, 0x00000000);
}
}
erase_mask.blend='erase';
draw();
}
override public function draw():Void
{
pixels.copyChannel(erase_mask.framePixels, erase_mask.framePixels.rect, new Point, BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
dirty=true;
super.draw();
}
}