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


C++ AnimationData::addTimeline方法代码示例

本文整理汇总了C++中AnimationData::addTimeline方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimationData::addTimeline方法的具体用法?C++ AnimationData::addTimeline怎么用?C++ AnimationData::addTimeline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnimationData的用法示例。


在下文中一共展示了AnimationData::addTimeline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AnimationData

    /** @private */
    AnimationData *XMLDataParser::parseAnimationData(const dragonBones::XMLElement *animationXML, ArmatureData *armatureData, uint frameRate)
    {
        AnimationData *animationData = new AnimationData();
        animationData->name = animationXML->Attribute(ConstValues::A_NAME.c_str());
        animationData->frameRate = frameRate;
        animationData->loop = int(animationXML->IntAttribute(ConstValues::A_LOOP.c_str()));
        animationData->setFadeInTime(Number(animationXML->DoubleAttribute(ConstValues::A_FADE_IN_TIME.c_str())));
        animationData->duration = Number(animationXML->DoubleAttribute(ConstValues::A_DURATION.c_str())) / (Number)frameRate;
        animationData->scale = Number(animationXML->DoubleAttribute(ConstValues::A_SCALE.c_str()));
        if(strcmp(animationXML->Attribute(ConstValues::A_TWEEN_EASING.c_str()) , "NaN") == 0)
        {
            animationData->tweenEasing = NaN;
        }
        else
        {
            animationData->tweenEasing = Number(animationXML->DoubleAttribute(ConstValues::A_TWEEN_EASING.c_str()));
        }

        parseTimeline(animationXML, animationData, parseMainFrame, frameRate);

        TransformTimeline *timeline = 0;
        String timelineName;
        for(const dragonBones::XMLElement* timelineXML = animationXML->FirstChildElement(ConstValues::TIMELINE.c_str()) ; timelineXML ; timelineXML = timelineXML->NextSiblingElement(ConstValues::TIMELINE.c_str()))
        {
            timeline = parseTransformTimeline(timelineXML, animationData->duration, frameRate);
            timelineName = timelineXML->Attribute(ConstValues::A_NAME.c_str());
            animationData->addTimeline(timeline, timelineName);
        }

        DBDataUtil::addHideTimeline(animationData, armatureData);
        DBDataUtil::transformAnimationData(animationData, armatureData);

        return animationData;
    }
开发者ID:114393824,项目名称:DragonBonesCPP,代码行数:35,代码来源:XMLDataParser.cpp

示例2: parseAnimationData

AnimationData* ObjectDataParser::parseAnimationData(Json::Value & animationObject, ArmatureData* armatureData,
		int frameRate) {
	AnimationData* animationData = new AnimationData();
	if(animationObject[ConstValues::A_NAME].isString()){
		animationData->name = animationObject[ConstValues::A_NAME].asCString();
	}else if(animationObject[ConstValues::A_NAME].isInt()){
		char temp[64];
		sprintf(temp, "%d", animationObject[ConstValues::A_NAME].asInt());
		animationData->name = temp;
	}
	animationData->frameRate = frameRate;
	animationData->loop = animationObject[ConstValues::A_LOOP].asInt();
	animationData->setFadeInTime(animationObject[ConstValues::A_FADE_IN_TIME].asDouble());
	animationData->setDuration(animationObject[ConstValues::A_DURATION].asDouble() / frameRate);
	animationData->setScale(animationObject[ConstValues::A_SCALE].asDouble());

	if (animationObject.isMember(ConstValues::A_TWEEN_EASING)) {
		float tweenEase = animationObject[ConstValues::A_TWEEN_EASING].asDouble();
		animationData->tweenEasing = tweenEase;
	}

	parseTimeline(animationObject, animationData, ObjectDataParser::parseMainFrame, frameRate);

	TransformTimeline* timeline = NULL;
	std::string timelineName;
	Json::Value & timelines = animationObject[ConstValues::TIMELINE];
	for (uint i = 0; i < timelines.size(); i++) {
		Json::Value & timelineObject = timelines[i];
		timeline = parseTransformTimeline(timelineObject, animationData->getDuration(), frameRate);
		timelineName = timelineObject[ConstValues::A_NAME].asCString();
		animationData->addTimeline(timeline, timelineName);
	}

	//DBDataUtil::addHideTimeline(animationData, armatureData);
	DBDataUtil::transformAnimationData(animationData, armatureData);

	return animationData;
}
开发者ID:ywl19891989,项目名称:DragonBones,代码行数:38,代码来源:ObjectDataParser.cpp


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