PowerUpView.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:feup-lpoo-armadillo 作者:
/**
 * Creates the animation used for this PowerUp Type.
 *
 * @param game the game this view belongs to. Needed to access the
 *             asset manager to get textures.
 * @param fileName the path to the file that contains the animation sheet.
 * @return the animation used for this PowerUp
 */
private Animation<TextureRegion> createAnimation(Armadillo game, String fileName) {
    Texture texture = game.getAssetManager().get(fileName);
    TextureRegion[][] regions = TextureRegion.split(texture, texture.getWidth() / NUM_FRAMES, texture.getHeight());

    TextureRegion[] frames = new TextureRegion[NUM_FRAMES];
    System.arraycopy(regions[0], 0, frames, 0, NUM_FRAMES);

    return new Animation<>(FRAME_TIME, frames);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号