コード例 #1
0
ファイル: UICheckBox.cpp プロジェクト: csouls/nyangame-v3
void UICheckBox::loadTextures(const char *backGround, const char *backGroundSelected, const char *cross,const char* backGroundDisabled,const char* frontCrossDisabled,TextureResType texType)
{
    loadTextureBackGround(backGround,texType);
    loadTextureBackGroundSelected(backGroundSelected,texType);
    loadTextureFrontCross(cross,texType);
    loadTextureBackGroundDisabled(backGroundDisabled,texType);
    loadTextureFrontCrossDisabled(frontCrossDisabled,texType);
}
コード例 #2
0
ファイル: UI.cpp プロジェクト: baokuanze/UIdemo
//复选框
void UI:: initCheckBox(){
    auto visibleSize=Director::getInstance()->getVisibleSize();
    auto cb=CheckBox::create();
    cb->loadTextureBackGround("switch-mask.png");
    cb->loadTextureBackGroundSelected("switch-on.png");//点击时候
    cb->loadTextureFrontCross("switch-off.png");
    cb->addEventListener(CC_CALLBACK_2(UI::checkBoxClick, this));
    cb->setPosition(visibleSize/2);
    addChild(cb);
}
コード例 #3
0
void CheckBox::loadTextures(const std::string& backGround,
                            const std::string& backGroundSelected,
                            const std::string& cross,
                            const std::string& backGroundDisabled,
                            const std::string& frontCrossDisabled,
                            TextureResType texType)
{
    loadTextureBackGround(backGround,texType);
    loadTextureBackGroundSelected(backGroundSelected,texType);
    loadTextureFrontCross(cross,texType);
    loadTextureBackGroundDisabled(backGroundDisabled,texType);
    loadTextureFrontCrossDisabled(frontCrossDisabled,texType);
}
コード例 #4
0
void CheckBox::copySpecialProperties(Widget *widget)
{
    CheckBox* checkBox = dynamic_cast<CheckBox*>(widget);
    if (checkBox)
    {
        loadTextureBackGround(checkBox->_backGroundFileName.c_str(), checkBox->_backGroundTexType);
        loadTextureBackGroundSelected(checkBox->_backGroundSelectedFileName.c_str(), checkBox->_backGroundSelectedTexType);
        loadTextureFrontCross(checkBox->_frontCrossFileName.c_str(), checkBox->_frontCrossTexType);
        loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName.c_str(), checkBox->_backGroundDisabledTexType);
        loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName.c_str(), checkBox->_frontCrossDisabledTexType);
        setSelectedState(checkBox->_isSelected);
    }
}
コード例 #5
0
ファイル: UICheckBox.cpp プロジェクト: 12301043-slc/thiefTD
void CheckBox::copySpecialProperties(Widget *widget)
{
    CheckBox* checkBox = dynamic_cast<CheckBox*>(widget);
    if (checkBox)
    {
        loadTextureBackGround(checkBox->_backGroundFileName, checkBox->_backGroundTexType);
        loadTextureBackGroundSelected(checkBox->_backGroundSelectedFileName, checkBox->_backGroundSelectedTexType);
        loadTextureFrontCross(checkBox->_frontCrossFileName, checkBox->_frontCrossTexType);
        loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName, checkBox->_backGroundDisabledTexType);
        loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName, checkBox->_frontCrossDisabledTexType);
        setSelected(checkBox->_isSelected);
        _checkBoxEventListener = checkBox->_checkBoxEventListener;
        _checkBoxEventSelector = checkBox->_checkBoxEventSelector;
        _checkBoxEventCallback = checkBox->_checkBoxEventCallback;
    }
}
コード例 #6
0
void AbstractCheckButton::copySpecialProperties(Widget *widget)
{
    AbstractCheckButton* abstractCheckButton = dynamic_cast<AbstractCheckButton*>(widget);
    if (abstractCheckButton)
    {
        loadTextureBackGround(abstractCheckButton->_backGroundBoxRenderer->getSpriteFrame());
        loadTextureBackGroundSelected(abstractCheckButton->_backGroundSelectedBoxRenderer->getSpriteFrame());
        loadTextureFrontCross(abstractCheckButton->_frontCrossRenderer->getSpriteFrame());
        loadTextureBackGroundDisabled(abstractCheckButton->_backGroundBoxDisabledRenderer->getSpriteFrame());
        loadTextureFrontCrossDisabled(abstractCheckButton->_frontCrossDisabledRenderer->getSpriteFrame());
        setSelected(abstractCheckButton->_isSelected);
        _zoomScale = abstractCheckButton->_zoomScale;
        _backgroundTextureScaleX = abstractCheckButton->_backgroundTextureScaleX;
        _backgroundTextureScaleY = abstractCheckButton->_backgroundTextureScaleY;
        _isBackgroundSelectedTextureLoaded = abstractCheckButton->_isBackgroundSelectedTextureLoaded;
        _isBackgroundDisabledTextureLoaded = abstractCheckButton->_isBackgroundDisabledTextureLoaded;
        _isFrontCrossDisabledTextureLoaded = abstractCheckButton->_isFrontCrossDisabledTextureLoaded;
    }
}
コード例 #7
0
void CheckBox::copySpecialProperties(Widget *widget)
{
    CheckBox* checkBox = dynamic_cast<CheckBox*>(widget);
    if (checkBox)
    {
        loadTextureBackGround(checkBox->_backGroundBoxRenderer->getSpriteFrame());
        loadTextureBackGroundSelected(checkBox->_backGroundSelectedBoxRenderer->getSpriteFrame());
        loadTextureFrontCross(checkBox->_frontCrossRenderer->getSpriteFrame());
        loadTextureBackGroundDisabled(checkBox->_backGroundBoxDisabledRenderer->getSpriteFrame());
        loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledRenderer->getSpriteFrame());
        setSelected(checkBox->_isSelected);
        _checkBoxEventListener = checkBox->_checkBoxEventListener;
        _checkBoxEventSelector = checkBox->_checkBoxEventSelector;
        _checkBoxEventCallback = checkBox->_checkBoxEventCallback;
        _ccEventCallback = checkBox->_ccEventCallback;
        _zoomScale = checkBox->_zoomScale;
        _backgroundTextureScaleX = checkBox->_backgroundTextureScaleX;
        _backgroundTextureScaleY = checkBox->_backgroundTextureScaleY;
        _isBackgroundSelectedTextureLoaded = checkBox->_isBackgroundSelectedTextureLoaded;
        _isBackgroundDisabledTextureLoaded = checkBox->_isBackgroundDisabledTextureLoaded;
        _isFrontCrossDisabledTextureLoaded = checkBox->_isFrontCrossDisabledTextureLoaded;
    }
}