What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Hey. All I want to achieve is to scale a BitmapData of 400 × 200 pixels, to twice its size. No anti-aliasing or anything, just simply scale it.. So I’ve been trying to write my own function because Bitmap.draw uses anti-aliasing and stuff. But I have not succeeded and my code runs way too slow.
Could anyone write something fast for me?
Source bmd is 400×200 pixels and destination is 800×400 px.
This will work without antiAliasing.
var bd1:BitmapData = //whatever
var bd2:BitmapData = new BitmapData(bd1.width * 2, bd1.height * 2);
var matrix:Matrix = new Matrix(); matrix.scale(2, 2);
var bitmap2:Bitmap = new Bitmap(bd2);
EDIT: Minor correction.
Oh it does actually not anti-alias it. It seems it’s rather just the text I draw to the bitmapdata that suddenly over night decided to anti-alias…
This is how I draw it. prescale is the BitmapData
var textField:TextField = new TextField();
textField.defaultTextFormat = Main.textFormat(size, colour);
textField.embedFonts = true;
textField.text = text;
textField.width = textField.textWidth + 5;
prescale.draw(textField, new Matrix(1, 0, 0, 1, x, y));
static public function textFormat(size:uint = 12, colour:uint = 0xFFFFFF):TextFormat
return new TextFormat("Visitor TT2 BRK", size, colour);
The font is embedded and it’s [this one](http://www.dafont.com/visitor.font)