| パッケージ | flashx.textLayout.formats |
| クラス | public final class TextAlign |
| 継承 | TextAlign Object |
| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
textAlign および textAlignLast プロパティを設定する値を定義します。これらの値は、コンテナを基準にした段落内の行揃えを示します。
関連する API エレメント
パブリックプロパティ
パブリックメソッド
パブリック定数
| 定数 | 定義元 | ||
|---|---|---|---|
| CENTER : String = "center" [静的] コンテナ内での中央揃えを指定します。 | TextAlign | ||
| END : String = "end" [静的] 終端揃えを指定します。テキストは書き込み順とは反対から揃えられます。 | TextAlign | ||
| JUSTIFY : String = "justify" [静的] コンテナスペースを埋めるように、テキストを行内に均等配置することを指定します。 | TextAlign | ||
| LEFT : String = "left" [静的] 左端揃えを指定します。 | TextAlign | ||
| RIGHT : String = "right" [静的] 右端揃えを指定します。 | TextAlign | ||
| START : String = "start" [静的] 始端揃えを指定します - テキストは、書き込み順と一致するように揃えられます。 | TextAlign | ||
定数の詳細
CENTER | 定数 |
public static const CENTER:String = "center"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
コンテナ内での中央揃えを指定します。
END | 定数 |
public static const END:String = "end"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
終端揃えを指定します。テキストは書き込み順とは反対から揃えられます。左から右のテキストで右、または右から左のテキストで左を指定することに相当します。
JUSTIFY | 定数 |
public static const JUSTIFY:String = "justify"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
コンテナスペースを埋めるように、テキストを行内に均等配置することを指定します。
LEFT | 定数 |
public static const LEFT:String = "left"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
左端揃えを指定します。
RIGHT | 定数 |
public static const RIGHT:String = "right"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
右端揃えを指定します。
START | 定数 |
public static const START:String = "start"| 言語バージョン: | ActionScript 3.0 |
| ランタイムバージョン: | Flash Player 10, AIR 1.5 |
始端揃えを指定します - テキストは、書き込み順と一致するように揃えられます。左から右のテキストで左、または右から左のテキストで右を設定することに相当します。
例 この例の使用方法
TextAlignExample.as
次の例は、「Hello World」の 3 つの段落を CENTER、JUSTIFY および RIGHT を使用して整列させます。
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextAlign;
import flashx.textLayout.formats.TextJustify;
public class TextAlignExample extends Sprite
{
public function TextAlignExample()
{
var textFlow:TextFlow = new TextFlow();
//create paragraphs and corresponding spans
var pCenter:ParagraphElement = new ParagraphElement();
var pJustify:ParagraphElement = new ParagraphElement();
var pRight:ParagraphElement = new ParagraphElement();
var spanCenter:SpanElement = new SpanElement();
var spanJustify:SpanElement = new SpanElement();
var spanRight:SpanElement = new SpanElement();
// add text to the spans
spanCenter.text = "Hello, World\n";
spanJustify.text = "Hello, World\n";
spanRight.text = "Hello, World";
// add spans to paragraphs and specify alignment
pCenter.addChild(spanCenter);
pCenter.textAlign = TextAlign.CENTER;
pJustify.addChild(spanJustify);
pJustify.textAlign = TextAlign.JUSTIFY;
pJustify.textJustify = TextJustify.DISTRIBUTE;
pRight.addChild(spanRight);
pRight.textAlign = TextAlign.RIGHT;
// add paragraphs to TextFlow
textFlow.addChild(pCenter);
textFlow.addChild(pJustify);
textFlow.addChild(pRight);
// update controller to display
textFlow.flowComposer.addController(new ContainerController(this,80,800));
textFlow.flowComposer.updateAllControllers();
}
}
}
Tue Jun 12 2018, 10:34 AM Z
継承されるパブリックプロパティを隠す
継承されるパブリックプロパティを表示