本文整理汇总了C++中EventFrame类的典型用法代码示例。如果您正苦于以下问题:C++ EventFrame类的具体用法?C++ EventFrame怎么用?C++ EventFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventFrame类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFrameEvent
void AnimationCommandLayer::onFrameEvent(Frame * frame)
{
EventFrame* evnt = dynamic_cast<EventFrame*>(frame);
std::string aniStr = evnt->getEvent();
if (!evnt)
{
return;
}
Sprite* sp = (Sprite*)evnt->getNode();
if (aniStr != "")//spine动画 compare(0, 3, "spi")
{
Player * player = (Player *)sp->getChildByTag(SPINE_ANIMATION_PLAYER_TAG);
player->playRoleAction(aniStr.c_str(), true);
CCLOG("%s Spine Animation is %s", player->getName().c_str(), aniStr.c_str());
}
//暂时去掉下面的代码,如果以后需要执行cocos studio做不出来的动画,那么修改规则,用下面的代码 cuihanbing
// else if (str.compare(0, 3, "act") == 0)//需要cocos2d执行的动画
// {
// if (str == "act_chuxian")
// {
// evnt->getNode()->setOpacity(256);
// CCLOG("Action is %s", str.c_str());
// }
// }
}
示例2: clone
Frame* EventFrame::clone()
{
EventFrame* frame = EventFrame::create();
frame->setEvent(_event);
frame->cloneProperty(this);
return frame;
}
示例3: EventFrame
void MainFrame::EditEvent(Event *EditedEvent = NULL) {
EventFrame *EditedEventFrame = new EventFrame(this);
if (EditedEvent == NULL && EventsList->GetSelectedItemCount() == 1)
EditedEventFrame->LoadEvent(((Event *)EventsList->GetItemData(EventsList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)))->BaseEvent);
else
EditedEventFrame->LoadEvent(EditedEvent);
EditedEventFrame->Show();
}
示例4: loadEventFrame
Frame* ActionTimelineCache::loadEventFrame(const rapidjson::Value& json)
{
EventFrame* frame = EventFrame::create();
const char* evnt = DICTOOL->getStringValue_json(json, Value);
if(evnt != nullptr)
frame->setEvent(evnt);
return frame;
}
示例5: EventFrame
// EventFrame
EventFrame* EventFrame::create()
{
EventFrame* frame = new EventFrame();
if (frame)
{
frame->autorelease();
return frame;
}
CC_SAFE_DELETE(frame);
return nullptr;
}
示例6: new
// EventFrame
EventFrame* EventFrame::create()
{
EventFrame* frame = new (std::nothrow) EventFrame();
if (frame)
{
frame->init();
frame->autorelease();
return frame;
}
CC_SAFE_DELETE(frame);
return nullptr;
}
示例7: setScore
void ScoreLabel::setScore(int score)
{
this->timeline->play("CountUp", false);
this->timeline->setFrameEventCallFunc([this, score](Frame* frame) {
EventFrame* frameEvent = dynamic_cast<EventFrame*>(frame);
auto eventName = frameEvent->getEvent();
if (eventName == "CountUp") {
this->scoreLabel->setString(std::to_string(score));
}
});
}
示例8: loadEventFrameWithFlatBuffers
Frame* ActionTimelineCache::loadEventFrameWithFlatBuffers(const flatbuffers::EventFrame *flatbuffers)
{
EventFrame* frame = EventFrame::create();
std::string event = flatbuffers->value()->c_str();
if (event != "")
frame->setEvent(event);
CCLOG("event = %s", event.c_str());
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
}
示例9: loadEventFrameWithFlatBuffers
Frame* ActionTimelineCache::loadEventFrameWithFlatBuffers(const flatbuffers::EventFrame *flatbuffers)
{
EventFrame* frame = EventFrame::create();
std::string event = flatbuffers->value()->c_str();
if (event != "")
frame->setEvent(event);
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
auto easingData = flatbuffers->easingData();
if (easingData)
{
loadEasingDataWithFlatBuffers(frame, easingData);
}
return frame;
}
示例10: attack
void Entity::attack(const std::string attackName)
{
if (! this->stateMachine->canAttack()) {
return;
}
if (this->stateMachine->isDead()) {
return;
}
EntityAttackParams attackParams = this->getAttackParamsByName(attackName);
std::string particleFilePath = attackParams.particleFilePath;
this->timeline->play(attackName, false);
this->timeline->setFrameEventCallFunc([this, attackName, particleFilePath](Frame* frame) {
EventFrame* frameEvent = dynamic_cast<EventFrame*>(frame);
auto eventName = frameEvent->getEvent();
// log("---- %s ----", eventName.c_str());
if (eventName == "Ready") {
this->currentAttackName = attackName;
this->stateMachine->readyToAttack();
} else if (eventName == "Attack") {
this->stateMachine->startToAttack();
if (particleFilePath != "") {
ParticleSystemQuad* particle = ParticleSystemQuad::create(particleFilePath);
this->addChild(particle);
}
} else if (eventName == "Cooldown") {
this->stateMachine->coolDownAttaking();
} else if (eventName == "Finish") {
this->stateMachine->finishAttaking();
this->currentAttackName = "";
}
});
}
示例11: processFrame
void Cluster::processFrame(const EventFrame& e, Lock& l) {
if (e.isCluster()) {
QPID_LOG_IF(trace, loggable(e.frame), *this << " DLVR: " << e);
ClusterDispatcher dispatch(*this, e.connectionId.getMember(), l);
if (!framing::invoke(dispatch, *e.frame.getBody()).wasHandled())
throw Exception(QPID_MSG("Invalid cluster control"));
}
else if (state >= CATCHUP) {
map.incrementFrameSeq();
ConnectionPtr connection = getConnection(e, l);
if (connection) {
QPID_LOG_IF(trace, loggable(e.frame),
*this << " DLVR " << map.getFrameSeq() << ": " << e);
connection->deliveredFrame(e);
}
else
throw Exception(QPID_MSG("Unknown connection: " << e));
}
else // Drop connection frames while state < CATCHUP
QPID_LOG_IF(trace, loggable(e.frame), *this << " DROP (joining): " << e);
}