本文整理汇总了C++中TextObject::setFGColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TextObject::setFGColor方法的具体用法?C++ TextObject::setFGColor怎么用?C++ TextObject::setFGColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextObject
的用法示例。
在下文中一共展示了TextObject::setFGColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleFrame
void BinkPlayer::handleFrame() {
MoviePlayer::handleFrame();
if (!_showSubtitles || _subtitleIndex == _subtitles.end())
return;
unsigned int startFrame, endFrame, curFrame;
startFrame = _subtitleIndex->_startFrame;
endFrame = _subtitleIndex->_endFrame;
curFrame = _videoDecoder->getCurFrame();
if (startFrame <= curFrame && curFrame <= endFrame) {
if (!_subtitleIndex->active) {
TextObject *textObject = new TextObject();
textObject->setDefaults(&g_grim->_sayLineDefaults);
Color c(255, 255, 255);
textObject->setFGColor(c);
textObject->setIsSpeech();
if (g_grim->getMode() == GrimEngine::SmushMode) {
// TODO: How to center exactly and put the text exactly
// at the bottom even if there are multiple lines?
textObject->setX(640 / 2);
textObject->setY(40);
}
textObject->setText(g_localizer->localize(_subtitleIndex->_textId.c_str()));
g_grim->setMovieSubtitle(textObject);
_subtitleIndex->active = true;
}
} else if (endFrame < curFrame) {
if (_subtitleIndex->active) {
g_grim->setMovieSubtitle(NULL);
_subtitleIndex->active = false;
_subtitleIndex++;
}
}
}
示例2: sayLine
void Actor::sayLine(const char *msgId, bool background) {
assert(msgId);
char id[50];
Common::String msg = LuaBase::instance()->parseMsgText(msgId, id);
if (msgId[0] == 0) {
error("Actor::sayLine: No message ID for text");
return;
}
// During Fullscreen movies SayLine is usually called for text display only.
// The movie with Charlie screaming after Manny put the sheet on him instead
// uses sayLine for the voice too.
// However, normal SMUSH movies may call SayLine, for example:
// When Domino yells at Manny (a SMUSH movie) he does it with
// a SayLine request rather than as part of the movie!
Common::String soundName = id;
if (g_grim->getGameType() == GType_GRIM) {
soundName += ".wav";
} else if (g_grim->getGameType() == GType_MONKEY4 && g_grim->getGamePlatform() == Common::kPlatformPS2) {
soundName += ".scx";
} else {
soundName += ".wVC";
}
if (_talkSoundName == soundName)
return;
if (_talking || msg.empty())
shutUp();
_talkSoundName = soundName;
if (g_grim->getSpeechMode() != GrimEngine::TextOnly) {
_talkDelay = 500;
if (g_sound->startVoice(_talkSoundName.c_str()) && g_grim->getCurrSet()) {
g_grim->getCurrSet()->setSoundPosition(_talkSoundName.c_str(), _pos);
}
}
// If the actor is clearly not visible then don't try to play the lip sync
if (_visible && (!g_movie->isPlaying() || g_grim->getMode() == GrimEngine::NormalMode)) {
Common::String soundLip = id;
soundLip += ".lip";
if (!_talkChore[0].isPlaying()) {
// _talkChore[0] is *_stop_talk
_talkChore[0].setLastFrame();
}
// Sometimes actors speak offscreen before they, including their
// talk chores are initialized.
// For example, when reading the work order (a LIP file exists for no reason).
// Also, some lip sync files have no entries
// In these cases, revert to using the mumble chore.
if (g_grim->getSpeechMode() != GrimEngine::TextOnly)
_lipSync = g_resourceloader->getLipSync(soundLip);
// If there's no lip sync file then load the mumble chore if it exists
// (the mumble chore doesn't exist with the cat races announcer)
if (!_lipSync)
_mumbleChore.playLooping();
_talkAnim = -1;
}
_talking = true;
g_grim->addTalkingActor(this);
_backgroundTalk = background;
if (background)
_isTalkingBackground = true;
if (_sayLineText && g_grim->getMode() != GrimEngine::SmushMode) {
delete TextObject::getPool().getObject(_sayLineText);
_sayLineText = 0;
}
if (!msg.empty()) {
GrimEngine::SpeechMode m = g_grim->getSpeechMode();
if (!g_grim->_sayLineDefaults.getFont() || m == GrimEngine::VoiceOnly)
return;
TextObject *textObject = new TextObject(false, true);
textObject->setDefaults(&g_grim->_sayLineDefaults);
textObject->setFGColor(_talkColor);
if (m == GrimEngine::TextOnly || g_grim->getMode() == GrimEngine::SmushMode) {
textObject->setDuration(500 + msg.size() * 15 * (11 - g_grim->getTextSpeed()));
}
if (g_grim->getMode() == GrimEngine::SmushMode) {
textObject->setX(640 / 2);
textObject->setY(456);
g_grim->setMovieSubtitle(textObject);
} else {
if (_visible && isInSet(g_grim->getCurrSet()->getName())) {
_mustPlaceText = true;
} else {
_mustPlaceText = false;
textObject->setX(640 / 2);
textObject->setY(463);
}
//.........这里部分代码省略.........