gpt4 book ai didi

c++ - cocos2d-x中armatureAnimation API的理解

转载 作者:行者123 更新时间:2023-11-28 06:54:13 25 4
gpt4 key购买 nike

我正在阅读 cocos2dx API,完全无法理解 durationTo 变量。任何人都可以给我一个线索吗?

 /**
* Play animation by animation name.
*
* @param animationName The animation name you want to play
* @param durationTo The frames between two animation changing-over.
* It's meaning is changing to this animation need how many frames
*
* -1 : use the value from MovementData get from flash design panel
* @param loop Whether the animation is loop
*
* loop < 0 : use the value from MovementData get from flash design panel
* loop = 0 : this animation is not loop
* loop > 0 : this animation is loop
*/
virtual void play(const std::string& animationName, int durationTo = -1, int loop = -1);

最佳答案

表示“动画变化之间有多少帧”

查看 cocos2d/base/editor-support/cocostudio/CCProcessBase.cpp 函数 ::play()

void ProcessBase::play(int durationTo, int durationTween,  int loop, int tweenEasing)
{
_isComplete = false;
_isPause = false;
_isPlaying = true;
_currentFrame = 0;

/*
* Set m_iTotalFrames to durationTo, it is used for change tween between two animation.
* When changing end, m_iTotalFrames will be setted to _durationTween
*/
_nextFrameIndex = durationTo;
_tweenEasing = (cocos2d::tweenfunc::TweenType)tweenEasing;
}

关于c++ - cocos2d-x中armatureAnimation API的理解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23378389/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com