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

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

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

CheckBox类 参考

NA NA 更多…

#include

类 CheckBox 继承关系图:

Public 类型 - 图3 Widget ProtectedNode Node Ref

## Public 类型
enum EventType { SELECTED, UNSELECTED }
typedef std::function< void(Ref , CheckBox::EventType)> ccCheckBoxCallback
- Public 类型 继承自 Widget
enum FocusDirection { LEFT, RIGHT, UP, DOWN }
enum PositionType { ABSOLUTE, PERCENT }
enum SizeType { ABSOLUTE, PERCENT }
enum TouchEventType { BEGAN, MOVED, ENDED, CANCELED }
enum TextureResType { LOCAL = 0, PLIST = 1 }
enum BrightStyle { NONE = -1, NORMAL, HIGHLIGHT }
typedef std::function< void(Ref , Widget::TouchEventType)> ccWidgetTouchCallback
## Public 成员函数
CheckBox ()
默认构造函数(constructor) 更多…
virtual ~CheckBox ()
默认析构函数(destructor) 更多…
void loadTextures (const std::string &backGround, const std::string &backGroundSelected, const std::string &cross, const std::string &backGroundDisabled, const std::string &frontCrossDisabled, TextureResType texType=TextureResType::LOCAL)
加载checkbox的纹理贴图. 更多…
void loadTextureBackGround (const std::string &backGround, TextureResType type=TextureResType::LOCAL)
加载checkbox的背景纹理贴图. 更多…
void loadTextureBackGroundSelected (const std::string &backGroundSelected, TextureResType texType=TextureResType::LOCAL)
加载checkbox选择状态的背景纹理贴图(backGroundSelected). 更多…
void loadTextureFrontCross (const std::string &, TextureResType texType=TextureResType::LOCAL)
加载checkbox的交叉纹理贴图(cross texture). 更多…
void loadTextureBackGroundDisabled (const std::string &backGroundDisabled, TextureResType texType=TextureResType::LOCAL)
加载checkbox禁用状态的背景纹理贴图(backGroundDisabled). 更多…
void loadTextureFrontCrossDisabled (const std::string &frontCrossDisabled, TextureResType texType=TextureResType::LOCAL)
加载checkbox禁用状态的交叉纹理贴图(frontCrossDisabled). 更多…
void setSelectedState (bool selected)
设置checkbox的选中状态. 更多…
bool getSelectedState ()
获取checkbox的选中状态. 更多…
CC_DEPRECATED_ATTRIBUTE void addEventListenerCheckBox (Ref target, SEL_SelectedStateEvent selector)
void addEventListener (const ccCheckBoxCallback &callback)
virtual void onTouchEnded (Touch touch, Event unusedEvent)
virtual const Size & getVirtualRendererSize () const override
获取widget的content size 更多…
virtual Node getVirtualRenderer () override
获取widget的虚拟渲染器 更多…
virtual std::string getDescription () const override
返回 widget的"类名(class name)". 更多…
virtual bool init (const std::string &backGround, const std::string &backGroundSeleted, const std::string &cross, const std::string &backGroundDisabled, const std::string &frontCrossDisabled, TextureResType texType=TextureResType::LOCAL)
- Public 成员函数 继承自 Widget
Widget (void)
默认构造函数 更多…
virtual ~Widget ()
默认析构函数 更多…
virtual void setEnabled (bool enabled)
设置widget是否为可用 更多…
bool isEnabled () const
判断该widget是否可用 更多…
void setBright (bool bright)
设置widget是否为亮色(对应可用状态) 更多…
bool isBright () const
判断该widget是否为亮色 更多…
virtual void setTouchEnabled (bool enabled)
设置widget是否可以响应触摸。 更多…
void setBrightStyle (BrightStyle style)
设置widget的亮色风格(bright style) 更多…
bool isTouchEnabled () const
判定该widget是否可以响应触摸 更多…
bool isHighlighted () const
判定该widget是否为高亮(对应被选中状态) 更多…
void setHighlighted (bool hilight)
设置该widget是否处于高亮状态(对应被选中状态) 更多…
float getLeftInParent ()
获取该widget左边界横坐标 更多…
float getBottomInParent ()
获取该widget底部边界纵坐标 更多…
float getRightInParent ()
获取该widget右边界横坐标 更多…
float getTopInParent ()
获取该widget顶部边界纵坐标 更多…
virtual Widget getChildByName (const std::string &name)
通过名字从容器中获取一个子节点 更多…
virtual void visit (cocos2d::Renderer renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override
访问节点的孩子,并且循环递归的绘制它们。 更多…
CC_DEPRECATED_ATTRIBUTE void addTouchEventListener (Ref target, SEL_TouchEvent selector)
为菜单项的目标/选择器设置触摸事件 更多…
void addTouchEventListener (ccWidgetTouchCallback callback)
virtual void setPosition (const Vec2 &pos) override
改变该widget在OpenGL坐标系中的绝对位置坐标(x,y) 更多…
void setPositionPercent (const Vec2 &percent)
改变该widget在OpenGL坐标系中的相对百分比位置坐标(x,y) 更多…
const Vec2 & getPositionPercent ()
获取该widget在OpenGL坐标系中的相对百分比位置坐标(x,y) 更多…
void setPositionType (PositionType type)
改变该widget的位置坐标类型 更多…
PositionType getPositionType () const
获取该widget的位置坐标类型 更多…
virtual void setFlippedX (bool flippedX)
设置该widget是否应该被水平翻转. 更多…
virtual bool isFlippedX ()
返回表明该widget是否被水平翻转的标识 更多…
virtual void setFlippedY (bool flippedY)
设置该widget是否应该被垂直翻转. 更多…
virtual bool isFlippedY ()
返回表明该widget是否被垂直翻转的标识 更多…
virtual void setColor (const Color3B &color) override
virtual void setOpacity (GLubyte opacity) override
const Color3B & getColor () const override
GLubyte getOpacity () const override
CC_DEPRECATED_ATTRIBUTE bool isFlipX ()
CC_DEPRECATED_ATTRIBUTE void setFlipX (bool flipX)
CC_DEPRECATED_ATTRIBUTE bool isFlipY ()
CC_DEPRECATED_ATTRIBUTE void setFlipY (bool flipY)
bool clippingParentAreaContainPoint (const Vec2 &pt)
virtual void checkChildInfo (int handleState, Widget sender, const Vec2 &touchPoint)
const Vec2 & getTouchStartPos ()
const Vec2 & getTouchMovePos ()
const Vec2 & getTouchEndPos ()
void setName (const std::string &name)
改变widget的名字,使用名字可以更轻松地识别出该widget 更多…
const std::string & getName () const
返回widget的名字,使用名字可以更轻松地识别出该widget 更多…
virtual void setSize (const Size &size)
改变widget的尺寸(size) 更多…
virtual void setSizePercent (const Vec2 &percent)
改变widget的百分比尺寸(percent size) 更多…
void setSizeType (SizeType type)
改变widget的尺寸类型(size type) 更多…
SizeType getSizeType () const
获取widget的尺寸类型(size type) 更多…
const Size & getSize () const
返回widget的尺寸(size) 更多…
const Size & getCustomSize () const
virtual const Size & getLayoutSize ()
const Vec2 & getSizePercent () const
返回widget的尺寸百分比 更多…
virtual bool hitTest (const Vec2 &pt)
检查一个点是否在该widget所在区域 更多…
virtual bool onTouchBegan (Touch touch, Event unusedEvent)
virtual void onTouchMoved (Touch touch, Event unusedEvent)
virtual void onTouchCancelled (Touch touch, Event unusedEvent)
void setLayoutParameter (LayoutParameter parameter)
为widget设置LayoutParameter 更多…
LayoutParameter getLayoutParameter (LayoutParameter::Type type)
获取widget的LayoutParameter 更多…
virtual void ignoreContentAdaptWithSize (bool ignore)
忽略widget的尺寸(size) 更多…
bool isIgnoreContentAdaptWithSize () const
检查该widget的尺寸(size)是否被忽略 更多…
Vec2 getWorldPosition ()
获取widget在全局中的位置坐标 更多…
Widget clone ()
virtual void onEnter () override
每次当Node进入“stage”时才调用事件回调。 如果Node进入“stage”状态时伴随着一个转换(transition),那么事件将会在这个转换开始的时候被调用。 在onEnter过程中,你不能够接入“sister/brother”兄妹节点。 如果你重写了onEnter方法,你应该调用它的父类,e.g., Node::onEnter(). 更多…
virtual void onExit () override
事件回调在每次Node离开“stage”时被调用。 如果Node离开‘stage’并开始变换(transition),此事件将在变换(transition)完成后被调用。 在 onExit执行期间你不能访问兄弟节点(sibling node)。 如果你 override onExit, 你应该调用其父节点的此方法, 例如, Node::onExit(). 更多…
void updateSizeAndPosition ()
void updateSizeAndPosition (const Size &parentSize)
void setActionTag (int tag)
int getActionTag ()
bool isFocused ()
void setFocused (bool focus)
bool isFocusEnabled ()
void setFocusEnabled (bool enable)
virtual Widget findNextFocusedWidget (FocusDirection direction, Widget current)
当一个widget处于某一个layout中的时候,你可以通过调用这个方法在指定的方向获取下一个被focus的widget 如果一个widget没有在一个layout中,调用这个方法会获得该widget自身 更多…
void requestFocus ()
当一个widget调用了这个方法,这个widget会立刻被focus 更多…
void onFocusChange (Widget widgetLostFocus, Widget widgetGetFocus)
这个方法会在focus状态发生改变的时候被调用 更多…
void dispatchFocusEvent (Widget widgetLoseFocus, Widget widgetGetFocus)
通过EventDispatcher来调度EventFocus 更多…
Widget getCurrentFocusedWidget (bool isWidget)
不管你想要调用这个方法去获得什么样的widget对象,这个方法会返回给你被focus的widget 更多…
- Public 成员函数 继承自 ProtectedNode
virtual void cleanup () override
暂停所有的活动着的动作和调度器。 更多…
virtual void onEnterTransitionDidFinish () override
当Node进入“stage”时,事件回调被调用。 如果Node进入‘stage’并开始变换(transition),此事件将在变换(transition)完成后被调用。 如果你 override onEnterTransitionDidFinish, 你应该调用其父节点的此方法, 例如: Node::onEnterTransitionDidFinish() NA NA 更多…
virtual void onExitTransitionDidStart () override
事件回调在每次Node离开“stage”时被调用。 如果Node离开‘stage’并开始变换(transition),此事件将在变换(transition)开始时被调用。 NA NA 更多…
virtual void updateDisplayedOpacity (GLubyte parentOpacity) override
virtual void updateDisplayedColor (const Color3B &parentColor) override
virtual void disableCascadeColor () override
virtual ~ProtectedNode ()
virtual void addProtectedChild (Node child)
添加一个z-order为0的child到容器中。 更多…
virtual void addProtectedChild (Node child, int localZOrder)
添加一个child(定义localZOrder)到容器中。 更多…
virtual void addProtectedChild (Node child, int localZOrder, int tag)
添加一个child(定义localZOrder,定义tag)到容器中。 更多…
virtual Node getProtectedChildByTag (int tag)
从容器中获取child及其tag 更多…
virtual void removeProtectedChild (Node child, bool cleanup=true)
从容器中删除一个child。它也将清除所有运行中的动作(取决于cleanup的参数)。 更多…
virtual void removeProtectedChildByTag (int tag, bool cleanup=true)
根据tag的值(value)来删除child。它也将清除所有运行中的动作(取决于cleanup的参数)。 更多…
virtual void removeAllProtectedChildren ()
删除容器中所有child。 更多…
virtual void removeAllProtectedChildrenWithCleanup (bool cleanup)
删除容器中所有child,并清理所有运行中的动作(取决于cleanup的参数)。 更多…
virtual void reorderProtectedChild (Node child, int localZOrder)
重新排序(reorders)一个child依据其新z值(z vlaue)。(此z值应为localZOrder的值,原文简写为z value。译者注) 更多…
virtual void sortAllProtectedChildren ()
在绘制之前整理子节点数组(children array),而不是每次子节点(child node)被添加或重新排序(reordered)时。 此方法可以大大提高性能。 更多…
- Public 成员函数 继承自 Node
virtual bool isRunning () const
返回节点是否是“running(活动的)”。 更多…
void scheduleUpdateWithPriorityLua (int handler, int priority)
lua script的时间表 NA 更多…
virtual void draw (Renderer renderer, const Mat4 &transform, bool transformUpdated)
重写这个方法来绘制你自己的节点。 以下的GL状态是默认开启的: 更多…
virtual void draw () final
virtual void visit () final
virtual Scene getScene ()
返回包含Node(节点)的Scene(场景)。 如果这个节点不属于任何的场景,它将返回nullptr。 这个函数循环递归地调用parent->getScene() 直到父类是一个Scene对象。结果不会被缓存。只有当这个函数被用在一个循环中时,用户才会缓存这个结果。 更多…
virtual Rect getBoundingBox () const
返回 一个AABB(轴向包围盒)在它的父坐标系中。 更多…
virtual CC_DEPRECATED_ATTRIBUTE Rect boundingBox () const
virtual void setEventDispatcher (EventDispatcher dispatcher)
virtual EventDispatcher getEventDispatcher () const
virtual GLubyte getDisplayedOpacity () const
virtual bool isCascadeOpacityEnabled () const
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)
virtual const Color3B & getDisplayedColor () const
virtual bool isCascadeColorEnabled () const
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)
virtual void setOpacityModifyRGB (bool bValue)
virtual bool isOpacityModifyRGB () const
virtual ~Node ()
virtual bool init ()
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 setScaleX (float scaleX)
设置节点的缩放(x)。 更多…
virtual float getScaleX () const
返回该节点的X轴的缩放因子。 更多…
virtual void setScaleY (float scaleY)
设置节点的缩放(y)。 更多…
virtual float getScaleY () const
返回该节点的Y轴的缩放因子。 更多…
virtual void setScaleZ (float scaleZ)
改变该节点的Z轴的缩放因子。 更多…
virtual float getScaleZ () const
返回该节点的梓州的缩放因子。 更多…
virtual void setScale (float scale)
设置几点的缩放(x,y,z). 更多…
virtual float getScale () const
得到该节点的缩放因子,当X轴和Y轴有相同的缩放因子时。 更多…
virtual void setScale (float scaleX, float scaleY)
设置节点的缩放(x,y). 更多…
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 const Size & getContentSize () const
返回未转换节点的大小。 更多…
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 void addChild (Node child, int localZOrder, int tag)
添加一个子节点到容器中,有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 removeChild (Node child, bool cleanup=true)
从容器中删除一个孩子,取决于cleanup参数同时会清除所有的活动的动作。 更多…
virtual void removeChildByTag (int tag, bool cleanup=true)
从一个容器中删除一个孩子通过标记值。取决于cleanup参数同时会清除所有的活动的动作。 更多…
virtual void removeAllChildren ()
从容器中删除所有的孩子,with a cleanup。 更多…
virtual void removeAllChildrenWithCleanup (bool cleanup)
从容器中删除所有的孩子, 取决于cleanup参数同时会清除所有的活动的动作。 更多…
virtual void reorderChild (Node child, int localZOrder)
对一个孩子重新排序,设定一个新的z轴的值。 更多…
virtual void sortAllChildren ()
在绘画之前,排列所有的孩子数组一次,而不是每次添加或者删除子节点时都排序。 这个方法可以大量地提高性能。 更多…
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 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 成员函数
static CheckBox create ()
分配(allocates)并初始化(initializes). 更多…
static CheckBox create (const std::string &backGround, const std::string &backGroundSeleted, const std::string &cross, const std::string &backGroundDisabled, const std::string &frontCrossDisabled, TextureResType texType=TextureResType::LOCAL)
创建一个checkbox 更多…
- 静态 Public 成员函数 继承自 Widget
static Widget create ()
分配空间并初始化widget 更多…
- 静态 Public 成员函数 继承自 ProtectedNode
static ProtectedNode create (void)
- 静态 Public 成员函数 继承自 Node
static Node * create (void)
分配并且初始化一个节点. 更多…
## Public 属性
CC_CONSTRUCTOR_ACCESS pad0: virtual bool init() override
- Public 属性 继承自 Widget
CC_CONSTRUCTOR_ACCESS pad0: virtual bool init() override
std::function< void(Widget , Widget )> onFocusChanged
std::function< Widget *(FocusDirection)> onNextFocusedWidget
- Public 属性 继承自 ProtectedNode
CC_CONSTRUCTOR_ACCESS pad0: ProtectedNode()
- Public 属性 继承自 Node
CC_CONSTRUCTOR_ACCESS pad0: Node()
## Protected 成员函数
virtual void initRenderer () override
virtual void onPressStateChangedToNormal () override
virtual void onPressStateChangedToPressed () override
virtual void onPressStateChangedToDisabled () override
void selectedEvent ()
void unSelectedEvent ()
virtual void onSizeChanged () override
virtual void updateTextureColor () override
virtual void updateTextureOpacity () override
virtual void updateTextureRGBA () override
virtual void updateFlippedX () override
virtual void updateFlippedY () override
void backGroundTextureScaleChangedWithSize ()
void backGroundSelectedTextureScaleChangedWithSize ()
void frontCrossTextureScaleChangedWithSize ()
void backGroundDisabledTextureScaleChangedWithSize ()
void frontCrossDisabledTextureScaleChangedWithSize ()
virtual Widget createCloneInstance () override
virtual void copySpecialProperties (Widget model) override
virtual void adaptRenderers () override
- Protected 成员函数 继承自 Widget
void pushDownEvent ()
void moveEvent ()
void releaseUpEvent ()
void cancelUpEvent ()
void updateColorToRenderer (Node renderer)
void updateOpacityToRenderer (Node renderer)
void updateRGBAToRenderer (Node renderer)
void copyProperties (Widget model)
virtual void copyClonedWidgetChildren (Widget model)
Widget getWidgetParent ()
void updateContentSizeWithTextureSize (const Size &size)
bool isAncestorsEnabled ()
Widget getAncensterWidget (Node node)
bool isAncestorsVisible (Node node)
- Protected 成员函数 继承自 ProtectedNode
void insertProtectedChild (Node child, int z)
helper重新排序一个child 更多…
- 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 updateColor ()
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…
## Protected 属性
Sprite _backGroundBoxRenderer
Sprite _backGroundSelectedBoxRenderer
Sprite _frontCrossRenderer
Sprite _backGroundBoxDisabledRenderer
Sprite _frontCrossDisabledRenderer
bool _isSelected
Ref _checkBoxEventListener
SEL_SelectedStateEvent _checkBoxEventSelector
ccCheckBoxCallback _checkBoxEventCallback
TextureResType _backGroundTexType
TextureResType _backGroundSelectedTexType
TextureResType _frontCrossTexType
TextureResType _backGroundDisabledTexType
TextureResType _frontCrossDisabledTexType
std::string _backGroundFileName
std::string _backGroundSelectedFileName
std::string _frontCrossFileName
std::string _backGroundDisabledFileName
std::string _frontCrossDisabledFileName
bool _backGroundBoxRendererAdaptDirty
bool _backGroundSelectedBoxRendererAdaptDirty
bool _frontCrossRendererAdaptDirty
bool _backGroundBoxDisabledRendererAdaptDirty
bool _frontCrossDisabledRendererAdaptDirty
- Protected 属性 继承自 Widget
bool _enabled
widget的最高控制 更多…
bool _bright
widget是否为亮色(bright) 更多…
bool _touchEnabled
widget是否能响应触摸 更多…
bool _highlight
widget是否被focus 更多…
BrightStyle _brightStyle
亮色风格(bright style) 更多…
Vec2 _touchStartPos
触摸开始点 更多…
Vec2 _touchMovePos
触摸移动点 更多…
Vec2 _touchEndPos
触摸结束点 更多…
Ref _touchEventListener
SEL_TouchEvent _touchEventSelector
ccWidgetTouchCallback _touchEventCallback
std::string _name
int _actionTag
Size _size
Size _customSize
bool _ignoreSize
bool _affectByClipping
SizeType _sizeType
Vec2 _sizePercent
PositionType _positionType
Vec2 _positionPercent
bool _reorderWidgetChildDirty
bool _hitted
EventListenerTouchOneByOne _touchListener
Color3B _color
GLubyte _opacity
bool _flippedX
bool _flippedY
Map< int, LayoutParameter > _layoutParameterDictionary
bool _focused
bool _focusEnabled
- Protected 属性 继承自 ProtectedNode
Vector< Node > _protectedChildren
子节点(children nodes)数组 更多…
bool _reorderProtectedChildDirty
- 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 属性 继承自 Node
static const int INVALID_TAG = -1
默认的标记用于所有的节点 更多…
- 静态 Protected 属性 继承自 Widget
static Widget _focusedWidget
储存唯一一个处于被focus状态的widget 更多…
static Widget _realFocusedWidget
- 静态 Protected 属性 继承自 Node
static int s_globalOrderOfArrival

详细描述

NA NA

成员类型定义说明

typedef std::function<void(Ref*,CheckBox::EventType)> ccCheckBoxCallback

成员枚举类型说明

enum EventType

strong

枚举值
SELECTED
UNSELECTED

构造及析构函数说明

CheckBox ( )

默认构造函数(constructor)

virtual ~CheckBox ( )

virtual

默认析构函数(destructor)

成员函数说明

virtual void adaptRenderers ( )

overrideprotectedvirtual

重载 Widget .

void addEventListener ( const ccCheckBoxCallback & callback)

CC_DEPRECATED_ATTRIBUTE void addEventListenerCheckBox ( Ref * target,
SEL_SelectedStateEvent selector
)

void backGroundDisabledTextureScaleChangedWithSize ( )

protected

void backGroundSelectedTextureScaleChangedWithSize ( )

protected

void backGroundTextureScaleChangedWithSize ( )

protected

virtual void copySpecialProperties ( Widget * model)

overrideprotectedvirtual

重载 Widget .

static CheckBox* create ( )

static

分配(allocates)并初始化(initializes).

static CheckBox* create ( const std::string & backGround,
const std::string & backGroundSeleted,
const std::string & cross,
const std::string & backGroundDisabled,
const std::string & frontCrossDisabled,
TextureResType texType = TextureResType::LOCAL
)

static

创建一个checkbox

  • 参数
  • backGround背景纹理(texture). backGroundSelected选择状态的背景纹理(texture). cross交叉纹理贴图(cross texture). frontCrossDisabled暗态交叉纹理贴图(cross dark state texture)(暗态(dark state)即为禁用状态(Disabled) ). texType

virtual Widget* createCloneInstance ( )

overrideprotectedvirtual

重载 Widget .

void frontCrossDisabledTextureScaleChangedWithSize ( )

protected

void frontCrossTextureScaleChangedWithSize ( )

protected

virtual std::string getDescription ( ) const

overridevirtual

返回 widget的"类名(class name)".

重载 Widget .

bool getSelectedState ( )

获取checkbox的选中状态.

  • 返回
  • selected 值为true 时 checkbox 为选中状态, 为false 则不会.

virtual Node* getVirtualRenderer ( )

overridevirtual

获取widget的虚拟渲染器

比如说,按钮的虚拟渲染器渲染器就是该按钮的纹理贴图的渲染器

  • 返回
  • Node pointer.

重载 Widget .

virtual const Size& getVirtualRendererSize ( ) const

overridevirtual

获取widget的content size

Content size是指widget所用纹理贴图的尺寸

重载 Widget .

virtual bool init ( const std::string & backGround,
const std::string & backGroundSeleted,
const std::string & cross,
const std::string & backGroundDisabled,
const std::string & frontCrossDisabled,
TextureResType texType = TextureResType::LOCAL
)

virtual

virtual void initRenderer ( )

overrideprotectedvirtual

重载 Widget .

void loadTextureBackGround ( const std::string & backGround,
TextureResType type = TextureResType::LOCAL
)

加载checkbox的背景纹理贴图.

  • 参数
  • backGround背景纹理(texture). texType

void loadTextureBackGroundDisabled ( const std::string & backGroundDisabled,
TextureResType texType = TextureResType::LOCAL
)

加载checkbox禁用状态的背景纹理贴图(backGroundDisabled).

  • 参数
  • backGroundDisabled禁用状态的背景纹理贴图(texture). texType

void loadTextureBackGroundSelected ( const std::string & backGroundSelected,
TextureResType texType = TextureResType::LOCAL
)

加载checkbox选择状态的背景纹理贴图(backGroundSelected).

  • 参数
  • backGroundSelected选择状态的背景纹理(texture). texType

void loadTextureFrontCross ( const std::string & ,
TextureResType texType = TextureResType::LOCAL
)

加载checkbox的交叉纹理贴图(cross texture).

  • 参数
  • cross交叉纹理贴图(cross texture). texType

void loadTextureFrontCrossDisabled ( const std::string & frontCrossDisabled,
TextureResType texType = TextureResType::LOCAL
)

加载checkbox禁用状态的交叉纹理贴图(frontCrossDisabled).

  • 参数
  • frontCrossDisabled禁用状态的交叉纹理贴图(texture). texType

void loadTextures ( const std::string & backGround,
const std::string & backGroundSelected,
const std::string & cross,
const std::string & backGroundDisabled,
const std::string & frontCrossDisabled,
TextureResType texType = TextureResType::LOCAL
)

加载checkbox的纹理贴图.

  • 参数
  • backGround背景纹理(texture). backGroundSelected选择状态的背景纹理(texture). cross交叉纹理贴图(cross texture). frontCrossDisabled暗态交叉纹理贴图(cross dark state texture). texType

virtual void onPressStateChangedToDisabled ( )

overrideprotectedvirtual

重载 Widget .

virtual void onPressStateChangedToNormal ( )

overrideprotectedvirtual

重载 Widget .

virtual void onPressStateChangedToPressed ( )

overrideprotectedvirtual

重载 Widget .

virtual void onSizeChanged ( )

overrideprotectedvirtual

重载 Widget .

virtual void onTouchEnded ( Touch touch,
Event unusedEvent
)

virtual

重载 Widget .

void selectedEvent ( )

protected

void setSelectedState ( bool selected)

设置checkbox的选中状态.

  • 参数
  • selected值为true 时 checkbox 为选中状态, 为false 则不会.

void unSelectedEvent ( )

protected

virtual void updateFlippedX ( )

overrideprotectedvirtual

重载 Widget .

virtual void updateFlippedY ( )

overrideprotectedvirtual

重载 Widget .

virtual void updateTextureColor ( )

overrideprotectedvirtual

重载 Widget .

virtual void updateTextureOpacity ( )

overrideprotectedvirtual

重载 Widget .

virtual void updateTextureRGBA ( )

overrideprotectedvirtual

重载 Widget .

类成员变量说明

CC_CONSTRUCTOR_ACCESS pad0

Sprite* _backGroundBoxDisabledRenderer

protected

bool _backGroundBoxDisabledRendererAdaptDirty

protected

Sprite* _backGroundBoxRenderer

protected

bool _backGroundBoxRendererAdaptDirty

protected

std::string _backGroundDisabledFileName

protected

TextureResType _backGroundDisabledTexType

protected

std::string _backGroundFileName

protected

Sprite* _backGroundSelectedBoxRenderer

protected

bool _backGroundSelectedBoxRendererAdaptDirty

protected

std::string _backGroundSelectedFileName

protected

TextureResType _backGroundSelectedTexType

protected

TextureResType _backGroundTexType

protected

ccCheckBoxCallback _checkBoxEventCallback

protected

Ref* _checkBoxEventListener

protected

SEL_SelectedStateEvent _checkBoxEventSelector

protected

std::string _frontCrossDisabledFileName

protected

Sprite* _frontCrossDisabledRenderer

protected

bool _frontCrossDisabledRendererAdaptDirty

protected

TextureResType _frontCrossDisabledTexType

protected

std::string _frontCrossFileName

protected

Sprite* _frontCrossRenderer

protected

bool _frontCrossRendererAdaptDirty

protected

TextureResType _frontCrossTexType

protected

bool _isSelected

protected


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

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/ui/UICheckBox.h
  • cocos2d
  • ui
  • CheckBox
  • 生成于 2014年 五月 29日 星期四 09:41:55 , 为 cocos2d-x使用 doxygen 1.8.6