Class ccui.TextField
- Defined in: UITextField.js
- Extends ccui.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccui.TextField
|
Method Summary
Class Detail
ccui.TextField()
Base class for ccui.TextField
Field Detail
{String}
font
- The text field font with a style string: e.g. "18px Verdana"
{String}
fontName
- The text field font name
{Number}
fontSize
- The text field font size
{Number}
maxLength
- The max length of the text field
{Boolean}
maxLengthEnabled
- Indicate whether max length limit is enabled
{Boolean}
passwordEnabled
- Indicate whether the text field is for entering password
{Number}
placeHolder
- The place holder of the text field
{String}
string
- The content string of the label
Method Detail
-
addEventListenerTextField(selector, target)add event listener
- Parameters:
- {Function} selector
- {Object} target
-
allocates and initializes a UITextField.
// example var uiTextField = ccui.TextField.create();
- Returns:
- {ccui.TextField}
-
didNotSelectSelf()detach with IME
-
{Boolean} getAttachWithIME()get whether attach with IME.
- Returns:
- {Boolean}
-
{cc.Size} getContentSize()override "getContentSize" method of widget.
- Returns:
- {cc.Size}
-
{Boolean} getDeleteBackward()
- Returns:
- {Boolean}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{Boolean} getDetachWithIME()get whether eetach with IME.
- Returns:
- {Boolean}
-
getFontName(size)Get font name for text field content
- Parameters:
- {cc.Size} size
-
getFontSize(size)Get font size for text field content
- Parameters:
- {cc.Size} size
-
{String} getInsertText()get insertText
- Returns:
- {String}
-
{number} getMaxLength()
- Returns:
- {number} length
-
{String} getPasswordStyleText()
- Returns:
- {String}
-
{String} getPlaceHolder()
- Returns:
- {String}
-
{String} getStringValue()get textField string value
- Returns:
- {String}
-
{cc.Size} getTouchSize()Get touch size.
- Returns:
- {cc.Size}
-
{cc.Node} getVirtualRenderer()override "getContentSize" method of widget.
- Returns:
- {cc.Node}
-
{boolean} hitTest(pt)check hit
- Parameters:
- {cc.Point} pt
- Returns:
- {boolean}
-
{Boolean} isMaxLengthEnabled()
- Returns:
- {Boolean}
-
{Boolean} isPasswordEnabled()
- Returns:
- {Boolean}
-
onTouchBegan(touchPoint)touch began
- Parameters:
- {cc.Point} touchPoint
-
onTouchEnded(touchPoint)touch ended
- Parameters:
- touchPoint
-
setAnchorPoint(point, y)override "setAnchorPoint" of widget.
- Parameters:
- {cc.Point|Number} point
- The anchor point of UILabelBMFont or The anchor point.x of UILabelBMFont.
- {Number} y Optional
- The anchor point.y of UILabelBMFont.
-
setAttachWithIME(attach)set attach with IME.
- Parameters:
- {Boolean} attach
-
setDeleteBackward(deleteBackward)
- Parameters:
- {Boolean} deleteBackward
-
setDetachWithIME(detach)set detach with IME.
- Parameters:
- {Boolean} detach
-
setFontName(name)Set font name for text field content
- Parameters:
- {String} name
-
setFontSize(size)Set font size for text field content
- Parameters:
- {cc.Size} size
-
setInsertText(insertText)set insertText
- Parameters:
- {String} insertText
-
setMaxLength(length)
- Parameters:
- {number} length
-
setMaxLengthEnabled(enable)
- Parameters:
- {Boolean} enable
-
setPasswordEnabled(enable)
- Parameters:
- {Boolean} enable
-
setPasswordStyleText(enable)
- Parameters:
- {String} enable
-
setPlaceHolder(value)
- Parameters:
- {String} value
-
setText(text)Changes the string value of textField.
- Parameters:
- {String} text
-
setTouchSize(size)Set touch size
- Parameters:
- {cc.Size} size