resize title, added a null safety net for creative entity spawning

This commit is contained in:
Harrison Deng 2017-07-31 01:36:48 -05:00
parent 162b7cb9c0
commit bb5782a34f
13 changed files with 28 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -5,6 +5,8 @@ import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.ScreenAdapter;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import zero1hd.rhythmbullet.RhythmBullet;
import zero1hd.rhythmbullet.ui.stages.CreativeHUD;
@ -15,6 +17,9 @@ public class CreativeDebugScreen extends ScreenAdapter {
GamePlayArea gamePlayArea;
InputMultiplexer inputs;
SpriteBatch bgBatch;
private Texture background;
Preferences prefs;
public CreativeDebugScreen(RhythmBullet core, MainMenu mainMenu) {
@ -24,6 +29,10 @@ public class CreativeDebugScreen extends ScreenAdapter {
inputs = new InputMultiplexer(creative, gamePlayArea);
this.prefs = core.getPrefs();
background = core.getAssetManager().get("star_bg.png");
bgBatch = new SpriteBatch(1);
}
@Override
@ -38,6 +47,10 @@ public class CreativeDebugScreen extends ScreenAdapter {
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
bgBatch.begin();
bgBatch.draw(background, 0f, 0f);
bgBatch.end();
gamePlayArea.getViewport().apply();
gamePlayArea.act();
gamePlayArea.draw();

View File

@ -57,16 +57,6 @@ public class GameScreen extends ScreenAdapter {
inputs.addProcessor(gameArea);
background = core.getAssetManager().get("star_bg.png");
}
@Override
public void show() {
Gdx.input.setInputProcessor(inputs);
gameArea.loadShaders(core.getPrefs());
if (!gameHUD.isPaused()) {
music.getPlaybackMusic().play();
}
if (core.getPrefs().getBoolean("bg shader")) {
Gdx.app.debug("Shader", "using background shader");
@ -85,6 +75,17 @@ public class GameScreen extends ScreenAdapter {
} else {
bgBatch = new SpriteBatch(2);
}
}
@Override
public void show() {
Gdx.input.setInputProcessor(inputs);
gameArea.loadShaders(core.getPrefs());
if (!gameHUD.isPaused()) {
music.getPlaybackMusic().play();
}
super.show();
}

View File

@ -28,7 +28,7 @@ public class MainPage extends Page {
public MainPage(final RhythmBullet core, final Vector3 targetPosition) {
title = new Image(core.getAssetManager().get("title.png", Texture.class));
title.setPosition(15, getHeight() - title.getHeight()-15);
title.setPosition(10, getHeight() - title.getHeight()-30);
addActor(title);
versionLabel = new Label("Version: " + RhythmBullet.VERSION, core.getDefaultSkin(), "sub-font",
core.getDefaultSkin().getColor("default"));

View File

@ -66,8 +66,9 @@ public class SpawnerWindow extends Window {
coords.set(Gdx.input.getX(), Gdx.input.getY());
stage.screenToStageCoordinates(coords);
Entity entity;
if ((entity = ec.getIndex().get(listOfEntities.getSelected()).buildEntity()) != null) {
if (ec.getIndex().get(listOfEntities.getSelected()) != null) {
Entity entity = ec.getIndex().get(listOfEntities.getSelected()).buildEntity();
switch(entity.getEntityType()) {
case LASER:
Laser laser = (Laser) entity;