com.badlogic.gdx.graphics.g2d.Animation.getKeyFrameIndex()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(75)

本文整理了Java中com.badlogic.gdx.graphics.g2d.Animation.getKeyFrameIndex()方法的一些代码示例,展示了Animation.getKeyFrameIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Animation.getKeyFrameIndex()方法的具体详情如下:
包路径:com.badlogic.gdx.graphics.g2d.Animation
类名称:Animation
方法名:getKeyFrameIndex

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];
}

相关文章