void Button::onSizeChanged() { Widget::onSizeChanged(); updateTitleLocation(); _normalTextureAdaptDirty = true; _pressedTextureAdaptDirty = true; _disabledTextureAdaptDirty = true; }
void Button::onSizeChanged() { Widget::onSizeChanged(); if(nullptr != _titleRenderer) { updateTitleLocation(); } _normalTextureAdaptDirty = true; _pressedTextureAdaptDirty = true; _disabledTextureAdaptDirty = true; }
/** replaces the current Label node with a new one */ void Button::setTitleLabel(Label* label) { if (_titleRenderer != label) { CC_SAFE_RELEASE(_titleRenderer); _titleRenderer = label; CC_SAFE_RETAIN(_titleRenderer); addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1); updateTitleLocation(); } }
void Button::setTitleText(const std::string& text) { if (text == getTitleText()) { return; } if(nullptr == _titleRenderer) { this->createTitleRenderer(); } _titleRenderer->setString(text); this->setTitleFontSize(_fontSize); updateContentSize(); updateTitleLocation(); }
void ButtonWithImage::onSizeChanged(){ Widget::onSizeChanged(); updateThumbnailLocation(); updateTitleLocation(); }