这可能是一个愚蠢的问题,但是,我无法在任何地方找到答案。我关注了这篇关于扩展舞台的帖子。
public void resize (int width, int height) {
Vector2 size = Scaling.fit.apply(800, 480, width, height);
int viewportX = (int)(width - size.x) / 2;
int viewportY = (int)(height - size.y) / 2;
int viewportWidth = (int)size.x;
int viewportHeight = (int)size.y;
Gdx.gl.glViewport(viewportX, viewportY, viewportWidth, viewportHeight);
stage.setViewport(800, 480, true, viewportX, viewportY, viewportWidth, viewportHeight);
}
但是,Eclipse 显示以下错误消息。任何想法?libgdx 版本 0.9.8。“Stage 类型中的方法 setViewport(float, float, boolean) 不适用于参数 (int, int, boolean, int, int, int, int)”