| 패키지 | flashx.textLayout.factory |
| 클래스 | public class StringTextLineFactory |
| 상속 | StringTextLineFactory TextLineFactoryBase Object |
| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
텍스트 줄은 정적이며 단일 서식과 단일 단락으로 구성되고, 지정된 테두리 사각형에 맞게 만들어집니다.
StringTextLineFactory는 여러 번 반복되는 호출에서 단일 TextFlow, ParagraphElement, SpanElement 및 ContainerController 객체를 다시 사용하므로 이 클래스를 활용하면 TextLines를 효율적으로 만들 수 있습니다. 하나의 팩토리를 만들어 반복하여 사용할 수 있습니다. 또한 호출할 때마다 모든 파트를 동일하게 다시 사용할 수 있습니다. 예를 들어 다양한 서식과 경계를 다시 사용할 수 있습니다.
참고: 여러 가지 서식 또는 단락을 사용하거나 인라인 그래픽을 포함하는 정적 줄을 만들려면 TextFlowTextLineFactory 및 TextFlow 객체를 사용하십시오.
참고: StringTextLineFactory는 텍스트를 자를 때 truncationOptions에 설정된 truncationIndicatorFormat 속성을 무시합니다.
관련 API 요소
| 속성 | 정의 주체 | ||
|---|---|---|---|
![]() | compositionBounds : Rectangle
만들어진 텍스트 줄이 들어갈 사각형입니다. | TextLineFactoryBase | |
| configuration : IConfiguration [읽기 전용]
내부 TextFlow 객체에서 사용되는 구성입니다. | StringTextLineFactory | ||
![]() | constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | |
| defaultConfiguration : IConfiguration [정적] [읽기 전용]
아무 설정도 지정되지 않은 경우 이 팩토리에 사용되는 기본 구성입니다. | StringTextLineFactory | ||
![]() | horizontalScrollPolicy : String
컴포지션 경계가 충분히 크지 않을 경우 줄이 만들어지는 방식을 지정합니다. | TextLineFactoryBase | |
![]() | isTruncated : Boolean [읽기 전용]
줄이 마지막으로 만들어졌을 때 텍스트가 잘렸는지 여부를 나타냅니다. | TextLineFactoryBase | |
| paragraphFormat : flashx.textLayout.formats:ITextLayoutFormat
단락 서식입니다. | StringTextLineFactory | ||
| spanFormat : flashx.textLayout.formats:ITextLayoutFormat
문자 서식입니다. | StringTextLineFactory | ||
![]() | swfContext : ISWFContext
필요한 경우 FTE를 호출하는 데 사용하는 ISWFContext 인스턴스입니다. | TextLineFactoryBase | |
| text : String
TextLine 객체로 변환할 텍스트입니다. | StringTextLineFactory | ||
| textFlowFormat : flashx.textLayout.formats:ITextLayoutFormat
텍스트 흐름 서식입니다. | StringTextLineFactory | ||
![]() | truncationOptions : flashx.textLayout.factory:TruncationOptions
텍스트가 컴포지션 경계에 맞지 않을 경우 해당 텍스트를 잘라내는 옵션을 지정합니다. | TextLineFactoryBase | |
![]() | verticalScrollPolicy : String
컴포지션 경계가 충분히 크지 않을 경우 줄이 만들어지는 방식을 지정합니다. | TextLineFactoryBase | |
| 메서드 | 정의 주체 | ||
|---|---|---|---|
StringTextLineFactory(configuration:IConfiguration = null)
StringTextLineFactory 객체를 만듭니다. | StringTextLineFactory | ||
현재 이 팩토리 객체에 지정된 텍스트를 사용하여 TextLine 객체를 만듭니다. | StringTextLineFactory | ||
![]() |
배치되는 내용이 들어갈 가장 작은 사각형입니다. | TextLineFactoryBase | |
![]() |
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | |
![]() |
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | |
![]() |
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | |
![]() |
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | |
![]() |
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 프리미티브 값을 반환합니다. | Object | |
configuration | 속성 |
configuration:IConfiguration [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
내부 TextFlow 객체에서 사용되는 구성입니다.
구현
public function get configuration():IConfigurationdefaultConfiguration | 속성 |
defaultConfiguration:IConfiguration [읽기 전용] | 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
아무 설정도 지정되지 않은 경우 이 팩토리에 사용되는 기본 구성입니다.
구현
public static function get defaultConfiguration():IConfigurationparagraphFormat | 속성 |
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
단락 서식입니다.
구현
public function get paragraphFormat():flashx.textLayout.formats:ITextLayoutFormat public function set paragraphFormat(value:flashx.textLayout.formats:ITextLayoutFormat):voidspanFormat | 속성 |
spanFormat:flashx.textLayout.formats:ITextLayoutFormat| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
문자 서식입니다.
구현
public function get spanFormat():flashx.textLayout.formats:ITextLayoutFormat public function set spanFormat(value:flashx.textLayout.formats:ITextLayoutFormat):voidtext | 속성 |
textFlowFormat | 속성 |
textFlowFormat:flashx.textLayout.formats:ITextLayoutFormat| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
텍스트 흐름 서식입니다.
구현
public function get textFlowFormat():flashx.textLayout.formats:ITextLayoutFormat public function set textFlowFormat(value:flashx.textLayout.formats:ITextLayoutFormat):voidStringTextLineFactory | () | 생성자 |
public function StringTextLineFactory(configuration:IConfiguration = null)| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
StringTextLineFactory 객체를 만듭니다.
매개 변수configuration:IConfiguration (default = null) — 구성 객체는 내부 TextFlow 객체의 속성을 설정하는 데 사용되며, TextFlow 객체는 이 팩토리로 생성된 줄을 컴포지션하는 데 사용됩니다.
|
createTextLines | () | 메서드 |
public function createTextLines(callback:Function):void| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5 |
현재 이 팩토리 객체에 지정된 텍스트를 사용하여 TextLine 객체를 만듭니다.
텍스트 줄은 현재 지정된 텍스트 및 서식을 사용하여 만들어지고 compositionBounds 속성에 지정된 경계에 맞게 컴포지션됩니다. 각 줄이 만들어질 때 팩토리는 callback 매개 변수에 지정된 함수를 호출합니다. 이 함수에 TextLine 객체가 전달되며, 이 함수는 줄을 표시하는 역할을 합니다.
다른 줄 집합을 만들려면 필요한 모든 속성을 변경하고 createTextLines()를 다시 호출해야 합니다.
팩토리의 스크롤 정책은 생성되는 줄 수를 제어합니다.
매개 변수
callback:Function — 만들어진 각 TextLine 객체에 대해서는 콜백 함수가 호출됩니다.
|
createTextLines()가 동일한 구문을 사용하여 두 번 호출됩니다. 팩토리 속성은 "그림자" 효과를 만드는 호출 사이에서 조정됩니다.
package flashx.textLayout.factory.examples {
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flashx.textLayout.factory.StringTextLineFactory;
import flashx.textLayout.formats.TextLayoutFormat;
public class StringTextLineFactory_example extends Sprite
{
public function StringTextLineFactory_example()
{
var factory:StringTextLineFactory = new StringTextLineFactory();
factory.compositionBounds = new Rectangle( 100, 100, 200, 130 );
var format:TextLayoutFormat = new TextLayoutFormat();
format.fontFamily = "LilyUPC, Verdana, _sans";
format.fontSize = 32;
format.color = 0x000000;
format.textAlpha = .5;
factory.spanFormat = format;
factory.text = "The quick brown fox jumped over the lazy dog.";
factory.createTextLines( useTextLines );
factory.compositionBounds = new Rectangle( 99, 99, 200, 130 );
format.color = 0x990000;
format.textAlpha = 1;
factory.spanFormat = format;
factory.createTextLines( useTextLines );
graphics.beginFill(0x555555,.5);
graphics.drawRect( 99, 99, 201, 131 );
graphics.endFill();
}
private function useTextLines( line:DisplayObject ):void
{
var displayObject:DisplayObject = this.addChild( line );
}
}
}
Tue Jun 12 2018, 03:17 PM Z
상속되는 공용 속성 숨기기
상속되는 공용 속성 표시