ページへ戻る

− Links

 印刷 

Starling+Feathersでテキスト入力 の変更点 :: NJF Wiki

xpwiki:Starling+Feathersでテキスト入力 の変更点

  
現: 2016-02-15 (月) 21:15:09 njf[3] ソース[4] 編集[5]
Line 1: Line 1:
 +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でテキスト入力 のバックアップ差分(No. All)
    • 現: 2016-02-15 (月) 21:15:09 njf[3]