本文整理了Java中com.badlogic.gdx.graphics.g2d.Animation.getKeyFrameIndex()
方法的一些代码示例,展示了Animation.getKeyFrameIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Animation.getKeyFrameIndex()
方法的具体详情如下:
包路径:com.badlogic.gdx.graphics.g2d.Animation
类名称:Animation
方法名:getKeyFrameIndex
[英]Returns the current frame number.
[中]返回当前帧编号。
代码示例来源:origin: libgdx/libgdx
/** Returns a frame based on the so called state time. This is the amount of seconds an object has spent in the
* state this Animation instance represents, e.g. running, jumping and so on using the mode specified by
* {@link #setPlayMode(PlayMode)} method.
*
* @param stateTime
* @return the frame of animation for the given state time. */
public T getKeyFrame (float stateTime) {
int frameNumber = getKeyFrameIndex(stateTime);
return keyFrames[frameNumber];
}
代码示例来源:origin: libgdx/libgdx
/** Returns a frame based on the so called state time. This is the amount of seconds an object has spent in the
* state this Animation instance represents, e.g. running, jumping and so on using the mode specified by
* {@link #setPlayMode(PlayMode)} method.
*
* @param stateTime
* @return the frame of animation for the given state time. */
public T getKeyFrame (float stateTime) {
int frameNumber = getKeyFrameIndex(stateTime);
return keyFrames[frameNumber];
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Returns a frame based on the so called state time. This is the amount of seconds an object has spent in the
* state this Animation instance represents, e.g. running, jumping and so on using the mode specified by
* {@link #setPlayMode(PlayMode)} method.
*
* @param stateTime
* @return the frame of animation for the given state time. */
public T getKeyFrame (float stateTime) {
int frameNumber = getKeyFrameIndex(stateTime);
return keyFrames[frameNumber];
}
内容来源于网络,如有侵权,请联系作者删除!