Class Index | File Index

Classes


Class cc.TextFieldTTF


Extends cc.LabelTTF.

Defined in: CCTextFieldTTF.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
A simple text input field with TTF font.
Method Summary
Method Attributes Method Name and Description
 
Open keyboard and receive input text.
 
 
<static>  
cc.TextFieldTTF.create(placeholder, dimensions, alignment, fontName, fontSize)
creates a cc.TextFieldTTF from a fontName, alignment, dimension and font size
 
ctor()
Constructor
 
Delete backward
 
End text input and close keyboard.
 
When the delegate detach with IME, this method call by CCIMEDispatcher.
 
When the delegate detach with IME, this method call by CCIMEDispatcher.
 
draw(ctx)
 
 
 
 
 
 
 
initWithPlaceHolder(placeholder, dimensions, alignment, fontName, fontSize)
Initializes the cc.TextFieldTTF with a font name, alignment, dimension and font size
 
insertText(text, len)
 
 
 
 
 
Remove delegate
 
 
setDelegate(value)
 
 
setString(text, isCallParent)
Input text property
Methods borrowed from class cc.LabelTTF:
description, getDimensions, getFontName, getFontSize, getHorizontalAlignment, getVerticalAlignment, init, initWithString, setColor, setDimensions, setFontName, setFontSize, setHorizontalAlignment, setOpacity, setVerticalAlignment
Methods borrowed from class cc.Sprite:
addChild, displayFrame, getAtlasIndex, getBatchNode, getBlendFunc, getColor, getOffsetPosition, getOpacity, getQuad, getSpriteBatchNode, getTexture, getTextureAtlas, getTextureRect, ignoreAnchorPointForPosition, initWithFile, initWithSpriteFrame, initWithSpriteFrameName, initWithTexture, isDirty, isFlippedX, isFlippedY, isFrameDisplayed, isOpacityModifyRGB, isTextureRectRotated, removeAllChildren, removeChild, reorderChild, SET_DIRTY_RECURSIVELY, setAnchorPoint, setAtlasIndex, setBatchNode, setBlendFunc, setDirty, setDirtyRecursively, setDisplayFrame, setDisplayFrameWithAnimationName, setFlipX, setFlipY, setOpacityModifyRGB, setPosition, setRotation, setScale, setScaleX, setScaleY, setSkewX, setSkewY, setSpriteBatchNode, setTexture, setTextureAtlas, setTextureRect, setVertexRect, setVertexZ, setVisible, sortAllChildren, updateColor, updateTransform, useBatchNode
Methods borrowed from class cc.Node:
cleanup, convertToNodeSpace, convertToNodeSpaceAR, convertTouchToNodeSpace, convertTouchToNodeSpaceAR, convertToWorldSpace, convertToWorldSpaceAR, getActionByTag, getActionManager, getAnchorPoint, getAnchorPointInPoints, getBoundingBox, getBoundingBoxToWorld, getCamera, getChildByTag, getChildren, getChildrenCount, getContentSize, getGLServerState, getGrid, getOrderOfArrival, getParent, getPosition, getPositionX, getPositionY, getRotation, getScale, getScaleX, getScaleY, getScheduler, getShaderProgram, getSkewX, getSkewY, getTag, getUserData, getUserObject, getVertexZ, getZOrder, isIgnoreAnchorPointForPosition, isRunning, isVisible, nodeToParentTransform, nodeToWorldTransform, numberOfRunningActions, onEnter, onEnterTransitionDidFinish, onExit, onExitTransitionDidStart, parentToNodeTransform, pauseSchedulerAndActions, release, removeAllChildrenWithCleanup, removeChildByTag, removeFromParent, removeFromParentAndCleanup, resumeSchedulerAndActions, retain, runAction, schedule, scheduleOnce, scheduleUpdate, scheduleUpdateWithPriority, setActionManager, setContentSize, setGLServerState, setGrid, setNodeDirty, setOrderOfArrival, setParent, setPositionX, setPositionY, setScheduler, setShaderProgram, setTag, setUserData, setUserObject, setZOrder, stopAction, stopActionByTag, stopAllActions, transform, transformAncestors, unschedule, unscheduleAllCallbacks, unscheduleUpdate, update, visit, worldToNodeTransform
Class Detail
cc.TextFieldTTF()
A simple text input field with TTF font.
Method Detail
{Boolean} attachWithIME()
Open keyboard and receive input text.
Returns:
{Boolean}

{Boolean} canAttachWithIME()
Returns:
{Boolean}

{Boolean} canDetachWithIME()
Returns:
{Boolean}

<static> {cc.TextFieldTTF|Null} cc.TextFieldTTF.create(placeholder, dimensions, alignment, fontName, fontSize)
creates a cc.TextFieldTTF from a fontName, alignment, dimension and font size
//example
// When five parameters
var textField = cc.TextFieldTTF.create("", cc.size(100,50), cc.TEXT_ALIGNMENT_LEFT,"Arial", 32);
// When three parameters
var textField = cc.TextFieldTTF.create("", "Arial", 32);
Parameters:
{String} placeholder
{cc.Size} dimensions
{Number} alignment
{String} fontName
{Number} fontSize
Returns:
{cc.TextFieldTTF|Null}

ctor()
Constructor

deleteBackward()
Delete backward

{Boolean} detachWithIME()
End text input and close keyboard.
Returns:
{Boolean}

didAttachWithIME()
When the delegate detach with IME, this method call by CCIMEDispatcher.

didDetachWithIME()
When the delegate detach with IME, this method call by CCIMEDispatcher.

draw(ctx)
Parameters:
{CanvasContext} ctx

{Number} getCharCount()
Returns:
{Number}

{cc.Color3B} getColorSpaceHolder()
Returns:
{cc.Color3B}

{String} getContentText()
Returns:
{String}

{cc.Node} getDelegate()
Returns:
{cc.Node}

{String} getPlaceHolder()
Returns:
{String}

{String} getString()
Returns:
{String}

{Boolean} initWithPlaceHolder(placeholder, dimensions, alignment, fontName, fontSize)
Initializes the cc.TextFieldTTF with a font name, alignment, dimension and font size
//example
var  textField = new cc.TextFieldTTF();
// When five parameters
textField.initWithPlaceHolder("", cc.size(100,50), cc.TEXT_ALIGNMENT_LEFT,"Arial", 32);
// When three parameters
textField.initWithPlaceHolder("", "Arial", 32);
Parameters:
{String} placeholder
{cc.Size} dimensions
{Number} alignment
{String} fontName
{Number} fontSize
Returns:
{Boolean}

insertText(text, len)
Parameters:
{String} text
{Number} len

keyboardDidHide(info)
Parameters:
info

keyboardDidShow(info)
Parameters:
info

keyboardWillHide(info)
Parameters:
info

keyboardWillShow(info)
Parameters:
info

removeDelegate()
Remove delegate

setColorSpaceHolder(value)
Parameters:
{cc.Color3B} value

setDelegate(value)
Parameters:
{cc.Node} value

setPlaceHolder(text)
Parameters:
{String} text

setString(text, isCallParent)
Input text property
Parameters:
{String} text
{Boolean} isCallParent

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:54 GMT-0800 (PST)