Has anyone else come across this? I'm drawing a circle on a sprite with flixel.util.FlxSpriteUtil.drawCircle() as follows:
var tmpSprite:FlxSprite = new FlxSprite( 0, 0, new BitmapData( Math.floor(thisRoom.pix.width), Math.floor(thisRoom.pix.height), true, 0xFF9900FF ) );
// draw the room
flixel.util.FlxSpriteUtil.drawCircle(
tmpSprite, // on this sprite
radius, // x
radius, // y
radius, // radius
FlxColor.WHITE
);
for( tmpy in 0...Math.floor(thisRoom.rect.height) ) {
for( tmpx in 0...Math.floor(thisRoom.rect.width) ) {
trace( StringTools.hex( tmpSprite.pixels.getPixel32( tmpx, tmpy ) ) );
}
}
As you see I'm then checking the color value of each pixel, and this is the problem: instead of 0xFFFFFFFF (FlxColor.WHITE) I find 0xFEFFFFFF.
...
PlayState.hx:709: FF9900FF (sprite's original background color)
PlayState.hx:709: FEFFFFFF (should be white)
...
I hope I'm missing something obvious that's changing the alpha value of FlxColor.WHITE. The other purple color appears unchanged.
I have wondered if it has something to do with UInt vs Int, although I thought UInt is really Int anyway in Haxe, and that I read that for this reason UInt references were being changed to Int in the next HaxeFlixel? I tried casting UInt to Int in the trace without change. I've also tried turning off transparency support on the FlxSprite without change.
I haven't dug into the drawCircle() itself yet. Also this is on iOS target - I haven't tested on Flash to see if it's consistent because I would have to change some other code to get it to compile.
Thoughts?
Phil