本文整理汇总了C++中Movie::GotoFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Movie::GotoFrame方法的具体用法?C++ Movie::GotoFrame怎么用?C++ Movie::GotoFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::GotoFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayAnimation
void LWFCore::PlayAnimation(int animationId, Movie *movie, Button *button)
{
int i = 0;
const vector<int> &animations = data->animations[animationId];
Movie *target = movie;
for (;;) {
switch (animations[i++]) {
case Animation::END:
return;
case Animation::PLAY:
target->Play();
break;
case Animation::STOP:
target->Stop();
break;
case Animation::NEXTFRAME:
target->NextFrame();
break;
case Animation::PREVFRAME:
target->PrevFrame();
break;
case Animation::GOTOFRAME:
target->GotoFrameInternal(animations[i++]);
break;
case Animation::GOTOLABEL:
target->GotoFrame(SearchFrame(target, animations[i++]));
break;
case Animation::SETTARGET:
{
target = movie;
int count = animations[i++];
if (count == 0)
break;
for (int j = 0; j < count; ++j) {
int instId = animations[i++];
switch (instId) {
case Animation::INSTANCE_TARGET_ROOT:
target = rootMovie.get();
break;
case Animation::INSTANCE_TARGET_PARENT:
target = target->parent;
if (!target)
target = rootMovie.get();
break;
default:
{
target = target->SearchMovieInstanceByInstanceId(
instId, false);
if (!target)
target = movie;
break;
}
}
}
}
break;
case Animation::EVENT:
{
int eventId = animations[i++];
#if defined(LWF_USE_LUA)
CallEventFunctionLua(eventId, movie, button);
#endif
EventHandlerList &v(m_eventHandlers[eventId]);
EventHandlerList::iterator it(v.begin()), itend(v.end());
for (; it != itend; ++it)
it->second(movie, button);
}
break;
case Animation::CALL:
#if defined(LWF_USE_LUA)
{
int stringId = animations[i++];
if (stringId < 0 || stringId >= data->strings.size())
break;
CallFunctionLua(data->strings[stringId], target);
}
#else
i++;
#endif
break;
}
}
}