cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 静态 Public 成员函数 | Protected 属性 | 所有成员列表

UICCTextField类 参考

NA NA 更多…

#include

类 UICCTextField 继承关系图:

Public 成员函数 - 图3 TextFieldTTF TextFieldDelegate Label IMEDelegate SpriteBatchNode LabelProtocol Node TextureProtocol Ref BlendProtocol

## Public 成员函数
UICCTextField ()
~UICCTextField ()
virtual void onEnter () override
每次当Node进入“stage”时才调用事件回调。 如果Node进入“stage”状态时伴随着一个转换(transition),那么事件将会在这个转换开始的时候被调用。 在onEnter过程中,你不能够接入“sister/brother”兄妹节点。 如果你重写了onEnter方法,你应该调用它的父类,e.g., Node::onEnter(). 更多…
virtual bool onTextFieldAttachWithIME (TextFieldTTF pSender) override
如果sender不想附加到IME,返回true 更多…
virtual bool onTextFieldDetachWithIME (TextFieldTTF pSender) override
如果sender不想解除IME,返回true 更多…
virtual bool onTextFieldInsertText (TextFieldTTF pSender, const char text, size_t nLen) override
如果sender不想插入文本,返回true 更多…
virtual bool onTextFieldDeleteBackward (TextFieldTTF pSender, const char delText, size_t nLen) override
如何sender不想删除delText,返回true 更多…
void insertText (const char text, size_t len)
当文本输入从IME传递过来,这个方法被IMEDispatcher调用 NA NA 更多…
void deleteBackward ()
当user点击回退键,这个方法被IMEDispatcher调用 NA NA 更多…
void openIME ()
void closeIME ()
void setMaxLengthEnabled (bool enable)
bool isMaxLengthEnabled ()
void setMaxLength (int length)
int getMaxLength ()
int getCharCount ()
void setPasswordEnabled (bool enable)
bool isPasswordEnabled ()
void setPasswordStyleText (const std::string &styleText)
void setPasswordText (const std::string &text)
void setAttachWithIME (bool attach)
bool getAttachWithIME ()
void setDetachWithIME (bool detach)
bool getDetachWithIME ()
void setInsertText (bool insert)
bool getInsertText ()
void setDeleteBackward (bool deleteBackward)
bool getDeleteBackward ()
- Public 成员函数 继承自 TextFieldTTF
TextFieldTTF ()
ctor 更多…
virtual ~TextFieldTTF ()
NA NA 更多…
bool initWithPlaceHolder (const std::string &placeholder, const Size &dimensions, TextHAlignment alignment, const std::string &fontName, float fontSize)
由字体名称、对齐方式、, 字体大小、尺寸 初始化TextFieldTTF 更多…
bool initWithPlaceHolder (const std::string &placeholder, const std::string &fontName, float fontSize)
由字体名称和大小初始化TextFieldTTF 更多…
virtual bool attachWithIME ()
打开键盘并接收输入 更多…
virtual bool detachWithIME ()
输入技术并关闭键盘 更多…
TextFieldDelegate getDelegate () const
NA NA 更多…
void setDelegate (TextFieldDelegate delegate)
NA NA 更多…
int getCharCount () const
virtual const Color4B & getColorSpaceHolder ()
virtual void setColorSpaceHolder (const Color3B &color)
virtual void setColorSpaceHolder (const Color4B &color)
virtual void setTextColor (const Color4B &textColor) override
设置文字颜色 更多…
virtual void setString (const std::string &text) override
改变字符串内容并重新渲染 更多…
virtual const std::string & getString () const override
返回label使用的string 更多…
virtual void setPlaceHolder (const std::string &text)
virtual const std::string & getPlaceHolder (void) const
virtual void setSecureTextEntry (bool value)
virtual bool isSecureTextEntry ()
virtual void visit (Renderer renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override
访问节点的孩子,并且循环递归的绘制它们。 更多…
- Public 成员函数 继承自 Label
virtual bool setTTFConfig (const TTFConfig &ttfConfig)
设置Label的TTFConfig 更多…
virtual const TTFConfig & getTTFConfig () const
virtual bool setBMFontFilePath (const std::string &bmfontFilePath, const Vec2 &imageOffset=Vec2::ZERO)
const std::string & getBMFontFilePath () const
virtual bool setCharMap (const std::string &charMapFile, int itemWidth, int itemHeight, int startCharMap)
virtual bool setCharMap (Texture2D texture, int itemWidth, int itemHeight, int startCharMap)
virtual bool setCharMap (const std::string &plistFile)
virtual void setSystemFontName (const std::string &systemFont)
virtual const std::string & getSystemFontName () const
virtual void setSystemFontSize (float fontSize)
virtual float getSystemFontSize () const
virtual void enableShadow (const Color4B &shadowColor=Color4B::BLACK, const Size &offset=Size(2,-2), int blurRadius=0)
显示阴影 更多…
virtual void enableOutline (const Color4B &outlineColor, int outlineSize=-1)
只支持TTF 更多…
virtual void enableGlow (const Color4B &glowColor)
只支持TTF 更多…
virtual void disableEffect ()
取消阴影/描边/发光渲染效果 更多…
void setAlignment (TextHAlignment hAlignment)
TextHAlignment getTextAlignment () const
void setAlignment (TextHAlignment hAlignment, TextVAlignment vAlignment)
void setHorizontalAlignment (TextHAlignment hAlignment)
TextHAlignment getHorizontalAlignment () const
void setVerticalAlignment (TextVAlignment vAlignment)
TextVAlignment getVerticalAlignment () const
void setLineBreakWithoutSpace (bool breakWithoutSpace)
void setMaxLineWidth (unsigned int maxLineWidth)
设置Label的最大列数 在不等于0的情况下,Label的最大列数用于强制断行 Label的宽度和最大列数不总是相等的 更多…
unsigned int getMaxLineWidth ()
void setWidth (unsigned int width)
设置Label的原始宽度. 更多…
unsigned int getWidth () const
void setHeight (unsigned int height)
设置Label的原始高度 在不等于0的情况下,Label的高度被用于文字对齐 如果Label的大小过小,文本内容会显示不完整 更多…
unsigned int getHeight () const
void setDimensions (unsigned int width, unsigned int height)
一种更有效设置Label大小的方法 更多…
const Size & getDimensions () const
virtual void updateContent ()
立即刷新内容 更多…
const Color4B & getTextColor () const
virtual Sprite getLetter (int lettetIndex)
void setClipMarginEnabled (bool clipEnabled)
剪裁上下边距以减少Label的高度 更多…
bool isClipMarginEnabled () const
int getCommonLineHeight () const
int getStringNumLines () const
int getStringLength () const
FontAtlas getFontAtlas ()
virtual void setBlendFunc (const BlendFunc &blendFunc) override
virtual bool isOpacityModifyRGB () const override
virtual void setOpacityModifyRGB (bool isOpacityModifyRGB) override
virtual void updateDisplayedColor (const Color3B &parentColor) override
virtual void updateDisplayedOpacity (GLubyte parentOpacity) override
virtual void setScale (float scale) override
设置几点的缩放(x,y,z). 更多…
virtual void setScaleX (float scaleX) override
设置节点的缩放(x)。 更多…
virtual void setScaleY (float scaleY) override
设置节点的缩放(y)。 更多…
virtual float getScaleX () const override
返回该节点的X轴的缩放因子。 更多…
virtual float getScaleY () const override
返回该节点的Y轴的缩放因子。 更多…
virtual void addChild (Node child, int zOrder=0, int tag=0) override
添加一个子节点到容器中,有Z轴顺序和一个标记。 更多…
virtual void sortAllChildren () override
在绘画之前,排列所有的孩子数组一次,而不是每次添加或者删除子节点时都排序。 这个方法可以大量地提高性能。 更多…
virtual std::string getDescription () const override
得到描述性的字符串。这将会使得调试更加简单。 更多…
virtual const Size & getContentSize () const override
返回未转换节点的大小。 更多…
virtual Rect getBoundingBox () const override
返回 一个AABB(轴向包围盒)在它的父坐标系中。 更多…
virtual void draw (Renderer renderer, const Mat4 &transform, bool transformUpdated) override
重写这个方法来绘制你自己的节点。 以下的GL状态是默认开启的: 更多…
virtual CC_DEPRECATED_ATTRIBUTE void setFontDefinition (const FontDefinition &textDefinition)
CC_DEPRECATED_ATTRIBUTE const FontDefinition & getFontDefinition () const
- Public 成员函数 继承自 SpriteBatchNode
TextureAtlas getTextureAtlas (void)
返回纹理集(TextureAtlas)对象 更多…
void setTextureAtlas (TextureAtlas textureAtlas)
设置纹理集(TextureAtlas)对象 更多…
const std::vector< Sprite > & getDescendants () const
返回后代节点(子节点,孙子节点,等等)数组。 此函数为BatchNode特有,如需要返回子节点则使用getChildren函数替代。 更多…
void increaseAtlasCapacity ()
void removeChildAtIndex (ssize_t index, bool doCleanup)
删除指定索引值(index)的子节点,根据doCleanup参数确定是否同时释放该节点。 更多…
void appendChild (Sprite sprite)
void removeSpriteFromAtlas (Sprite sprite)
ssize_t rebuildIndexInOrder (Sprite parent, ssize_t index)
ssize_t highestAtlasIndexInChild (Sprite sprite)
ssize_t lowestAtlasIndexInChild (Sprite sprite)
ssize_t atlasIndexForChild (Sprite sprite, int z)
void reorderBatch (bool reorder)
virtual Texture2D getTexture () const override
返回当前使用的所有的纹理 更多…
virtual void setTexture (Texture2D texture) override
设置一个新的纹理,在内部会进行一次retain 更多…
virtual const BlendFunc & getBlendFunc () const override
NA NA 更多…
virtual void reorderChild (Node child, int zOrder) override
对一个孩子重新排序,设定一个新的z轴的值。 更多…
virtual void removeChild (Node child, bool cleanup) override
从容器中删除一个孩子,取决于cleanup参数同时会清除所有的活动的动作。 更多…
virtual void removeAllChildrenWithCleanup (bool cleanup) override
从容器中删除所有的孩子, 取决于cleanup参数同时会清除所有的活动的动作。 更多…
void insertQuadFromSprite (Sprite sprite, ssize_t index)
在指定索引位置插入一个quad(顶点的坐标位置,纹理的坐标位置和颜色信息)到纹理集,参数中的Sprite不会添加到子节点数组。 此方法仅在处理一个很大的AtlasSprite且大部分Sprite不改变时调用。 例如:瓦片地图(TMXMap)或包含非常多字符的标签(LabelBMFont) 更多…
SpriteBatchNode addSpriteWithoutQuad (Sprite child, int z, int aTag)
virtual ~SpriteBatchNode ()
NA NA 更多…
bool initWithTexture (Texture2D tex, ssize_t capacity)
指定子节点纹理(texture2d)和容量(capacity)参数初始化SpriteBatchNode。 在运行期如超出预设容量则扩容33。 更多…
bool initWithFile (const std::string &fileImage, ssize_t capacity)
指定子节点纹理图像文件(.png、.jpeg、.pvr等)和容量(capacity)参数初始化SpriteBatchNode。 在运行期如超出预设容量则扩容33。 使用TextureMgr加载图像文件。 init init 更多…
bool init ()
- Public 成员函数 继承自 Node
virtual bool isRunning () const
返回节点是否是“running(活动的)”。 更多…
void scheduleUpdateWithPriorityLua (int handler, int priority)
lua script的时间表 NA 更多…
virtual void cleanup ()
暂停所有的活动着的动作和调度器。 更多…
virtual void draw () final
virtual void visit () final
virtual Scene getScene ()
返回包含Node(节点)的Scene(场景)。 如果这个节点不属于任何的场景,它将返回nullptr。 这个函数循环递归地调用parent->getScene() 直到父类是一个Scene对象。结果不会被缓存。只有当这个函数被用在一个循环中时,用户才会缓存这个结果。 更多…
virtual CC_DEPRECATED_ATTRIBUTE Rect boundingBox () const
virtual void setEventDispatcher (EventDispatcher dispatcher)
virtual EventDispatcher getEventDispatcher () const
virtual GLubyte getOpacity () const
virtual GLubyte getDisplayedOpacity () const
virtual void setOpacity (GLubyte opacity)
virtual bool isCascadeOpacityEnabled () const
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)
virtual const Color3B & getColor (void) const
virtual const Color3B & getDisplayedColor () const
virtual void setColor (const Color3B &color)
virtual bool isCascadeColorEnabled () const
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)
virtual ~Node ()
virtual void setLocalZOrder (int localZOrder)
LocalZOrder是“key”(关键)来分辨节点和它兄弟节点的相关性。 更多…
virtual CC_DEPRECATED_ATTRIBUTE void setZOrder (int localZOrder)
virtual void _setLocalZOrder (int z)
virtual int getLocalZOrder () const
得到这个节点的局部Z顺序 更多…
virtual CC_DEPRECATED_ATTRIBUTE int getZOrder () const
virtual void setGlobalZOrder (float globalZOrder)
定义渲染节点的顺序 拥有全局Z顺序越小的节点,最先渲染 更多…
virtual float getGlobalZOrder () const
返回节点的全局Z顺序。 更多…
virtual void setScaleZ (float scaleZ)
改变该节点的Z轴的缩放因子。 更多…
virtual float getScaleZ () const
返回该节点的梓州的缩放因子。 更多…
virtual float getScale () const
得到该节点的缩放因子,当X轴和Y轴有相同的缩放因子时。 更多…
virtual void setScale (float scaleX, float scaleY)
设置节点的缩放(x,y). 更多…
virtual void setPosition (const Vec2 &position)
设置节点的位置在父节点的坐标系系统中。 更多…
virtual const Vec2 & getPosition () const
得到在父节点坐标系中节点的位置(x,y)。 更多…
virtual void setPosition (float x, float y)
设置节点在它父节点坐标系中的位置(x,y)。 更多…
virtual void getPosition (float x, float y) const
用一个更有效率的方法设置位置,返回两个数字而不是Vec2对象。 更多…
virtual void setPositionX (float x)
分别得到或者设置位置的X或者Y轴坐标系 这些方法被绑定使用在在Lua和JavaScript。 更多…
virtual float getPositionX (void) const
virtual void setPositionY (float y)
virtual float getPositionY (void) const
virtual void setPosition3D (const Vec3 &position)
设置在父节点坐标系中的位置(x,y,z)。 更多…
virtual Vec3 getPosition3D () const
返回父坐标系的位置(X,Y,Z)。 更多…
virtual void setPositionZ (float positionZ)
设置位置的“z”轴坐标系,是OpneGL Z 定点值。 更多…
virtual CC_DEPRECATED_ATTRIBUTE void setVertexZ (float vertexZ)
virtual float getPositionZ () const
得到该节点的Z轴坐标系的位置。 更多…
virtual CC_DEPRECATED_ATTRIBUTE float getVertexZ () const
virtual void setSkewX (float skewX)
改变该节点X轴的倾斜角,单位是度。 更多…
virtual float getSkewX () const
返回该节点的X轴倾斜角,单位是度。 更多…
virtual void setSkewY (float skewY)
改变该节点Y轴的倾斜角,单位是度。 更多…
virtual float getSkewY () const
返回该节点的Y轴倾斜角,单位是度。 更多…
virtual void setAnchorPoint (const Vec2 &anchorPoint)
设置锚点,用百分比表示。 更多…
virtual const Vec2 & getAnchorPoint () const
返回用百分比表示的锚点。 更多…
virtual const Vec2 & getAnchorPointInPoints () const
返回绝对像素的锚点 更多…
virtual void setContentSize (const Size &contentSize)
设置不转换节点的大小。 更多…
virtual void setVisible (bool visible)
设置节点是否可见。 更多…
virtual bool isVisible () const
决定节点是否可见。 更多…
virtual void setRotation (float rotation)
设置节点的旋转(angle)角度。 更多…
virtual float getRotation () const
返回节点的旋转角度。 更多…
virtual void setRotation3D (const Vec3 &rotation)
设置(X,Y,Z)旋转角度。 对3d旋转非常有用。 更多…
virtual Vec3 getRotation3D () const
返回(X,Y,Z)的旋转角度。 更多…
virtual void setRotationSkewX (float rotationX)
设置节点X轴的旋转角度,表现为水平旋转倾斜。 更多…
virtual CC_DEPRECATED_ATTRIBUTE void setRotationX (float rotationX)
virtual float getRotationSkewX () const
得到X轴节点的旋转角度,表现为水平旋转倾斜(horizontal rotation skew). 更多…
virtual CC_DEPRECATED_ATTRIBUTE float getRotationX () const
virtual void setRotationSkewY (float rotationY)
设置Y轴节点的旋转角度,表现为垂直旋转倾斜。 更多…
virtual CC_DEPRECATED_ATTRIBUTE void setRotationY (float rotationY)
virtual float getRotationSkewY () const
得到节点Y轴的旋转角度,表现为垂直旋转倾斜(vertical rotational skew. 更多…
virtual CC_DEPRECATED_ATTRIBUTE float getRotationY () const
void setOrderOfArrival (int orderOfArrival)
设置到达顺序,当这个节点和其他子节点有相同的ZOrder时。 更多…
int getOrderOfArrival () const
返回到达顺序,指出哪一个子类先被添加。 更多…
CC_DEPRECATED_ATTRIBUTE void setGLServerState (int serverState)
CC_DEPRECATED_ATTRIBUTE int getGLServerState () const
virtual void ignoreAnchorPointForPosition (bool ignore)
设置抹点为(0,0)当你摆放这个节点的时候。 更多…
virtual bool isIgnoreAnchorPointForPosition () const
得到节点的锚点是否为(0,0),当你摆放这个节点时。 更多…
virtual void addChild (Node child)
添加一个子节点到容器内,z-order是0. 更多…
virtual void addChild (Node child, int localZOrder)
添加一个子节点到容器中,参数有一个局部Z轴顺序。 更多…
virtual Node getChildByTag (int tag)
从容器中得到一个子节点通过它的标记。 更多…
virtual Vector< Node > & getChildren ()
返回子节点数组。 更多…
virtual const Vector< Node > & getChildren () const
virtual ssize_t getChildrenCount () const
返回子节点的总数 更多…
virtual void setParent (Node parent)
设置父节点Sets the parent node 更多…
virtual Node getParent ()
返回指向父节点的指针。 更多…
virtual const Node getParent () const
virtual void removeFromParent ()
从父节点中删除一个节点,有一个cleanup参数。 如果这个节点是一个孤节点,那么什么都不会发生。 更多…
virtual void removeFromParentAndCleanup (bool cleanup)
从父节点中删除一个节点 如果这个节点是一个孤节点,那么什么都不会发生。 更多…
virtual void removeChildByTag (int tag, bool cleanup=true)
从一个容器中删除一个孩子通过标记值。取决于cleanup参数同时会清除所有的活动的动作。 更多…
virtual void removeAllChildren ()
从容器中删除所有的孩子,with a cleanup。 更多…
virtual int getTag () const
返回一个用来更简单分辨节点的标记。 更多…
virtual void setTag (int tag)
改变这个用来更容易分辨节点的标记。 更多…
virtual void getUserData ()
返回一个自定义用户数据的指针。 更多…
virtual const void getUserData () const
NA NA 更多…
virtual void setUserData (void userData)
设置一个自定义用户数据的指针。 更多…
virtual Ref getUserObject ()
返回一个用户分配的对象 更多…
virtual const Ref getUserObject () const
NA NA 更多…
virtual void setUserObject (Ref userObject)
返回一个用户分配的对象 更多…
GLProgram getGLProgram ()
返回当前用于这个节点的GLProgram (shader) 更多…
CC_DEPRECATED_ATTRIBUTE GLProgram getShaderProgram ()
GLProgramState getGLProgramState ()
void setGLProgramState (GLProgramState glProgramState)
void setGLProgram (GLProgram glprogram)
为这个节点设置着色器程序 更多…
CC_DEPRECATED_ATTRIBUTE void setShaderProgram (GLProgram glprogram)
virtual void onEnterTransitionDidFinish ()
每次当Node进入“stage”时才调用事件回调。 如果Node进入“stage”状态时伴随着一个转换(transition),那么事件将会在这个转换结束的时候被调用。 如果你重写了onEnterTransitionDidFinish方法 你应该调用它的父类, e.g. 更多…
virtual void onExit ()
每次当Node离开“stage”时才调用事件回调。 如果Node离开“stage”状态时伴随着一个转换(transition), 那么事件将会在这个转换结束的时候被调用。 在onEnter过程中中你不能够接入一个兄妹节点。 如果你重写onExit, 你应该调用它的父类, e.g., Node::onExit(). 更多…
virtual void onExitTransitionDidStart ()
每次当Node离开“stage”时才调用事件回调。 如果Node离开“stage”状态时伴随着一个转换(transition), 那么事件将会在这个转换开始的时候被调用。 NA NA 更多…
virtual void setActionManager (ActionManager actionManager)
设置被所有动作使用的ActionManager对象。 更多…
virtual ActionManager getActionManager ()
得到被所有动作使用的ActionManager对象。 更多…
virtual const ActionManager getActionManager () const
Action runAction (Action action)
执行一个动作,并且返回执行的该动作。 更多…
void stopAllActions ()
停止并且删除所有的动作从活动动作列表中。 更多…
void stopAction (Action action)
停止并且删除所有的动作从活动动作列表中。 更多…
void stopActionByTag (int tag)
通过动作的标记从活动动作列表中删除一个动作。 更多…
Action getActionByTag (int tag)
通过动作的标记从活动动作列表中得到一个动作。 更多…
ssize_t getNumberOfRunningActions () const
返回活动着的动作加上正在调度运行的动作的总数 (在actionsToAdd状态的动作和动作数组中的). 更多…
CC_DEPRECATED_ATTRIBUTE ssize_t numberOfRunningActions () const
virtual void setScheduler (Scheduler scheduler)
设置一个调度器对象来用于调度所有的“update”和定时器。 更多…
virtual Scheduler getScheduler ()
得到调度器对象。 更多…
virtual const Scheduler getScheduler () const
bool isScheduled (SEL_SCHEDULE selector)
检查是否一个选择器是预定的。 更多…
void scheduleUpdate (void)
调度“update”方法。 更多…
void scheduleUpdateWithPriority (int priority)
调度这个"update"方法伴随着一个自定义优先级。 更多…
void unscheduleUpdate (void)
void schedule (SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)
调度一个自定义的选择器。 更多…
void schedule (SEL_SCHEDULE selector, float interval)
调度一个自定义的选择器伴随着一个以秒为单位的内部时间。 更多…
void scheduleOnce (SEL_SCHEDULE selector, float delay)
调度一个只运行一次的选择器,伴随着一个0或者更大的延期。 更多…
void schedule (SEL_SCHEDULE selector)
调度一个自定义的选择器,这个调度后的选择器将会以每帧为时间间隔。 更多…
void unschedule (SEL_SCHEDULE selector)
不调度一个自定义的选择器。 更多…
void unscheduleAllSelectors (void)
不调度所有的调度过的选择器: 自定义选择器, 和 'update' 选择器。 动作不受这个方法的影响。 NA 更多…
void resume (void)
恢复所有的调度过的选择器,动作和事件监听器。 这个方法被onEnter方法在内部调用。 更多…
void pause (void)
暂停所有的调度过的选择器,动作和事件监听器。 这个方法被onExit方法在内部调用。 更多…
CC_DEPRECATED_ATTRIBUTE void resumeSchedulerAndActions (void)
恢复所有的调度过的选择器,动作和事件监听器。 这个方法被onEnter方法在内部调用。 更多…
CC_DEPRECATED_ATTRIBUTE void pauseSchedulerAndActions (void)
暂停所有的调度过的选择器,动作和事件监听器。 这个方法被onExit方法在内部调用。 更多…
virtual void update (float delta)
virtual void updateTransform ()
递归的调用孩子的updateTransform()方法。 更多…
virtual const Mat4 & getNodeToParentTransform () const
返回这个将节点(局部)的空间坐标系转换成父节点的空间坐标系的矩阵。 这个矩阵以像素为单位。 更多…
virtual AffineTransform getNodeToParentAffineTransform () const
virtual void setNodeToParentTransform (const Mat4 &transform)
手动设置变换矩阵。 更多…
virtual CC_DEPRECATED_ATTRIBUTE AffineTransform nodeToParentTransform () const
virtual const Mat4 & getParentToNodeTransform () const
返回这个将父节点的空间坐标系转换成节点(局部)的空间坐标系转的矩阵。 这个矩阵以像素为单位。 更多…
virtual AffineTransform getParentToNodeAffineTransform () const
virtual CC_DEPRECATED_ATTRIBUTE AffineTransform parentToNodeTransform () const
virtual Mat4 getNodeToWorldTransform () const
返回世界仿射变换矩阵。矩阵单位是像素。 更多…
virtual AffineTransform getNodeToWorldAffineTransform () const
virtual CC_DEPRECATED_ATTRIBUTE AffineTransform nodeToWorldTransform () const
virtual Mat4 getWorldToNodeTransform () const
返回逆世界仿射变换矩阵。矩阵单位是像素。 更多…
virtual AffineTransform getWorldToNodeAffineTransform () const
virtual CC_DEPRECATED_ATTRIBUTE AffineTransform worldToNodeTransform () const
Vec2 convertToNodeSpace (const Vec2 &worldPoint) const
将Vec2 转换成节点 (局部) 空间坐标系。结果按以Points为单位。 更多…
Vec2 convertToWorldSpace (const Vec2 &nodePoint) const
将Vec2转换成世界空间坐标系。结果按以Points为单位。 更多…
Vec2 convertToNodeSpaceAR (const Vec2 &worldPoint) const
将Vec2转换成节点(局部)空间坐标系. 更多…
Vec2 convertToWorldSpaceAR (const Vec2 &nodePoint) const
将局部的Vec2转换成世界空间坐标系。结果按以Points为单位。 将returned/received节点的point当作相对应的锚点。 更多…
Vec2 convertTouchToNodeSpace (Touch touch) const
一个方便的方法将触摸转换成Vec2 更多…
Vec2 convertTouchToNodeSpaceAR (Touch touch) const
将Touch (世界坐标系) 转换成局部坐标系。这个方法是AR (相对的锚点). 更多…
void setAdditionalTransform (Mat4 additionalTransform)
为节点设置一个附加转换矩阵。 更多…
void setAdditionalTransform (const AffineTransform &additionalTransform)
Component getComponent (const std::string &pName)
通过名字得到组件 更多…
virtual bool addComponent (Component pComponent)
添加一个组件 更多…
virtual bool removeComponent (const std::string &pName)
通过名字删除一个组件 更多…
virtual void removeAllComponents ()
删除所有组件 更多…
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
- Public 成员函数 继承自 TextureProtocol
virtual ~TextureProtocol ()
- Public 成员函数 继承自 BlendProtocol
virtual ~BlendProtocol ()
- Public 成员函数 继承自 LabelProtocol
virtual ~LabelProtocol ()
- Public 成员函数 继承自 IMEDelegate
virtual ~IMEDelegate ()
NA NA 更多…
- Public 成员函数 继承自 TextFieldDelegate
virtual ~TextFieldDelegate ()
virtual bool onVisit (TextFieldTTF sender, Renderer *renderer, const Mat4 &transform, bool transformUpdated)
如何sender不想绘图,返回true. 更多…
## 静态 Public 成员函数
static UICCTextField create (const std::string &placeholder, const std::string &fontName, float fontSize)
- 静态 Public 成员函数 继承自 TextFieldTTF
static TextFieldTTF textFieldWithPlaceHolder (const std::string &placeholder, const Size &dimensions, TextHAlignment alignment, const std::string &fontName, float fontSize)
由字体名称、对齐方式、, 字体大小、尺寸创建一个TextFieldTTF 更多…
static TextFieldTTF textFieldWithPlaceHolder (const std::string &placeholder, const std::string &fontName, float fontSize)
由字体名称和大小创建一个TextFieldTTF 更多…
- 静态 Public 成员函数 继承自 Label
static Label create ()
static Label createWithSystemFont (const std::string &text, const std::string &font, float fontSize, const Size &dimensions=Size::ZERO, TextHAlignment hAlignment=TextHAlignment::LEFT, TextVAlignment vAlignment=TextVAlignment::TOP)
使用初始字符串,字体(字体名称或字体文件),字号,尺寸,水平对齐方式和 垂直对齐方式创建一个Label 更多…
static Label createWithTTF (const std::string &text, const std::string &fontFile, float fontSize, const Size &dimensions=Size::ZERO, TextHAlignment hAlignment=TextHAlignment::LEFT, TextVAlignment vAlignment=TextVAlignment::TOP)
使用初始字符串,字体文件,字号,尺寸,水平对齐方式和垂直对齐方式创建一个Label 更多…
static Label createWithTTF (const TTFConfig &ttfConfig, const std::string &text, TextHAlignment alignment=TextHAlignment::LEFT, int maxLineWidth=0)
使用TTFConfig创建Label 更多…
static Label createWithBMFont (const std::string &bmfontFilePath, const std::string &text, const TextHAlignment &alignment=TextHAlignment::LEFT, int maxLineWidth=0, const Vec2 &imageOffset=Vec2::ZERO)
static Label createWithCharMap (const std::string &charMapFile, int itemWidth, int itemHeight, int startCharMap)
static Label createWithCharMap (Texture2D texture, int itemWidth, int itemHeight, int startCharMap)
static Label createWithCharMap (const std::string &plistFile)
static CC_DEPRECATED_ATTRIBUTE Label create (const std::string &text, const std::string &font, float fontSize, const Size &dimensions=Size::ZERO, TextHAlignment hAlignment=TextHAlignment::LEFT, TextVAlignment vAlignment=TextVAlignment::TOP)
- 静态 Public 成员函数 继承自 SpriteBatchNode
static SpriteBatchNode createWithTexture (Texture2D tex, ssize_t capacity=DEFAULT_CAPACITY)
创建一个指定子节点纹理(texture2d)和容量(capacity)参数的SpriteBatchNode。 在运行期如超出预设容量则扩容33。 更多…
static SpriteBatchNode create (const std::string &fileImage, ssize_t capacity=DEFAULT_CAPACITY)
创建一个指定子节点纹理图像文件(.png、.jpeg、.pvr等)和容量(capacity)参数的SpriteBatchNode。 在运行期如超出预设容量则扩容33。 使用TextureMgr加载图像文件。 更多…
- 静态 Public 成员函数 继承自 Node
static Node * create (void)
分配并且初始化一个节点. 更多…
## Protected 属性
bool _maxLengthEnabled
int _maxLength
bool _passwordEnabled
std::string _passwordStyleText
bool _attachWithIME
bool _detachWithIME
bool _insertText
bool _deleteBackward
- Protected 属性 继承自 TextFieldTTF
TextFieldDelegate _delegate
int _charCount
std::string _inputText
std::string _placeHolder
Color4B _colorSpaceHolder
Color4B _colorText
bool _secureTextEntry
- Protected 属性 继承自 Label
std::string _bmFontPath
bool _isOpacityModifyRGB
bool _contentDirty
bool _systemFontDirty
std::string _systemFont
float _systemFontSize
LabelType _currentLabelType
std::vector< SpriteBatchNode > _batchNodes
FontAtlas _fontAtlas
std::vector< LetterInfo > _lettersInfo
TTFConfig _fontConfig
Sprite _textSprite
FontDefinition _fontDefinition
bool _compatibleMode
Sprite _reusedLetter
用于优化 更多…
Rect _reusedRect
int _limitShowCount
float _commonLineHeight
bool _lineBreakWithoutSpaces
int _horizontalKernings
unsigned int _maxLineWidth
Size _labelDimensions
unsigned int _labelWidth
unsigned int _labelHeight
TextHAlignment _hAlignment
TextVAlignment _vAlignment
int _currNumLines
std::u16string _currentUTF16String
std::string _originalUTF8String
float _fontScale
bool _useDistanceField
bool _useA8Shader
LabelEffect _currLabelEffect
Color4B _effectColor
Color4F _effectColorF
GLuint _uniformEffectColor
GLuint _uniformTextColor
CustomCommand _customCommand
bool _shadowDirty
bool _shadowEnabled
Size _shadowOffset
int _shadowBlurRadius
Mat4 _shadowTransform
Color3B _shadowColor
float _shadowOpacity
Sprite _shadowNode
int _outlineSize
Color4B _textColor
Color4F _textColorF
bool _clipEnabled
bool _blendFuncDirty
bool _insideBounds
- Protected 属性 继承自 SpriteBatchNode
TextureAtlas _textureAtlas
BlendFunc _blendFunc
BatchCommand _batchCommand
std::vector< Sprite > _descendants
- Protected 属性 继承自 Node
float _rotationX
X轴的旋转 更多…
float _rotationY
Y轴的旋转 更多…
float _rotationZ_X
旋转角度在Z轴,组件X轴 更多…
float _rotationZ_Y
旋转角度在Z轴,组件Y轴 更多…
float _scaleX
X轴的缩放因子 更多…
float _scaleY
Y轴的缩放因子 更多…
float _scaleZ
Z轴的缩放因子 更多…
Vec2 _position
节点的位置 更多…
float _positionZ
OpenGL 真正Z轴坐标位置 更多…
float _skewX
X轴的倾斜角 更多…
float _skewY
Y轴的倾斜角 更多…
Vec2 _anchorPointInPoints
锚点以points为单位 更多…
Vec2 _anchorPoint
正常的锚点(不是以points为单位的) 更多…
Size _contentSize
未转换节点的大小 更多…
Mat4 _modelViewTransform
节点的模型视图变换 更多…
Mat4 _transform
变换 更多…
bool _transformDirty
transform dirty flag 更多…
Mat4 _inverse
逆变换 更多…
bool _inverseDirty
inverse transform dirty flag 更多…
Mat4 _additionalTransform
变换 更多…
bool _useAdditionalTransform
The flag to check whether the additional transform is dirty. 更多…
bool _transformUpdated
是否Transform 对象在最后一帧更新了 更多…
int _localZOrder
Local 顺序 (和兄妹节点相关) 被用于节点的排序 更多…
float _globalZOrder
Global 顺序 用于节点的排序 更多…
Vector< Node > _children
子节点数列 更多…
Node _parent
父节点的弱引用 更多…
int _tag
一个标记. 你可以定义任何的数字来分辨这个节点 更多…
std::string _name
一个字符串标签, 一个用户定义的字符串来分辨这个节点 更多…
void _userData
一个用户分配的空指针,能够指向任何cpp对象 更多…
Ref _userObject
一个用户分配的对象 更多…
GLProgramState _glProgramState
OpenGL Program State. 更多…
int _orderOfArrival
用于保存序列当对有相同localZOrder的子节点进行排序 更多…
Scheduler _scheduler
调度器用于调度定时器和更新 更多…
ActionManager _actionManager
一个指向ActionManager singleton模式的指针, 用于操作所有的动作。 更多…
EventDispatcher _eventDispatcher
事件调度器使用调度各种事件 更多…
bool _running
活动中 更多…
bool _visible
节点可见 更多…
bool _ignoreAnchorPointForPosition
true 如果锚点 Vec2 是 (0,0) 当你拜访节点时, false则不是(0,0) 更多…
bool _reorderChildDirty
children order dirty flag 更多…
bool _isTransitionFinished
一个表明转换是否完成的标记 更多…
ComponentContainer _componentContainer
Dictionary of components. 更多…
GLubyte _displayedOpacity
GLubyte _realOpacity
Color3B _displayedColor
Color3B _realColor
bool _cascadeColorEnabled
bool _cascadeOpacityEnabled
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…
## 额外继承的成员函数
- Public 属性 继承自 SpriteBatchNode
CC_CONSTRUCTOR_ACCESS pad0: SpriteBatchNode()
- Public 属性 继承自 Node
CC_CONSTRUCTOR_ACCESS pad0: Node()
- 静态 Public 属性 继承自 Label
static const int DistanceFieldFontSize
- 静态 Public 属性 继承自 Node
static const int INVALID_TAG = -1
默认的标记用于所有的节点 更多…
- Protected 类型 继承自 Label
enum LabelType { TTF, BMFONT, CHARMAP, STRING_TEXTURE }
- Protected 成员函数 继承自 TextFieldTTF
virtual bool canAttachWithIME () override
分辨delegate实例是否准备接收一条IME消息 更多…
virtual bool canDetachWithIME () override
决定delegate实例是否停止接收IME发送的消息 NA NA 更多…
virtual const std::string & getContentText () override
IMEDispatcher调用该方法获得保存在delegate中的文本 NA NA. 更多…
- Protected 成员函数 继承自 Label
void onDraw (const Mat4 &transform, bool transformUpdated)
Label (FontAtlas atlas=nullptr, TextHAlignment hAlignment=TextHAlignment::LEFT, TextVAlignment vAlignment=TextVAlignment::TOP, bool useDistanceField=false, bool useA8Shader=false)
NA 更多…
virtual ~Label ()
NA NA 更多…
virtual void setFontAtlas (FontAtlas atlas, bool distanceFieldEnabled=false, bool useA8Shader=false)
bool recordLetterInfo (const cocos2d::Vec2 &point, const FontLetterDefinition &letterDef, int spriteIndex)
bool recordPlaceholderInfo (int spriteIndex)
void setFontScale (float fontScale)
virtual void alignText ()
bool computeHorizontalKernings (const std::u16string &stringToRender)
void computeStringNumLines ()
void updateQuads ()
virtual void updateColor () override
virtual void updateShaderProgram ()
void drawShadowWithoutBlur ()
void drawTextSprite (Renderer renderer, bool parentTransformUpdated)
void createSpriteWithFontDefinition ()
void updateFont ()
void reset ()
- Protected 成员函数 继承自 SpriteBatchNode
void updateQuadFromSprite (Sprite sprite, ssize_t index)
在指定索引位置更新一个quad(顶点的坐标位置,纹理的坐标位置和颜色信息)到纹理集,参数中的Sprite不会添加到子节点数组。 此方法仅在处理一个很大的AtlasSprite且大部分Sprite不改变时调用。 例如:瓦片地图(TMXMap)或包含非常多字符的标签(LabelBMFont) 更多…
void updateAtlasIndex (Sprite sprite, ssize_t curIndex)
void swap (ssize_t oldIndex, ssize_t newIndex)
void updateBlendFunc ()
- Protected 成员函数 继承自 Node
void childrenAlloc (void)
较慢的分配 更多…
void insertChild (Node child, int z)
记录孩子的助手 更多…
void detachChild (Node child, ssize_t index, bool doCleanup)
删除一个孩子,调用child->onExit(), 从子数列中做清理,并删除它。 更多…
Vec2 convertToWindowSpace (const Vec2 &nodePoint) const
转换cocos2d 坐标系到用户界面窗口坐标 更多…
Mat4 transform (const Mat4 &parentTransform)
virtual void updateCascadeOpacity ()
virtual void disableCascadeOpacity ()
virtual void updateCascadeColor ()
virtual void disableCascadeColor ()
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…
- Protected 成员函数 继承自 IMEDelegate
virtual void didAttachWithIME ()
当IME分派delegate,这个方法将被IMEDispatcher调用 NA NA 更多…
virtual void didDetachWithIME ()
当IME分派delegate,这个方法将被IMEDispatcher调用 NA NA 更多…
virtual void keyboardWillShow (IMEKeyboardNotificationInfo &info)
NA NA 更多…
virtual void keyboardDidShow (IMEKeyboardNotificationInfo &info)
NA NA 更多…
virtual void keyboardWillHide (IMEKeyboardNotificationInfo &info)
NA NA 更多…
virtual void keyboardDidHide (IMEKeyboardNotificationInfo &info)
NA NA 更多…
IMEDelegate ()
NA NA 更多…
- 静态 Protected 属性 继承自 Node
static int s_globalOrderOfArrival

详细描述

NA NA

构造及析构函数说明

UICCTextField ( )

~UICCTextField ( )

成员函数说明

void closeIME ( )

static UICCTextField* create ( const std::string & placeholder,
const std::string & fontName,
float fontSize
)

static

void deleteBackward ( )

virtual

当user点击回退键,这个方法被IMEDispatcher调用 NA NA

重载 TextFieldTTF .

bool getAttachWithIME ( )

int getCharCount ( )

bool getDeleteBackward ( )

bool getDetachWithIME ( )

bool getInsertText ( )

int getMaxLength ( )

void insertText ( const char * text,
size_t len
)

virtual

当文本输入从IME传递过来,这个方法被IMEDispatcher调用 NA NA

重载 TextFieldTTF .

bool isMaxLengthEnabled ( )

bool isPasswordEnabled ( )

virtual void onEnter ( )

overridevirtual

每次当Node进入“stage”时才调用事件回调。 如果Node进入“stage”状态时伴随着一个转换(transition),那么事件将会在这个转换开始的时候被调用。 在onEnter过程中,你不能够接入“sister/brother”兄妹节点。 如果你重写了onEnter方法,你应该调用它的父类,e.g., Node::onEnter().

NA NA

重载 Node .

virtual bool onTextFieldAttachWithIME ( TextFieldTTF * sender)

overridevirtual

如果sender不想附加到IME,返回true

重载 TextFieldDelegate .

virtual bool onTextFieldDeleteBackward ( TextFieldTTF sender,
const char delText,
size_t nLen
)

overridevirtual

如何sender不想删除delText,返回true

重载 TextFieldDelegate .

virtual bool onTextFieldDetachWithIME ( TextFieldTTF * sender)

overridevirtual

如果sender不想解除IME,返回true

重载 TextFieldDelegate .

virtual bool onTextFieldInsertText ( TextFieldTTF sender,
const char text,
size_t nLen
)

overridevirtual

如果sender不想插入文本,返回true

重载 TextFieldDelegate .

void openIME ( )

void setAttachWithIME ( bool attach)

void setDeleteBackward ( bool deleteBackward)

void setDetachWithIME ( bool detach)

void setInsertText ( bool insert)

void setMaxLength ( int length)

void setMaxLengthEnabled ( bool enable)

void setPasswordEnabled ( bool enable)

void setPasswordStyleText ( const std::string & styleText)

void setPasswordText ( const std::string & text)

类成员变量说明

bool _attachWithIME

protected

bool _deleteBackward

protected

bool _detachWithIME

protected

bool _insertText

protected

int _maxLength

protected

bool _maxLengthEnabled

protected

bool _passwordEnabled

protected

std::string _passwordStyleText

protected


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/ui/UITextField.h