Class cc.EditBox

Class Summary
Constructor Attributes Constructor Name and Description
 

cc.EditBox is a brief Class for edit box.

Method Summary

Class Detail

cc.EditBox()

cc.EditBox is a brief Class for edit box.
You can use this widget to gather small amounts of text from the user.

Field Detail

{Object} delegate
- <@writeonly> Delegate of edit box
{String} font
- <@writeonly> Config font of edit box
{cc.Color} fontColor
- <@writeonly> Config font color of edit box
{String} fontName
- <@writeonly> Config font name of edit box
{Number} fontSize
- <@writeonly> Config font size of edit box
{Number} inputFlag
- <@writeonly> Input flag of edit box, one of the EditBoxInputFlag constants. e.g.cc.EDITBOX_INPUT_FLAG_PASSWORD
{Number} inputMode
- <@writeonly> Input mode of the edit box. Value should be one of the EditBoxInputMode constants.
{String} maxLength
- Max length of the content string
{String} placeHolder
- Place holder of edit box
{String} placeHolderFont
- <@writeonly> Config font of place holder
{cc.Color} placeHolderFontColor
- <@writeonly> Config font color of place holder
{String} placeHolderFontName
- <@writeonly> Config font name of place holder
{Number} placeHolderFontSize
- <@writeonly> Config font size of place holder
{Number} returnType
- <@writeonly> Return type of edit box, value should be one of the KeyboardReturnType constants.
{String} string
- Content string of edit box

Method Detail

  • <static> {cc.EditBox} cc.EditBox.create(size, normal9SpriteBg, press9SpriteBg, disabled9SpriteBg)
    create a edit box with size and background-color or
    Parameters:
    {cc.Size} size
    {cc.Scale9Sprite} normal9SpriteBg
    {cc.Scale9Sprite} press9SpriteBg Optional
    {cc.Scale9Sprite} disabled9SpriteBg Optional
    Deprecated:
    since v3.0, please use new cc.EditBox(size, normal9SpriteBg, press9SpriteBg, disabled9SpriteBg) instead
    Returns:
    {cc.EditBox}
  • <static> {cc.Rect} cc.EditBox.getRect(node)
    get the rect of a node in world coordinate frame
    Parameters:
    {cc.Node} node
    Returns:
    {cc.Rect}