52 lines
1.2 KiB
Java
52 lines
1.2 KiB
Java
package catalystsurvival.menu;
|
|
|
|
import catalystsurvival.input.types.InputGamePause;
|
|
import catalystsurvival.text.Text;
|
|
import catalystsurvival.util.gl.GlHelpers;
|
|
import catalystsurvival.util.math.vec.Vec2d;
|
|
|
|
public class MenuGamePause extends Menu
|
|
{
|
|
public boolean resetting;
|
|
private MenuRespawn menu_restart = new MenuRespawn();
|
|
|
|
public MenuGamePause() {
|
|
this.doGameloop = false;
|
|
this.doGameRender = true;
|
|
this.keepMouse = false;
|
|
this.input = new InputGamePause();
|
|
}
|
|
|
|
@Override
|
|
public void render()
|
|
{
|
|
// Render the screen darkening of the gameplay
|
|
GlHelpers.disableTexture2d();
|
|
GlHelpers.color4(0, 0, 0, 0.5);
|
|
GlHelpers.begin();
|
|
GlHelpers.vertex3(-10, -10, 0);
|
|
GlHelpers.vertex3(-10, 10, 0);
|
|
GlHelpers.vertex3(10, 10, 0);
|
|
GlHelpers.vertex3(10, -10, 0);
|
|
GlHelpers.end();
|
|
GlHelpers.color4(1, 1, 1, 1);
|
|
GlHelpers.enableTexture2d();
|
|
|
|
// Render some text to say the game is paused
|
|
GlHelpers.pushMatrix();
|
|
GlHelpers.translate2(0, 4);
|
|
Text.renderCenter("Game Paused", new Vec2d(1, 1));
|
|
GlHelpers.popMatrix();
|
|
|
|
menu_restart.render();
|
|
}
|
|
|
|
@Override
|
|
public void update() {
|
|
super.update();
|
|
menu_restart.update(resetting);
|
|
resetting = false;
|
|
}
|
|
|
|
}
|