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::loadTextureBackGroundSelected(const std::string& backGroundSelected,TextureResType texType) { if (backGroundSelected.empty()) { return; } _backGroundSelectedFileName = backGroundSelected; _backGroundSelectedTexType = texType; switch (_backGroundSelectedTexType) { case UI_TEX_TYPE_LOCAL: _backGroundSelectedBoxRenderer->setTexture(backGroundSelected); break; case UI_TEX_TYPE_PLIST: _backGroundSelectedBoxRenderer->setSpriteFrame(backGroundSelected); break; default: break; } backGroundSelectedTextureScaleChangedWithSize(); updateAnchorPoint(); updateFlippedX(); updateFlippedY(); updateRGBAToRenderer(_backGroundSelectedBoxRenderer); }
void UICheckBox::onSizeChanged() { backGroundTextureScaleChangedWithSize(); backGroundSelectedTextureScaleChangedWithSize(); frontCrossTextureScaleChangedWithSize(); backGroundDisabledTextureScaleChangedWithSize(); frontCrossDisabledTextureScaleChangedWithSize(); }
void UICheckBox::loadTextureBackGroundSelected(const char *backGroundSelected,TextureResType texType) { if (!backGroundSelected || strcmp(backGroundSelected, "") == 0) { return; } _backGroundSelectedTexType = texType; switch (_backGroundSelectedTexType) { case UI_TEX_TYPE_LOCAL: _backGroundSelectedBoxRenderer->initWithFile(backGroundSelected); break; case UI_TEX_TYPE_PLIST: _backGroundSelectedBoxRenderer->initWithSpriteFrameName(backGroundSelected); break; default: break; } _backGroundSelectedBoxRenderer->setColor(getColor()); _backGroundSelectedBoxRenderer->setOpacity(getOpacity()); backGroundSelectedTextureScaleChangedWithSize(); }
void CheckBox::loadTextureBackGroundSelected(const char *backGroundSelected,TextureResType texType) { if (!backGroundSelected || strcmp(backGroundSelected, "") == 0) { return; } _backGroundSelectedFileName = backGroundSelected; _backGroundSelectedTexType = texType; switch (_backGroundSelectedTexType) { case UI_TEX_TYPE_LOCAL: _backGroundSelectedBoxRenderer->setTexture(backGroundSelected); break; case UI_TEX_TYPE_PLIST: _backGroundSelectedBoxRenderer->setSpriteFrame(backGroundSelected); break; default: break; } updateDisplayedColor(getColor()); updateDisplayedOpacity(getOpacity()); updateAnchorPoint(); backGroundSelectedTextureScaleChangedWithSize(); }