【发布时间】:2014-10-24 12:39:54
【问题描述】:
如果我使用精灵,我可以参考我的游戏世界单位设置精灵的大小和位置:
AtlasRegion region = textureAtlas.findRegion("0001");
sprite = new Sprite(region);
sprite.setPosition(11.5f, 5f);
sprite.setSize(7f, 7f * region.getRegionHeight() / region.getRegionWidth());
如何通过动画实现这一点。如何设置每个关键帧精灵的大小?
textureAtlas = new TextureAtlas(Gdx.files.internal("data/bycicle.atlas"));
TextureRegion[] rotateUpFrames = new TextureRegion[4];
// Create an array of TextureRegions
rotateUpFrames[0] = (textureAtlas.findRegion("0001"));
rotateUpFrames[1] = (textureAtlas.findRegion("0002"));
rotateUpFrames[2] = (textureAtlas.findRegion("0003"));
rotateUpFrames[3] = (textureAtlas.findRegion("0004"));
rotateUpAnimation = new Animation(0.1f,rotateUpFrames);
【问题讨论】:
标签: java libgdx game-engine