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