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

@ -16,7 +16,8 @@
"d9294dff", "ac342bff"
],
"current_score": "c83737ff",
"high_score": "d400aaff"
"high_score": "d400aaff",
"band": "2b5ccfff"
},
"cell_texture": "basic.png"
}

View file

@ -16,7 +16,8 @@
"57cb84ff", "5abee2ff"
],
"current_score": "ffcc00ff",
"high_score": "65d681ff"
"high_score": "65d681ff",
"band": "87ceebff"
},
"cell_texture": "basic.png"
}

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

View file

@ -26,7 +26,8 @@ template = '''{{
"{cell_7}", "{cell_8}"
],
"current_score": "{current_score}",
"high_score": "{high_score}"
"high_score": "{high_score}",
"band": "{band}"
}},
"cell_texture": "{cell_tex}"
}}

View file

@ -25,9 +25,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497474"
inkscape:cx="517.48669"
inkscape:cy="678.08613"
inkscape:zoom="0.69999999"
inkscape:cx="335.14124"
inkscape:cy="488.33979"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@ -268,5 +268,17 @@
id="path4233"
inkscape:connector-curvature="0" />
</g>
<g
id="export_band"
style="fill:#87ceeb;fill-opacity:1">
<rect
ry="4.1303067"
y="572.36218"
x="0"
height="80"
width="400"
id="rect4174"
style="opacity:1;fill:#87ceeb;fill-opacity:1;stroke:none;stroke-width:25;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB