BitmapData.draw - smoothing on Air on Android
Hi -
I'm trying to limit the number of textures I include in my package for a flash game I'm porting to Android using Air.
The game uses a blitting engine, and I am scaling the textures at runtime to use an appropriate sized bitmap for the different devices with their differing screen sizes.
This works absolutely fine on the desktop version of Air, but on the device itself any bitmapdata that is drawn at runtime does not seem to have smoothing applied - it all looks great as long as I the matrix used in the draw is never actually scaled.
Does smoothing work on bitmapdata.draw operations on Android?
Here's some code.
public function setupTexture($embedXML : Class, $bitmapData : BitmapData) : void {
var $scaleFactor : Number = ViewSettings.getInstance().scaleFactor; //this is set
var $matrix : Matrix = new Matrix();
$matrix.scale($scaleFactor, $scaleFactor);
_bitmapData = new BitmapData($bitmapData.width * $scaleFactor, $bitmapData.height * $scaleFactor, true, 0x00000000);
_bitmapData.draw($bitmapData, $matrix, null, null, null, true);
$bitmapData.dispose();
var $ba : ByteArray = new $embedXML() as ByteArray;
var $string : String = $ba.readUTFBytes($ba.length);
var $xml : XML = new XML($string);
initTextureAtlas($xml);
}
