当前位置: 首页>>代码示例>>C++>>正文


C++ Sign::setSolutionToFontSound方法代码示例

本文整理汇总了C++中Sign::setSolutionToFontSound方法的典型用法代码示例。如果您正苦于以下问题:C++ Sign::setSolutionToFontSound方法的具体用法?C++ Sign::setSolutionToFontSound怎么用?C++ Sign::setSolutionToFontSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sign的用法示例。


在下文中一共展示了Sign::setSolutionToFontSound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fillSignMap

//invoke only once
void SignFactory::fillSignMap()
{
    int soundType = SIGN_SOUND_DEFAULT;
    //latters 
    for(int i=0;i<LETTERS_LENGTH;i++)
    {
        char stringSignName[20] = { 0 };
        sprintf(stringSignName,"%s%d.png",LatterfileNameByRez.c_str(), i);
        Sign* pSign = Sign::create(stringSignName);
        pSign->setAnchorPoint(Vec2(0.0,0.0));        
        //char ch = m_LatersStr[i-1];
        std::string latter = pUT->int_to_string(i);
        pSign->setLatterInx((i));
        pSign->setLatter(latter);
        pSign->setTag(sign_tags::LETTER_SIGH);

        if(soundType == IS_FALSE)
        {
            char stringSignSoundName[50] = { 0 };
            sprintf(stringSignSoundName,"%s/%s%d.mp3",lang_sound.c_str(),
                                                      sLetterfileSounds_fnt_to_slc.c_str(),
                                                      i);

			//std::string stringSignSoundName ="x";
            std::string stdstringSignSoundName(stringSignSoundName);
            pSign->setFontToSolutionSound(stdstringSignSoundName);
            pSign->setSolutionToFontSound(core::Settings::getInstance()->getSoundManager()
                                                .soundEffectClick_FromSolutionToFont);

			//delete stringSignSoundName;
        }
        else
        {
            pSign->setSolutionToFontSound(core::Settings::getInstance()->getSoundManager()
                                                .soundEffectClick_FromSolutionToFont);
            pSign->setFontToSolutionSound(core::Settings::getInstance()->getSoundManager()
                                                .soundEffectClick_FromSolutionToFont);
        }



        pSign->retain();         
        m_SignMap.insert(std::pair<int, Sign*>((i),pSign));
        //m_SignToNumMap.insert(std::pair<std::string,int>(latter,(i-1)));
         
    }
    //image container
    Sign* pSignContainer = Sign::create(LatterContainerfileNameByRez);
    pSignContainer->setAnchorPoint(Vec2(0.0,0.0)); 
    pSignContainer->setLatterInx(sign_tags::CONTAINER_SIGH);
    pSignContainer->retain();
    m_SignMap.insert(std::pair<int, Sign*>(sign_tags::CONTAINER_SIGH,pSignContainer));
    
    

    //line break
    Sign* pSignLineBreak = Sign::create(LatterContainerfileNameByRez);
    pSignLineBreak->setAnchorPoint(Vec2(0.0,0.0)); 
    pSignLineBreak->setLatterInx(sign_tags::SEPERATOR_SIGH);
    pSignLineBreak->retain();
    m_SignMap.insert(std::pair<int, Sign*>(sign_tags::SEPERATOR_SIGH,pSignLineBreak));


    //scalefactor
    Sign* SignTest = getSign(1);
    Size LatterOrigSize = SignTest->getBoundingBox().size;
    // must be set first TODO fix this... 
    float winWidth =  m_Parent->pFontSelectionContainer->visibleSize.width;
    float locallatterScaleFactor = pUT->getScaleFactorBasedOnWinWidth(winWidth,LatterOrigSize);
    setLatterScaleFactor(locallatterScaleFactor);
    //SignTest->setScale(getLatterScaleFactor());
    pUT->setSignScalefactor(SignTest);
    setLatterScalledSize(SignTest->getBoundingBox().size);
}
开发者ID:freex,项目名称:Cocos2d-x-Guessing-Game,代码行数:75,代码来源:SignFactory.cpp


注:本文中的Sign::setSolutionToFontSound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。