Created
October 5, 2013 11:45
-
-
Save mariusk/6839875 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Vector2 size = Scaling.fit.apply(scene_width, scene_height, scr_width, scr_height); | |
int viewportX = (int)(scr_width - size.x) / 2; | |
int viewportY = (int)(scr_height - size.y) / 2; | |
int viewportWidth = (int) size.x; | |
int viewportHeight = (int) size.y; | |
Gdx.gl.glViewport(viewportX, viewportY, viewportWidth, viewportHeight); | |
stage.setViewport(scr_width, scr_height, true, | |
viewportX, viewportY, viewportWidth, viewportHeight); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment