テキストをビットマップでドロー
♥0 |
Line 32 |
Modified 2010-05-04 11:49:23 |
MIT License
archived:2017-03-20 02:11:03
ActionScript3 source code
/**
* Copyright curvedstraightline ( http://wonderfl.net/user/curvedstraightline )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/n9Ob
*/
package {
import flash.display.Sprite;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.text.TextFormat;
public class FlashTest extends Sprite {
public var _bmd:BitmapData;
public var _bp:Bitmap;
public var _txt:TextField;
public function FlashTest() {
_bmd = new BitmapData(
stage.stageWidth,
stage.stageHeight,
false,
0x000000
);
_bp = new Bitmap(_bmd);
addChild(_bp);
_txt = new TextField();
_txt.type = TextFieldType.DYNAMIC;
_txt.textColor = 0xffffff;
_txt.text = "test";
_txt.setTextFormat(new TextFormat("_self",48));
//addChild(_txt);
drawText();
}
public function drawText():void{
_bmd.draw(_txt);
//_bmd.width = 400;
}
}
}