Skip to content

Commit

Permalink
fix: 通过清屏解决最大化窗口有残影的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
creeper12356 committed Aug 25, 2024
1 parent d46b347 commit b47e23c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public BasicMenuScreen(MyGame myGame, boolean okVisible, boolean cancelVisible)
this.myGame = myGame;

camera = new OrthographicCamera();
viewport = new FitViewport(Resource.totalWidth, Resource.totalHeight);
viewport.apply();
viewport = new FitViewport(Resource.totalWidth, Resource.totalHeight, camera);

stage = new Stage(viewport);

Expand Down Expand Up @@ -85,16 +84,15 @@ public void show() {

@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(delta);
stage.draw();
}

@Override
public void resize(int width, int height) {
viewport.update(width, height);

Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
viewport.update(width, height, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public static byte[] loadData(String filename) {
// pointMgr = new PointMgr();
// aniTalkButton = new Animation();

language = "en";
language = "zh";

// 启动游戏时加载
Resource.loadGame();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ org.gradle.configureondemand=false
graalHelperVersion=2.0.1
enableGraalNative=false
gdxVersion=1.12.1
projectVersion=1.0.0
projectVersion=1.0.1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.github.creeper12356.lwjgl3;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;

import io.github.creeper12356.MyGame;

/** Launches the desktop (LWJGL3) application. */
Expand Down

0 comments on commit b47e23c

Please sign in to comment.