作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在阅读 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/
我是一名优秀的程序员,十分优秀!