starling 怎樣使用輸入文本 textinput

		import starling.events.*;			
		import feathers.controls.TextInput;
			mytext= new TextInput();
			mytext.restrict = "0-9";
			mytext.maxChars = 11;
			
//			mytext.textEditorProperties.autoCapitalize = AutoCapitalize.NONE;
//			mytext.textEditorProperties.autoCorrect = false;
//			mytext.textEditorProperties.color = 0xFFFFFF;
//			mytext.textEditorProperties.displayAsPassword = false;
//			mytext.textEditorProperties.fontFamily = "Helvetica";
			mytext.textEditorProperties.fontSize =18;
			
			mytext.text = "";
			mytext.width = 150;
			mytext.height = 30;
			//mytext.selectRange( 0, mytext.text.length );
			mytext.setFocus();
			
			mytext.addEventListener( Event.CHANGE, input_changeHandler );
			mytext.x = 30;
			mytext.y = 84;
			
			this.addChild( mytext);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章