added better background controls
This commit is contained in:
parent
0de981ad13
commit
3c70a4d3f8
BIN
android/assets/gradients.png
Executable file → Normal file
BIN
android/assets/gradients.png
Executable file → Normal file
Binary file not shown.
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 862 B |
@ -159,10 +159,10 @@ public class Mp3Manager implements MusicManager {
|
||||
|
||||
try {
|
||||
decoder.decodeFrame(header, bitstream);
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
} catch (ArrayIndexOutOfBoundsException ae) {
|
||||
Gdx.app.debug("Mp3Manager", "Last buffer reached since array was out of bounds.");
|
||||
} catch (DecoderException e) {
|
||||
Gdx.app.error("MP3 Decoder Error", e.toString());
|
||||
} catch (DecoderException de) {
|
||||
Gdx.app.error("MP3 Decoder Error", de.toString());
|
||||
}
|
||||
bitstream.closeFrame();
|
||||
bytesRead = sampleBuffer.reset();
|
||||
@ -170,8 +170,8 @@ public class Mp3Manager implements MusicManager {
|
||||
} else {
|
||||
currentByteSet = null;
|
||||
}
|
||||
} catch (BitstreamException e1) {
|
||||
e1.printStackTrace();
|
||||
} catch (BitstreamException be) {
|
||||
be.printStackTrace();
|
||||
}
|
||||
return bytesRead;
|
||||
} else {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package zero1hd.rhythmbullet.desktop.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.assets.AssetManager;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
@ -30,6 +31,7 @@ public class AnalysisPage extends Page {
|
||||
|
||||
public AnalysisPage(Skin skin, AssetManager assets) {
|
||||
setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
|
||||
setBgColor(Color.toFloatBits(82,111,157, 255));
|
||||
table = new Table();
|
||||
table.setFillParent(true);
|
||||
table.defaults().space(10f);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package zero1hd.rhythmbullet.desktop.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.assets.AssetManager;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
@ -17,6 +18,7 @@ public class KeybindOptionsPage extends Page {
|
||||
private TextButton backButton;
|
||||
public KeybindOptionsPage(Skin skin, AssetManager assets, final Vector3 cameraPosition) {
|
||||
setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
|
||||
setBgColor(Color.toFloatBits(186,238,255, 255));
|
||||
keyMap = new KeyMap(assets);
|
||||
controlTable = new ControlOptions(skin, keyMap);
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
@ -39,6 +40,7 @@ public class MainPage extends Page implements Observer {
|
||||
public MainPage(RhythmBullet core, final Vector3 targetPosition, MusicListController mlc, final MainMenu mainMenu) {
|
||||
this.mlc = mlc;
|
||||
setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear"));
|
||||
setBgColor(Color.toFloatBits(83,100,170, 255));
|
||||
this.mMenu = mainMenu;
|
||||
titleBar = new TitleBarVisualizer(core.getAssetManager());
|
||||
addActor(titleBar);
|
||||
|
@ -8,6 +8,7 @@ import com.badlogic.gdx.Input.Keys;
|
||||
import com.badlogic.gdx.Preferences;
|
||||
import com.badlogic.gdx.assets.AssetManager;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
@ -67,6 +68,7 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
|
||||
public MusicSelectionPage(Skin skin, MusicListController musicListController, MusicInfoController musicInfoController, AssetManager assetManager, final Vector3 cameraTarget, final AnalysisPage ap) {
|
||||
setTextureBackground(assetManager.get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
|
||||
setBgColor(Color.toFloatBits(110,164,193, 255));
|
||||
this.assets = assetManager;
|
||||
this.skin = skin;
|
||||
this.mc = musicListController;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package zero1hd.rhythmbullet.desktop.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.Preferences;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
@ -27,6 +28,7 @@ public class OptionsPage extends Page {
|
||||
public OptionsPage(final RhythmBullet core, final Vector3 targetPosition, KeybindOptionsPage moreOptionsPage, final MusicListController sc) {
|
||||
super("General", core.getDefaultSkin());
|
||||
setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
|
||||
setBgColor(Color.toFloatBits(93,75,144, 255));
|
||||
//Back button
|
||||
TextButton backButton = new TextButton("Back", core.getDefaultSkin());
|
||||
backButton.addListener(new ChangeListener() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package zero1hd.rhythmbullet.desktop.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||
@ -12,10 +13,11 @@ import com.badlogic.gdx.utils.Disposable;
|
||||
public class Page extends Group implements Disposable {
|
||||
private Label pageTitle;
|
||||
private TextureRegion background;
|
||||
|
||||
private float bgColor;
|
||||
public Page() {
|
||||
setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||
setTouchable(Touchable.childrenOnly);
|
||||
bgColor = Color.toFloatBits(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
public Page(String titleText, Skin skin) {
|
||||
@ -33,11 +35,16 @@ public class Page extends Group implements Disposable {
|
||||
@Override
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
if (background != null) {
|
||||
batch.setColor(bgColor);
|
||||
batch.draw(background, getX(), getY(), getWidth(), getHeight());
|
||||
}
|
||||
super.draw(batch, parentAlpha);
|
||||
}
|
||||
|
||||
public void setBgColor(float bgColor) {
|
||||
this.bgColor = bgColor;
|
||||
}
|
||||
|
||||
public void addSpaceToTitle(float space) {
|
||||
pageTitle.moveBy(space, 0);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Preferences;
|
||||
import com.badlogic.gdx.assets.AssetManager;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
@ -20,6 +21,7 @@ public class VideoOptionsPage extends Page {
|
||||
|
||||
public VideoOptionsPage(Skin skin, Preferences prefs, final MainMenu menu, AssetManager assets) {
|
||||
setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
|
||||
setBgColor(Color.toFloatBits(110,164,193, 255));
|
||||
graphicsTable = new GraphicsOptions(menu, skin, prefs);
|
||||
scrollPane = new ScrollPane(graphicsTable, skin);
|
||||
scrollPane.setFadeScrollBars(false);
|
||||
|
Loading…
Reference in New Issue
Block a user