本文整理汇总了C++中AnimationPlayer::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimationPlayer::stop方法的具体用法?C++ AnimationPlayer::stop怎么用?C++ AnimationPlayer::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimationPlayer
的用法示例。
在下文中一共展示了AnimationPlayer::stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: freeze
void AnimController::freeze() {
if (!_freezing) {
_freezing = true;
status_cache.clear();
for (Map<StringName, Node*>::Element *E = anim_nodes.front(); E; E=E->next()) {
AnimationPlayer *player = E->get()->cast_to<AnimationPlayer>();
if (player->is_playing()) {
AnimationStatus status;
status.name = player->get_current_animation();
status.position = player->get_current_animation_pos();
status.player = player;
status_cache.push_back(status);
player->stop(false);
player->set_active(false);
}
}
}
}
示例2: _process_graph
//.........这里部分代码省略.........
s >= 3 ? params[2] : Variant(),
s >= 4 ? params[3] : Variant(),
s >= 5 ? params[4] : Variant());
}
}
} break;
case Animation::TYPE_BEZIER: {
TrackCacheBezier *t = static_cast<TrackCacheBezier *>(track);
float bezier = a->bezier_track_interpolate(i, time);
if (t->process_pass != process_pass) {
t->value = 0;
t->process_pass = process_pass;
}
t->value = Math::lerp(t->value, bezier, blend);
} break;
case Animation::TYPE_AUDIO: {
TrackCacheAudio *t = static_cast<TrackCacheAudio *>(track);
if (seeked) {
//find whathever should be playing
int idx = a->track_find_key(i, time);
if (idx < 0)
continue;
Ref<AudioStream> stream = a->audio_track_get_key_stream(i, idx);
if (!stream.is_valid()) {
t->object->call("stop");
t->playing = false;
playing_caches.erase(t);
} else {
float start_ofs = a->audio_track_get_key_start_offset(i, idx);
start_ofs += time - a->track_get_key_time(i, idx);
float end_ofs = a->audio_track_get_key_end_offset(i, idx);
float len = stream->get_length();
if (start_ofs > len - end_ofs) {
t->object->call("stop");
t->playing = false;
playing_caches.erase(t);
continue;
}
t->object->call("set_stream", stream);
t->object->call("play", start_ofs);
t->playing = true;
playing_caches.insert(t);
if (len && end_ofs > 0) { //force a end at a time
t->len = len - start_ofs - end_ofs;
} else {
t->len = 0;
}
t->start = time;
}
} else {
//find stuff to play
List<int> to_play;