Feathersでテキスト入力をするにはTextInputを使う。
var wordInputTxt:TextInput = new TextInput(); wordInputTxt.width = 100; wordInputTxt.height = 30; addChild(wordInputTxt);
フォントや字の大きさ、行よせなどを設定するときは、TextInputのプロパティであるtextEditorFactoryを設定する。
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から派生したクラスStageTextTextEditorはモバイルアプリで推奨されている。デスクトップアプリではTextFieldTextEditorのほうが推奨されている。
ぺージ情報 | |
---|---|
ぺージ名 : | Starling+Feathersでテキスト入力 |
ページ別名 : | 未設定 |
ページ作成 : | njf |
閲覧可 | |
グループ : | すべての訪問者 |
ユーザー : | すべての訪問者 |
編集可 | |
グループ : | すべての訪問者 |
ユーザー : | すべての訪問者 |
Counter: 1820,
today: 1,
yesterday: 1
初版日時: 2016-02-15 (月) 13:15:09
最終更新: 2016-02-15 (月) 13:15:09 (JST) (2965d) by njf