当前位置: 首页>>代码示例>>C++>>正文


C++ EventFrame类代码示例

本文整理汇总了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());
// 			}
// 		}
	}
开发者ID:coldice945,项目名称:AnimationCommandLayer,代码行数:28,代码来源:AnimationCommandLayer.cpp


示例2: clone

Frame* EventFrame::clone()
{
    EventFrame* frame = EventFrame::create();
    frame->setEvent(_event);

    frame->cloneProperty(this);

    return frame;
}
开发者ID:stonejiang208,项目名称:cocos2d-x,代码行数:9,代码来源:CCFrame.cpp


示例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();
}
开发者ID:jgonera,项目名称:remindme,代码行数:10,代码来源:main_frame.cpp


示例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;
}
开发者ID:980538137,项目名称:MyGame-QuickCocos2dx,代码行数:11,代码来源:CCActionTimelineCache.cpp


示例5: EventFrame

// EventFrame
EventFrame* EventFrame::create()
{
    EventFrame* frame = new EventFrame();
    if (frame)
    {
        frame->autorelease();
        return frame;
    }
    CC_SAFE_DELETE(frame);
    return nullptr;
}
开发者ID:couples,项目名称:anysdk-cpp-sample,代码行数:12,代码来源:CCFrame.cpp


示例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;
}
开发者ID:stonejiang208,项目名称:cocos2d-x,代码行数:13,代码来源:CCFrame.cpp


示例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));
        }
    });
}
开发者ID:ryutamaki,项目名称:Circle,代码行数:12,代码来源:ScoreLabel.cpp


示例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;
}
开发者ID:980538137,项目名称:MyGame-QuickCocos2dx,代码行数:19,代码来源:CCActionTimelineCache.cpp


示例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;
}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:23,代码来源:CCActionTimelineCache.cpp


示例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 = "";
        }
    });
}
开发者ID:ryutamaki,项目名称:Circle,代码行数:37,代码来源:Entity.cpp


示例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);
}
开发者ID:cajus,项目名称:qpid-cpp-debian,代码行数:21,代码来源:Cluster.cpp



注:本文中的EventFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。