Created
December 5, 2016 07:26
-
-
Save reime005/553b3a327702cdb89e095e5d2d1ba996 to your computer and use it in GitHub Desktop.
Superclass for your stages in libGDX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.reimerm.hammerize; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.scenes.scene2d.Stage; | |
import com.badlogic.gdx.utils.Scaling; | |
import com.badlogic.gdx.utils.viewport.ScalingViewport; | |
/** | |
* Created by Marius Reimer on 15-Sep-16. | |
*/ | |
public abstract class AbstractStage extends Stage { | |
public AbstractStage() { | |
super(new ScalingViewport(Scaling.stretch, 800, 480, | |
new OrthographicCamera(800, 480))); | |
getCamera().position.set(getCamera().viewportWidth / 2, getCamera().viewportHeight / 2, 0f); | |
getCamera().update(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment