分割
package {
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.geom.Matrix;
[SWF(width= 430, height= 430, backgroundColor= 0xafafaf)]
public class Test extends Sprite {
public function Test() {
var t:TextField = new TextField();
var f:TextFormat = new TextFormat();
f.size = 120;
t.defaultTextFormat = f;
t.text = "あ";
t.textColor = 0xffffff;
t.autoSize = TextFieldAutoSize.LEFT;
var k:uint = t.width;
var l:uint = t.height;
if (k < t.height) {
k = t.height;
l = t.width;
}
var bai:Number = 400 / k;
var bd:BitmapData = new BitmapData(400, 400, false, 0x0);
var mtbd:Matrix = new Matrix();
var bm:Bitmap = new Bitmap(bd);
bm.smoothing = true;
mtbd.scale(bai, bai);
mtbd.tx = (400-l*bai)/2;
bd.draw(t, mtbd);
for (var i:uint=0; i<4; i++) {
for (var j:uint=0; j<4; j++) {
var gbd:BitmapData = new BitmapData(100, 100, false);
var mtrx:Matrix = new Matrix();
mtrx.tx = -i*100;
mtrx.ty = -j*100;
gbd.draw(bd, mtrx);
var gbt:Bitmap = new Bitmap(gbd);
gbt.x = i*110;
gbt.y = j*110;
addChild(gbt);
}
}
}
}
}