cocos2d-js 控件——UIAbstractCheckButton

UIAbstractCheckButton公有属性、方法

/**
 * 创建一个复选框
 * @param backGround            默认状态背景图片
 * @param backGroundSelected    选中状态背景图片
 * @param cross                 选中状态勾选图片
 * @param backGroundDisabled    禁用状态背景图片
 * @param frontCrossDisabled    禁用状态下的勾选图片
 * @param texType               图片类型(Local、Plist)
 * @return 复选框实例
 */
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);

/**
 * 设置默认状态背景图片
 * @param backGround 默认状态背景图片
 * @param type       图片类型(Local、Plist)
 */
void loadTextureBackGround(const std::string& backGround,TextureResType type = TextureResType::LOCAL);

/**
 * 设置选中状态背景图片
 * @param backGroundSelected    选中状态背景图片
 * @param texType               图片类型(Local、Plist)
 */
void loadTextureBackGroundSelected(const std::string& backGroundSelected,TextureResType texType = TextureResType::LOCAL);

/**
 * 设置勾选图片
 * @param crossTextureName  勾选图
 * @param texType           图片类型(Local、Plist)
 */
void loadTextureFrontCross(const std::string& crossTextureName,TextureResType texType = TextureResType::LOCAL);

/**
 * 设置禁用状态背景图片
 * @param backGroundDisabled 禁用状态背景图片
 * @param texType            图片类型(Local、Plist)
 */
void loadTextureBackGroundDisabled(const std::string& backGroundDisabled,TextureResType texType = TextureResType::LOCAL);

/**
 * 设置禁用状态勾选图片
 * @param frontCrossDisabled 禁用状态勾选图
 * @param texType            图片类型(Local、Plist
 */
void loadTextureFrontCrossDisabled(const std::string& frontCrossDisabled,TextureResType texType = TextureResType::LOCAL);

/**
 * 获取当前的选中状态
 * @return true 或 false
 */
bool isSelected()const;

/**
 * 设置选中状态
 * 设置为true将导致CheckBox的状态为“selected”,否则为false。
 * @param true 或 false
 */
void setSelected(bool selected);

/** 
 * 设置用户按下复选框时,缩放的比例
 * CheckBox的最终比例等于(CheckBox原始比例+ _zoomScale)
 */
void setZoomScale(float scale);

/**
 * 获取用户按下复选框时,缩放的比例
 * @return 缩放比例
 */
float getZoomScale()const;

/**
 * 返回背景的精灵
 * @return 精灵
 */
Sprite* getRendererBackground() const { return _backGroundBoxRenderer; }

/**
 * 返回选中时的背景精灵
 * @return 精灵
 */
Sprite* getRendererBackgroundSelected() const { return _backGroundSelectedBoxRenderer; }

/**
 * 返回选中时的勾选图精灵
 * @return 精灵
 */
Sprite* getRendererFrontCross() const { return _frontCrossRenderer; }

/**
 * 返回禁用时的背景精灵
 * @return 精灵
 */
Sprite* getRendererBackgroundDisabled() const { return _backGroundBoxDisabledRenderer; }

/**
 * 返回选中时的勾选图精灵
 * @return 精灵
 */
Sprite* getRendererFrontCrossDisabled() const { return _frontCrossDisabledRenderer; }

ResourceData getBackNormalFile();
ResourceData getBackPressedFile();
ResourceData getBackDisabledFile();
ResourceData getCrossNormalFile();
ResourceData getCrossDisabledFile();
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值