Java 类com.badlogic.gdx.graphics.glutils.HdpiUtils 实例源码

项目:bladecoder-adventure-engine    文件:RetroSceneScreen.java   
public RetroSceneScreen() {
    screenViewport = new SceneFitViewport();

    worldViewport = new Viewport() {
        // This is the World Viewport. It is like a ScreenViewport but the
        // camera is the same that the screenViewport;
        @Override
        public void apply(boolean centerCamera) {
            HdpiUtils.glViewport(getScreenX(), getScreenY(), getScreenWidth(), getScreenHeight());
            getCamera().viewportWidth = getScreenWidth();
            getCamera().viewportHeight = getScreenHeight();
            if (centerCamera)
                getCamera().position.set(getScreenWidth() / 2, getScreenHeight() / 2, 0);
            getCamera().update();
        }
    };

    worldViewport.setCamera(screenViewport.getCamera());
}
项目:space-travels-3    文件:MiniMap.java   
public void draw()
{
    // Draw a background and border.
    SpaceTravels3.shapeRenderer.setProjectionMatrix(this.backgroundProjectionMatrix);
    drawBackground();

    SpaceTravels3.shapeRenderer.setProjectionMatrix(this.orthographicCamera.combined);
    Gdx.gl20.glEnable(GL20.GL_SCISSOR_TEST);
    // Crop out everything outside of the minimap (note the +1 to include the last pixel)
    HdpiUtils.glScissor(
        0,
        0,
        SCISSOR_WIDTH,
        SCISSOR_HEIGHT);

    if (this.shipProjection != null)
    {
        this.shipProjection.draw();
    }

    for (GameEntity gameEntity : GameEntityManager.getGameEntities())
    {
        gameEntity.miniMapGraphicComponent.draw();
    }

    Gdx.gl20.glDisable(GL20.GL_SCISSOR_TEST);
}
项目:bladecoder-adventure-engine    文件:SceneExtendViewport.java   
@Override
public void apply(boolean centerCamera) {
    HdpiUtils.glViewport(getScreenX(), getScreenY(), getScreenWidth(), getScreenHeight());
    getCamera().viewportWidth = getScreenWidth();
    getCamera().viewportHeight = getScreenHeight();
    if (centerCamera)
        getCamera().position.set(getScreenWidth() / 2, getScreenHeight() / 2, 0);
    getCamera().update();
}
项目:bladecoder-adventure-engine    文件:SceneFitViewport.java   
@Override
public void apply (boolean centerCamera) {
    HdpiUtils.glViewport(getScreenX(), getScreenY(), getScreenWidth(), getScreenHeight());
    getCamera().viewportWidth = getScreenWidth();
    getCamera().viewportHeight = getScreenHeight();
    if (centerCamera)
        getCamera().position.set(getScreenWidth() / 2, getScreenHeight() / 2, 0);
    getCamera().update();
}
项目:Mundus    文件:BasePicker.java   
protected void begin(Viewport viewport) {
    fbo.begin();
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
    HdpiUtils.glViewport(viewport.getScreenX(), viewport.getScreenY(), viewport.getScreenWidth(),
            viewport.getScreenHeight());
}