main menu background progress
BIN
android/assets/1280x720/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 738 KiB |
BIN
android/assets/1280x800/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 947 KiB |
BIN
android/assets/1366x768/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 891 KiB |
BIN
android/assets/1920x1080/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 3.5 MiB |
Before Width: | Height: | Size: 1.3 MiB |
BIN
android/assets/1920x1200/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 3.8 MiB |
Before Width: | Height: | Size: 1.7 MiB |
BIN
android/assets/2560x1440/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 6.4 MiB |
Before Width: | Height: | Size: 2.0 MiB |
BIN
android/assets/3840x2160/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 15 MiB |
Before Width: | Height: | Size: 452 KiB |
Before Width: | Height: | Size: 4.0 MiB |
@ -1,19 +0,0 @@
|
|||||||
gradients.png
|
|
||||||
size: 128,128
|
|
||||||
format: RGBA8888
|
|
||||||
filter: Linear,Linear
|
|
||||||
repeat: none
|
|
||||||
round-grad
|
|
||||||
rotate: false
|
|
||||||
xy: 2, 2
|
|
||||||
size: 5, 5
|
|
||||||
orig: 5, 5
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
linear-up-grad
|
|
||||||
rotate: false
|
|
||||||
xy: 10, 2
|
|
||||||
size: 5, 5
|
|
||||||
orig: 5, 5
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
Before Width: | Height: | Size: 581 B |
@ -230,7 +230,6 @@ public class RhythmBullet extends Game {
|
|||||||
assetManager.load("shard.png", Texture.class);
|
assetManager.load("shard.png", Texture.class);
|
||||||
assetManager.load("bar.png", Texture.class);
|
assetManager.load("bar.png", Texture.class);
|
||||||
assetManager.load("flake.png", Texture.class);
|
assetManager.load("flake.png", Texture.class);
|
||||||
assetManager.load("star_bg.png", Texture.class);
|
|
||||||
assetManager.load("void_circle.png", Texture.class);
|
assetManager.load("void_circle.png", Texture.class);
|
||||||
assetManager.load("laser.ogg", Sound.class);
|
assetManager.load("laser.ogg", Sound.class);
|
||||||
assetManager.load("explosion.ogg", Sound.class);
|
assetManager.load("explosion.ogg", Sound.class);
|
||||||
@ -239,7 +238,7 @@ public class RhythmBullet extends Game {
|
|||||||
assetManager.load("beateffect.p", ParticleEffect.class);
|
assetManager.load("beateffect.p", ParticleEffect.class);
|
||||||
assetManager.load("tpSelector.png", Texture.class);
|
assetManager.load("tpSelector.png", Texture.class);
|
||||||
assetManager.load("magic1.png", Texture.class);
|
assetManager.load("magic1.png", Texture.class);
|
||||||
assetManager.load("gradients.atlas", TextureAtlas.class);
|
assetManager.load("RhythmBulletBG.png", Texture.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateFonts(final int height) {
|
public void generateFonts(final int height) {
|
||||||
|
@ -43,12 +43,10 @@ public class GraphicsOptions extends Table {
|
|||||||
public void changed(ChangeEvent event, Actor actor) {
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
save();
|
save();
|
||||||
if (glowShader.isChecked()) {
|
if (glowShader.isChecked()) {
|
||||||
mainMenu.attemptLoadShaders();
|
|
||||||
enhancedGlow.setDisabled(false);
|
enhancedGlow.setDisabled(false);
|
||||||
} else {
|
} else {
|
||||||
enhancedGlow.setChecked(false);
|
enhancedGlow.setChecked(false);
|
||||||
enhancedGlow.setDisabled(true);
|
enhancedGlow.setDisabled(true);
|
||||||
mainMenu.unloadShaders();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,6 +6,7 @@ import com.badlogic.gdx.ScreenAdapter;
|
|||||||
import com.badlogic.gdx.graphics.GL20;
|
import com.badlogic.gdx.graphics.GL20;
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||||
import com.badlogic.gdx.graphics.Pixmap.Format;
|
import com.badlogic.gdx.graphics.Pixmap.Format;
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
@ -34,6 +35,7 @@ import zero1hd.rhythmbullet.util.MusicManager;
|
|||||||
|
|
||||||
public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
||||||
public Stage stage;
|
public Stage stage;
|
||||||
|
private Texture background;
|
||||||
private Vector3 cameraPosition;
|
private Vector3 cameraPosition;
|
||||||
|
|
||||||
private MainPage mainPage;
|
private MainPage mainPage;
|
||||||
@ -59,8 +61,9 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
private TextureRegion fboRegion;
|
private TextureRegion fboRegion;
|
||||||
private int fboSize;
|
private int fboSize;
|
||||||
private int blurlvl;
|
private int blurlvl;
|
||||||
private Batch batch;
|
private Batch screenBatch;
|
||||||
private ScreenViewport screenViewport;
|
private ScreenViewport screenViewport;
|
||||||
|
private boolean shaderLoaded;
|
||||||
|
|
||||||
public MainMenu(RhythmBullet core) {
|
public MainMenu(RhythmBullet core) {
|
||||||
this.core = core;
|
this.core = core;
|
||||||
@ -75,6 +78,8 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
mlc.setShuffle(true);
|
mlc.setShuffle(true);
|
||||||
|
|
||||||
mic = new MusicInfoController(musicList);
|
mic = new MusicInfoController(musicList);
|
||||||
|
|
||||||
|
screenBatch = new SpriteBatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -85,6 +90,8 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
stage.addActor(mainPage);
|
stage.addActor(mainPage);
|
||||||
//End main menu
|
//End main menu
|
||||||
|
|
||||||
|
background = core.getAssetManager().get("RhythmBulletBG.png", Texture.class);
|
||||||
|
|
||||||
keybindPage = new KeybindOptionsPage(core.getDefaultSkin(), core.getAssetManager(), cameraPosition);
|
keybindPage = new KeybindOptionsPage(core.getDefaultSkin(), core.getAssetManager(), cameraPosition);
|
||||||
keybindPage.setPosition(-1f*Gdx.graphics.getWidth(), -1f*Gdx.graphics.getHeight());
|
keybindPage.setPosition(-1f*Gdx.graphics.getWidth(), -1f*Gdx.graphics.getHeight());
|
||||||
stage.addActor(keybindPage);
|
stage.addActor(keybindPage);
|
||||||
@ -153,7 +160,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
// Begin drawing a normal version of screen
|
// Begin drawing a normal version of screen
|
||||||
normalBuffer.begin();
|
normalBuffer.begin();
|
||||||
stage.getViewport().apply();
|
stage.getViewport().apply();
|
||||||
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1f);
|
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 0f);
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||||
draw();
|
draw();
|
||||||
normalBuffer.end();
|
normalBuffer.end();
|
||||||
@ -163,14 +170,17 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
|
|
||||||
// Begin light filtering
|
// Begin light filtering
|
||||||
lightFilterBuffer.begin();
|
lightFilterBuffer.begin();
|
||||||
Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
|
Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||||
fboRegion.setTexture(normalBuffer.getColorBufferTexture());
|
fboRegion.setTexture(normalBuffer.getColorBufferTexture());
|
||||||
batch.setShader(brightFilterShader);
|
screenBatch.setShader(brightFilterShader);
|
||||||
batch.setProjectionMatrix(screenViewport.getCamera().combined);
|
screenBatch.setProjectionMatrix(screenViewport.getCamera().combined);
|
||||||
batch.begin(); //BATCH STARTS HERE
|
screenBatch.begin(); //BATCH STARTS HERE
|
||||||
batch.draw(fboRegion, 0, 0, stage.getWidth(), stage.getHeight());
|
|
||||||
batch.flush();
|
//TODO Do shader version of background for main menu.
|
||||||
|
|
||||||
|
screenBatch.draw(fboRegion, 0, 0, stage.getWidth(), stage.getHeight());
|
||||||
|
screenBatch.flush();
|
||||||
lightFilterBuffer.end();
|
lightFilterBuffer.end();
|
||||||
//
|
//
|
||||||
for (int i = 0; i < blurlvl; i++) {
|
for (int i = 0; i < blurlvl; i++) {
|
||||||
@ -181,31 +191,34 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
} else {
|
} else {
|
||||||
fboRegion.setTexture(lightFilterBuffer.getColorBufferTexture());
|
fboRegion.setTexture(lightFilterBuffer.getColorBufferTexture());
|
||||||
}
|
}
|
||||||
batch.setShader(gaussianBlurShader);
|
screenBatch.setShader(gaussianBlurShader);
|
||||||
gaussianBlurShader.setUniformi("horizontal", 1);
|
gaussianBlurShader.setUniformi("horizontal", 1);
|
||||||
batch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight());
|
screenBatch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight());
|
||||||
batch.flush();
|
screenBatch.flush();
|
||||||
hBlur.end();
|
hBlur.end();
|
||||||
|
|
||||||
// //Vertical gaussian blur
|
// //Vertical gaussian blur
|
||||||
vBlur.begin();
|
vBlur.begin();
|
||||||
fboRegion.setTexture(hBlur.getColorBufferTexture());
|
fboRegion.setTexture(hBlur.getColorBufferTexture());
|
||||||
batch.setShader(gaussianBlurShader);
|
screenBatch.setShader(gaussianBlurShader);
|
||||||
gaussianBlurShader.setUniformi("horizontal", 0);
|
gaussianBlurShader.setUniformi("horizontal", 0);
|
||||||
batch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight());
|
screenBatch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight());
|
||||||
batch.flush();
|
screenBatch.flush();
|
||||||
vBlur.end();
|
vBlur.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
|
Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||||
batch.setShader(combineShader);
|
screenBatch.setShader(combineShader);
|
||||||
fboRegion.setTexture(normalBuffer.getColorBufferTexture());
|
fboRegion.setTexture(normalBuffer.getColorBufferTexture());
|
||||||
batch.draw(fboRegion, 0f, 0f, fboSize, fboSize);
|
screenBatch.draw(fboRegion, 0f, 0f, fboSize, fboSize);
|
||||||
batch.setShader(null);
|
screenBatch.setShader(null);
|
||||||
batch.end(); //STAGE BATCH ENDS HERE
|
screenBatch.end(); //BATCH ENDS HERE
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
screenBatch.begin();
|
||||||
|
screenBatch.draw(background, 0, 0);
|
||||||
|
screenBatch.end();
|
||||||
draw();
|
draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +232,6 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void draw() {
|
private void draw() {
|
||||||
//TODO draw background
|
|
||||||
stage.draw();
|
stage.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,6 +239,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
public void preAssetLoad() {
|
public void preAssetLoad() {
|
||||||
stage.clear();
|
stage.clear();
|
||||||
mainPage.dispose();
|
mainPage.dispose();
|
||||||
|
screenBatch.dispose();
|
||||||
optionsPage.dispose();
|
optionsPage.dispose();
|
||||||
creditsPage.dispose();
|
creditsPage.dispose();
|
||||||
keybindPage.dispose();
|
keybindPage.dispose();
|
||||||
@ -297,11 +310,16 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
vBlur = null;
|
vBlur = null;
|
||||||
hBlur = null;
|
hBlur = null;
|
||||||
|
|
||||||
setBlurlvl(0);
|
shaderLoaded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBlurlvl(int blurlvl) {
|
public void setBlurlvl(int blurlvl) {
|
||||||
this.blurlvl = blurlvl;
|
this.blurlvl = blurlvl;
|
||||||
|
if (blurlvl > 0) {
|
||||||
|
attemptLoadShaders();
|
||||||
|
} else {
|
||||||
|
unloadShaders();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 getCameraPosition() {
|
public Vector3 getCameraPosition() {
|
||||||
@ -329,14 +347,13 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void attemptLoadShaders() {
|
public void attemptLoadShaders() {
|
||||||
if (core.getPrefs().getBoolean("glow shader", true)) {
|
if (core.getPrefs().getBoolean("glow shader", true) && !shaderLoaded) {
|
||||||
if (core.getPrefs().getBoolean("enhanced glow", false)) {
|
if (core.getPrefs().getBoolean("enhanced glow", false)) {
|
||||||
blurlvl = 5;
|
blurlvl = 5;
|
||||||
} else {
|
} else {
|
||||||
blurlvl = 1;
|
blurlvl = 1;
|
||||||
}
|
}
|
||||||
Gdx.app.debug("Shader", "Loading glow shaders.");
|
Gdx.app.debug("Shader", "Loading glow shaders.");
|
||||||
batch = new SpriteBatch();
|
|
||||||
screenViewport = new ScreenViewport();
|
screenViewport = new ScreenViewport();
|
||||||
screenViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
screenViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||||
((OrthographicCamera) screenViewport.getCamera()).setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
((OrthographicCamera) screenViewport.getCamera()).setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||||
@ -345,7 +362,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
brightFilterShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/bright_filter.fsh"));
|
brightFilterShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/bright_filter.fsh"));
|
||||||
if (!brightFilterShader.isCompiled()) {
|
if (!brightFilterShader.isCompiled()) {
|
||||||
Gdx.app.error("Shader failed to compile", brightFilterShader.getLog());
|
Gdx.app.error("Shader failed to compile", brightFilterShader.getLog());
|
||||||
System.exit(0);
|
setBlurlvl(0);
|
||||||
}
|
}
|
||||||
if (brightFilterShader.getLog().length() != 0) {
|
if (brightFilterShader.getLog().length() != 0) {
|
||||||
Gdx.app.error("Shader", brightFilterShader.getLog());
|
Gdx.app.error("Shader", brightFilterShader.getLog());
|
||||||
@ -354,7 +371,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh"));
|
gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh"));
|
||||||
if (!gaussianBlurShader.isCompiled()) {
|
if (!gaussianBlurShader.isCompiled()) {
|
||||||
Gdx.app.error("Shader failed to compile", gaussianBlurShader.getLog());
|
Gdx.app.error("Shader failed to compile", gaussianBlurShader.getLog());
|
||||||
System.exit(0);
|
setBlurlvl(0);
|
||||||
}
|
}
|
||||||
if (gaussianBlurShader.getLog().length() != 0) {
|
if (gaussianBlurShader.getLog().length() != 0) {
|
||||||
Gdx.app.error("Shader", gaussianBlurShader.getLog());
|
Gdx.app.error("Shader", gaussianBlurShader.getLog());
|
||||||
@ -363,7 +380,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
combineShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/combine.fsh"));
|
combineShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/combine.fsh"));
|
||||||
if (!combineShader.isCompiled()) {
|
if (!combineShader.isCompiled()) {
|
||||||
Gdx.app.error("Shader failed to compile", combineShader.getLog());
|
Gdx.app.error("Shader failed to compile", combineShader.getLog());
|
||||||
System.exit(0);
|
setBlurlvl(0);
|
||||||
}
|
}
|
||||||
if (combineShader.getLog().length() != 0) {
|
if (combineShader.getLog().length() != 0) {
|
||||||
Gdx.app.error("Shader", combineShader.getLog());
|
Gdx.app.error("Shader", combineShader.getLog());
|
||||||
@ -393,9 +410,9 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen {
|
|||||||
vBlur.getColorBufferTexture().bind(1);
|
vBlur.getColorBufferTexture().bind(1);
|
||||||
|
|
||||||
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0);
|
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0);
|
||||||
}
|
|
||||||
|
|
||||||
ShaderProgram.pedantic = false;
|
ShaderProgram.pedantic = false;
|
||||||
|
shaderLoaded = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|