Theme pause band

This commit is contained in:
Lonami Exo 2017-02-05 17:12:29 +01:00
parent ed8aabbed0
commit 077f1919a4
7 changed files with 30 additions and 11 deletions

View file

@ -26,6 +26,7 @@ public class Theme {
public Color currentScore;
public Color highScore;
private Color bandColor;
private Color[] cells;
private Color[] buttons;
@ -107,6 +108,7 @@ public class Theme {
currentScore = new Color((int)Long.parseLong(colors.getString("current_score"), 16));
highScore = new Color((int)Long.parseLong(colors.getString("high_score"), 16));
bandColor = new Color((int)Long.parseLong(colors.getString("band"), 16));
emptyCell = new Color((int)Long.parseLong(colors.getString("empty_cell"), 16));
@ -147,6 +149,10 @@ public class Theme {
return cells[colorIndex];
}
public Color getBandColor() {
return bandColor;
}
public void glClearBackground() {
Gdx.gl.glClearColor(background.r, background.g, background.b, background.a);
}

View file

@ -1,6 +1,5 @@
package io.github.lonamiwebs.klooni.actors;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
@ -32,12 +31,12 @@ public class Band extends Actor {
//region Constructor
public Band(final Klooni game, final GameLayout layout, final BaseScorer scorer, final Color bandColor) {
public Band(final Klooni game, final GameLayout layout, final BaseScorer scorer) {
this.scorer = scorer;
// A 1x1 pixel map will be enough since the band texture will then be expanded
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(bandColor);
pixmap.setColor(Klooni.theme.getBandColor());
pixmap.fill();
bandTexture = new Texture(pixmap);
pixmap.dispose();

View file

@ -3,7 +3,6 @@ package io.github.lonamiwebs.klooni.screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Interpolation;
@ -51,7 +50,7 @@ class PauseMenuStage extends Stage {
// Current and maximum score band.
// Do not add it to the table not to over-complicate things.
band = new Band(game, layout, this.scorer, Color.SKY);
band = new Band(game, layout, this.scorer);
addActor(band);
// Home screen button