void CheckBox::adaptRenderers() { if (_backGroundBoxRendererAdaptDirty) { backGroundTextureScaleChangedWithSize(); _backGroundBoxRendererAdaptDirty = false; } if (_backGroundSelectedBoxRendererAdaptDirty) { backGroundSelectedTextureScaleChangedWithSize(); _backGroundSelectedBoxRendererAdaptDirty = false; } if (_frontCrossRendererAdaptDirty) { frontCrossTextureScaleChangedWithSize(); _frontCrossRendererAdaptDirty = false; } if (_backGroundBoxDisabledRendererAdaptDirty) { backGroundDisabledTextureScaleChangedWithSize(); _backGroundBoxDisabledRendererAdaptDirty = false; } if (_frontCrossDisabledRendererAdaptDirty) { frontCrossDisabledTextureScaleChangedWithSize(); _frontCrossDisabledRendererAdaptDirty = false; } }
void CheckBox::loadTextureBackGround(const std::string& backGround,TextureResType texType) { if (backGround.empty()) { return; } _backGroundFileName = backGround; _backGroundTexType = texType; switch (_backGroundTexType) { case UI_TEX_TYPE_LOCAL: _backGroundBoxRenderer->setTexture(backGround); break; case UI_TEX_TYPE_PLIST: _backGroundBoxRenderer->setSpriteFrame(backGround); break; default: break; } backGroundTextureScaleChangedWithSize(); updateAnchorPoint(); updateFlippedX(); updateFlippedY(); updateRGBAToRenderer(_backGroundBoxRenderer); }
void UICheckBox::onSizeChanged() { backGroundTextureScaleChangedWithSize(); backGroundSelectedTextureScaleChangedWithSize(); frontCrossTextureScaleChangedWithSize(); backGroundDisabledTextureScaleChangedWithSize(); frontCrossDisabledTextureScaleChangedWithSize(); }
void UICheckBox::loadTextureBackGround(const char *backGround,TextureResType texType) { if (!backGround || strcmp(backGround, "") == 0) { return; } _backGroundTexType = texType; switch (_backGroundTexType) { case UI_TEX_TYPE_LOCAL: _backGroundBoxRenderer->initWithFile(backGround); break; case UI_TEX_TYPE_PLIST: _backGroundBoxRenderer->initWithSpriteFrameName(backGround); break; default: break; } _backGroundBoxRenderer->setColor(getColor()); _backGroundBoxRenderer->setOpacity(getOpacity()); backGroundTextureScaleChangedWithSize(); }
void CheckBox::loadTextureBackGround(const char *backGround,TextureResType texType) { if (!backGround || strcmp(backGround, "") == 0) { return; } _backGroundFileName = backGround; _backGroundTexType = texType; switch (_backGroundTexType) { case UI_TEX_TYPE_LOCAL: _backGroundBoxRenderer->setTexture(backGround); break; case UI_TEX_TYPE_PLIST: _backGroundBoxRenderer->setSpriteFrame(backGround); break; default: break; } updateDisplayedColor(getColor()); updateDisplayedOpacity(getOpacity()); updateAnchorPoint(); backGroundTextureScaleChangedWithSize(); }