我的代码运行这样的:LibGDX如何缩放图像的每一个设备
public class MainMenuOptions extends AbstractScreen {
private Texture newGameButton;
private Texture exitGameButton;
private Texture highScoresButton;
private Texture background;
public MainMenuOptions(FallingPeopleMain game) {
super(game);
init();
}
private void init() {
newGameButton = new Texture("newGameButton.jpg");
exitGameButton = new Texture("exitGameButton.jpg");
highScoresButton = new Texture("highScoresGameButton.jpg");
background = new Texture("BG.png");
}
@Override
public void render(float delta) {
spriteBatch.begin();
spriteBatch.draw(background, 0, 0);
spriteBatch.draw(newGameButton, 180, 380);
spriteBatch.draw(highScoresButton, 180, 340);
spriteBatch.draw(exitGameButton, 180, 300);
spriteBatch.end();
}
}
但是,当我玩我的设备华为P8精简版的看起来很垃圾40%的屏幕设备上。如何衡量一切以求好?
我已经宽度和高度上声明主类
认为这将帮助我,但我需要在AndroidLauncher中配置工作?在桌面上,我有Height = 720 Width = 480 – Andrzej1991
720x480不是16:9,请尝试640x360并妥善放置您的资产。 – WonderfulWorld