本文整理汇总了C++中Sign::setFontToSolutionSound方法的典型用法代码示例。如果您正苦于以下问题:C++ Sign::setFontToSolutionSound方法的具体用法?C++ Sign::setFontToSolutionSound怎么用?C++ Sign::setFontToSolutionSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sign
的用法示例。
在下文中一共展示了Sign::setFontToSolutionSound方法的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);
}