SPLASH.java 文件源码

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

项目:Ponytron 作者:
private void setupSplashImage() {
    DS.game.manager.load(splashImgFilename, Texture.class);
    manager.finishLoading();
    splashLogo = new Sprite(DS.game.manager.get(splashImgFilename, Texture.class));
    splashLogo.getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    double SCALE = DS.T_WIDTH/splashLogo.getWidth();

    if(DS.app_orientation == DS.ORIENTATION.PORTRAIT) {
        splashLogo.setSize((float) (splashLogo.getWidth() * SCALE), (float) (splashLogo.getHeight() * SCALE));
    } else {
        SCALE = DS.T_HEIGHT/splashLogo.getHeight();
        splashLogo.setSize((float) (splashLogo.getWidth() * SCALE), (float) (splashLogo.getHeight() * SCALE));
    }
    int imgX = (int)(DS.T_WIDTH/2.0 - splashLogo.getWidth()/2.0);
    int imgY = (int)(DS.T_HEIGHT/2.0 - splashLogo.getHeight()/2.0);
    Gdx.app.debug(ID, "splshlogo Width: " + splashLogo.getWidth());
    Gdx.app.debug(ID, "splshlogo Height: " + splashLogo.getHeight());
    Gdx.app.debug(ID, "imgX: " + imgX);
    Gdx.app.debug(ID, "imgY: " + imgY);
    splashLogo.setPosition(imgX, imgY);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号