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

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

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

Animation.setKeyFrames介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. */
public Animation (float frameDuration, T... keyFrames) {
  this.frameDuration = frameDuration;
  setKeyFrames(keyFrames);
}

代码示例来源:origin: libgdx/libgdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. */
public Animation (float frameDuration, T... keyFrames) {
  this.frameDuration = frameDuration;
  setKeyFrames(keyFrames);
}

代码示例来源:origin: libgdx/libgdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. If this Array is type-aware, {@link #getKeyFrames()} can return the
 *           correct type of array. Otherwise, it returns an Object[]. */
public Animation (float frameDuration, Array<? extends T> keyFrames) {
  this.frameDuration = frameDuration;
  Class arrayType = keyFrames.items.getClass().getComponentType();
  T[] frames = (T[])ArrayReflection.newInstance(arrayType, keyFrames.size);
  for (int i = 0, n = keyFrames.size; i < n; i++) {
    frames[i] = keyFrames.get(i);
  }
  setKeyFrames(frames);
}

代码示例来源:origin: libgdx/libgdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. If this Array is type-aware, {@link #getKeyFrames()} can return the
 *           correct type of array. Otherwise, it returns an Object[]. */
public Animation (float frameDuration, Array<? extends T> keyFrames) {
  this.frameDuration = frameDuration;
  Class arrayType = keyFrames.items.getClass().getComponentType();
  T[] frames = (T[])ArrayReflection.newInstance(arrayType, keyFrames.size);
  for (int i = 0, n = keyFrames.size; i < n; i++) {
    frames[i] = keyFrames.get(i);
  }
  setKeyFrames(frames);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. */
public Animation (float frameDuration, T... keyFrames) {
  this.frameDuration = frameDuration;
  setKeyFrames(keyFrames);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Constructor, storing the frame duration and key frames.
 * 
 * @param frameDuration the time between frames in seconds.
 * @param keyFrames the objects representing the frames. If this Array is type-aware, {@link #getKeyFrames()} can return the
 *           correct type of array. Otherwise, it returns an Object[]. */
public Animation (float frameDuration, Array<? extends T> keyFrames) {
  this.frameDuration = frameDuration;
  Class arrayType = keyFrames.items.getClass().getComponentType();
  T[] frames = (T[])ArrayReflection.newInstance(arrayType, keyFrames.size);
  for (int i = 0, n = keyFrames.size; i < n; i++) {
    frames[i] = keyFrames.get(i);
  }
  setKeyFrames(frames);
}

相关文章