Exemple #1
0
void Button::onSizeChanged()
{
    Widget::onSizeChanged();
    updateTitleLocation();
    _normalTextureAdaptDirty = true;
    _pressedTextureAdaptDirty = true;
    _disabledTextureAdaptDirty = true;
}
Exemple #2
0
void Button::onSizeChanged()
{
    Widget::onSizeChanged();
    if(nullptr != _titleRenderer)
    {
        updateTitleLocation();
    }
    _normalTextureAdaptDirty = true;
    _pressedTextureAdaptDirty = true;
    _disabledTextureAdaptDirty = true;
}
Exemple #3
0
/** 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();
    }
}
Exemple #4
0
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();
}