Feathersでテキスト入力をするにはTextInput[1]を使う。
var wordInputTxt:TextInput = new TextInput(); wordInputTxt.width = 100; wordInputTxt.height = 30; addChild(wordInputTxt);
フォントや字の大きさ、行よせなどを設定するときは、TextInput[1]のプロパティであるtextEditorFactory[2]を設定する。
wordInputTxt.textEditorFactory = function():ITextEditor { var textEditor:StageTextTextEditor = new StageTextTextEditor(); textEditor.styleProvider = null; textEditor.fontFamily = FONT_NAME; textEditor.textAlign = TextFormatAlign.CENTER; textEditor.fontSize = 24; textEditor.color = 0xFF0000; return textEditor; }
ここで使っているITexeEditor[3]から派生したクラスStageTextTextEditor[4]はモバイルアプリで推奨されている。デスクトップアプリではTextFieldTextEditor[5]のほうが推奨されている。
(This host) = https://njf.jp