textformatmanage.as
来自「as3歌词解析实例,源文件」· AS 代码 · 共 42 行
AS
42 行
package com.ninemoon
{
import flash.display.Sprite;
import flash.text.TextFormat;
public class TextFormatManage extends Sprite
{
private static var _textFormat:TextFormat=new TextFormat();
public function TextFormatManage()
{
//_textFormat=new TextFormat();
}
public static function getFormat(str:String):TextFormat
{
var textformat:TextFormat;
switch (str) {
case "format_1" :
textformat=createFormat_1();
break;
case "format_2" :
textformat=createFormat_2();
break;
}
return textformat;
}
private static function createFormat_1():TextFormat
{
_textFormat.size=12;
_textFormat.color=0x7578ab;
_textFormat.font="宋体";
return _textFormat;
}
private static function createFormat_2():TextFormat
{
_textFormat.size=12;
_textFormat.color=0xffffff;
_textFormat.font="宋体";
return _textFormat;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?