Im having a really odd issue with the rendering of my game and I was wondering if anyone could help.
What im seeing is an odd white outlining around the edge of my sprite:
Its really odd, the outline only becomes visible after applying my ColorMatrixFilter. There is no outline on the asset itself.
The important bits of my code are as follows:
// Constructing the filter
var a:Array = new Array();
var f : ColorMatrixFilter = new ColorMatrixFilter(a);
// Extract out the tile asset
var s : Sprite = new TILE1();
var b : Rectangle = s.getBounds(s);
var m : Matrix = new Matrix();
m.translate(Math.round(1 - b.x), Math.round(1 - b.y));
// Convert it to BMD while applying filter
_tile = new BitmapData( 2 + b.width, 2 + b.height, true, 0);
_tile.applyFilter(_tile, _tile.rect, new Point(), f);
_target.copyPixels(_tile, _tile.rect, new Point(100, 100));
I have uploaded a small sample project here: http://mikecann.co.uk/DumpingGround/TEST.zip
Anyone have a clue whats doing on here?
Is your sprite a png or something with transparency around the edge? If so is it antialiased?
No, its a sprite in a swf.
I think I know why it is however, the filter that im using was sort-of hand-crafted by tweaking values as such I belive its causing strange artifacts when the filter is applied. I am in the process of writing a better tool to produce a better filter.