Показать сообщение отдельно
Старый 11.11.2011, 03:19
in4core вне форума Посмотреть профиль Отправить личное сообщение для in4core Найти все сообщения от in4core
  № 4  
Ответить с цитированием
in4core
 
Аватар для in4core

Регистрация: Mar 2009
Сообщений: 4,219
Записей в блоге: 14
Цитата:
Интересно "FieldTextClass" это откуда?
Делюсь

Код AS3:
package com.in4core.text 
{
	import flash.text.TextField;
	import flash.text.TextFormat;
	/**
	 * ...
	 * @author in4core
	 */
	public class DisplayText extends Object 
	{
		private static var _textfield:TextField;
 
 
		public static function addField ( font:String = null , size:uint = 12, bitmapFonts:Boolean = false, 
 
		autosize:String = 'left', isMulti:Boolean = false, text:String = '' ) : TextField
 
		{
			_textfield = null;
 
			_textfield = new TextField();
 
			_textfield.defaultTextFormat = setFormat(size, font);
 
			_textfield.autoSize = autosize;
 
			_textfield.text = text;
 
			if (isMulti) _textfield.multiline = true;
 
			_textfield.selectable = false;
 
			if (!bitmapFonts) _textfield.antiAliasType = 'advanced';
 
			if (font != null) _textfield.embedFonts = true;
			else font = '_sans';
 
			return _textfield;
		}
 
		private static function setFormat( size:uint, font:String ):TextFormat {
 
			var tf:TextFormat = new TextFormat();
 
			tf.size = size;
 
			tf.font = font;
 
			return tf;
		}
 
	}
 
}
Код AS3:
package com.in4core.utils 
{
	/**
	 * ...
	 * @author in4core
	 */
	public class FontAssets extends Object 
	{
 
 
		[Embed(source = '/courbd.ttf', fontName = 'f_1'
		,fontFamily  = "Courner"
		,fontStyle   ='bold'
		,fontWeight  = 'bold'
		,mimeType = "application/x-font-truetype"
		,embedAsCFF = 'false')]
		public static const ver:Class;
 
 
 
	}
use
Код AS3:
FontAssets;
var tf:TextField = DisplayText.addField('f_1' , 14);
tf.text = 'hello world';
__________________
Марк Tween


Последний раз редактировалось in4core; 11.11.2011 в 03:21.