概要

  • テキストを描画するクラス。

コンストラクタ

  • 表示する文字列、フォント、文字色を渡す。
    • 文字列は「\r」で改行できる。
var t = new Text("Hello!\rWorld!", "22px Arial", "#F00");
t.x = 20;
t.y = 50;
// tをStageに格納する


プロパティ

color - String

  • テキストの色を取得/設定する。

font - String

  • テキストのフォントを設定する。CSSのfontプロパティの設定方法と同じ。

lineHeight - Number

  • 改行したときの行の高さ。

lineWidth - Number

  • 指定した幅で文字列を折り返す。でも半角/全角スペースが入ってる個所じゃないと折り返されない。
var t = new Text("AAA BBB CCC DDD", "22px Arial", "#F00");
t.y = 50;
t.lineWidth = 150;

maxWidth - Number

The maximum width to draw the text. If maxWidth is specified (not null), 
the text will be condensed or shrunk to make it fit in this width
  • 指定した幅に合わせてテキストが縮小する、と書いてあるような気がするけどうまく動かない。

outline - Boolean

  • trueにすると、縁取りされる。

text - String

  • 表示するテキスト。

textAlign - String

  • 文字をどちら寄せに表示するかどうか。X, Y座標を中心に考える。
var t = new Text("ABC", "22px Arial", "#F00");
// 画面中央にX, Y座標を設定し、textAlignをrightに設定
t.y = 100;
t.x = 100;
t.textAlign = "right";

var t = new Text("ABC", "22px Arial", "#F00");
// 画面中央にX, Y座標を設定し、textAlignをleftに設定
t.y = 100;
t.x = 100;
t.textAlign = "left";

textBaseline - String


メソッド

clone( ) - Text

getMeasuredLineHeight( ) - Number

  • 表示中のテキスト1行分の高さを返す。lineHeightで設定した値は含めない.

getMeasuredWidth( ) - Number

  • 表示中のテキストの幅を返す。

draw( )

isVisible( )

toString( )

このページへのコメント

eKd4kW Great, thanks for sharing this blog.Much thanks again. Much obliged.

0
Posted by check it out 2014年01月20日(月) 19:24:46 返信

dha4HS <a href="http://valptujiaphz.com/">valptujiaphz</a>, [url=http://uafiavxlwyhd.com/]uafiavxlwyhd[/url], [link=http://mwihjtyxaqto.com/]mwihjtyxaqto[/link], http://ceivbfaynwao.com/

0
Posted by pzauzddoe 2013年11月14日(木) 09:48:10 返信

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

メンバーのみ編集できます