Refactored modal color names

Refactored modal colors to say what transparency they are
Added modal background to EscapePanel
This commit is contained in:
Collin Smith 2019-02-16 14:19:03 -08:00
parent 3829c34c24
commit 2ba6542728
4 changed files with 30 additions and 19 deletions

View File

@ -18,21 +18,21 @@ public class Colors {
public static final Color PURPLE = new Color(0xAE00FFFF); // 11 #AE00FF
public static final Color C12 = new Color(0x00C800FF); // 12 #00C800
public Color white = WHITE.cpy();
public Color server = SERVER.cpy();
public Color set = SET.cpy();
public Color magic = MAGIC.cpy();
public Color unique = UNIQUE.cpy();
public Color grey = GREY.cpy();
public Color black = BLACK.cpy();
public Color c7 = C7.cpy();
public Color craft = CRAFT.cpy();
public Color rare = RARE.cpy();
public Color c10 = C10.cpy();
public Color purple = PURPLE.cpy();
public Color c12 = C12.cpy();
public Color modal = black.cpy().sub(0, 0, 0, 0.5f);
public Color modal2 = black.cpy().sub(0, 0, 0, 0.25f);
public Color white = WHITE.cpy();
public Color server = SERVER.cpy();
public Color set = SET.cpy();
public Color magic = MAGIC.cpy();
public Color unique = UNIQUE.cpy();
public Color grey = GREY.cpy();
public Color black = BLACK.cpy();
public Color c7 = C7.cpy();
public Color craft = CRAFT.cpy();
public Color rare = RARE.cpy();
public Color c10 = C10.cpy();
public Color purple = PURPLE.cpy();
public Color c12 = C12.cpy();
public Color modal50 = new Color(0, 0, 0, 0.50f);
public Color modal75 = new Color(0, 0, 0, 0.75f);
public Colors() {}

View File

@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Align;
import org.apache.commons.lang3.StringUtils;
@ -43,7 +44,7 @@ public class Monster extends Entity {
}
label = new Label(monstats.NameStr, Diablo.fonts.font16);
label.getStyle().background = new PaletteIndexedColorDrawable(Diablo.colors.modal2) {{
label.getStyle().background = new PaletteIndexedColorDrawable(Diablo.colors.modal75) {{
final float padding = 3;
setLeftWidth(padding);
setTopHeight(padding);
@ -113,10 +114,16 @@ public class Monster extends Entity {
//BitmapFont font = Diablo.fonts.font16;
//GlyphLayout glyphs = new GlyphLayout(font, "Test", font.getColor(), 0, Align.center, false);
//batch.setBlendMode(BlendMode.SOLID, Diablo.colors.modal);
//batch.setBlendMode(BlendMode.SOLID, Diablo.colors.modal50);
//batch.draw(Diablo.textures.white, x - glyphs.width / 2, y + animation.getMinHeight(), glyphs.width, glyphs.height);
//batch.resetBlendMode();
//font.draw(batch, glyphs, x, y + animation.getMinHeight() + font.getLineHeight());
}
@Override
public boolean contains(Vector3 coords) {
if (!monstats2.isSel) return false;
return super.contains(coords);
}
}

View File

@ -18,6 +18,7 @@ import com.badlogic.gdx.utils.Disposable;
import gdx.diablo.Diablo;
import gdx.diablo.codec.Animation;
import gdx.diablo.codec.DC6;
import gdx.diablo.graphics.PaletteIndexedColorDrawable;
import gdx.diablo.loader.DC6Loader;
import gdx.diablo.screen.MenuScreen;
@ -109,12 +110,13 @@ public class EscapePanel extends WidgetGroup implements Disposable {
table.add(focusActor[5]).row();
table.setFillParent(true);
table.setBackground(new PaletteIndexedColorDrawable(Diablo.colors.modal50));
addActor(table);
setFillParent(true);
setVisible(false);
setTouchable(Touchable.childrenOnly);
//setDebug(true, true);
setDebug(true, true);
}
@Override

View File

@ -121,7 +121,7 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
input = new TextArea("", new TextArea.TextFieldStyle() {{
this.font = Diablo.fonts.fontformal12;
this.fontColor = Diablo.colors.white;
this.background = new PaletteIndexedColorDrawable(Diablo.colors.modal);
this.background = new PaletteIndexedColorDrawable(Diablo.colors.modal50);
this.cursor = new TextureRegionDrawable(Diablo.textures.white);
float padding = 4;
@ -380,6 +380,8 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
PaletteIndexedBatch b = Diablo.batch;
b.setPalette(Diablo.palettes.act1);
mapRenderer.hit();
b.setProjectionMatrix(camera.combined);
b.begin();
//map.draw(b, 0, 0, 30, 13, Diablo.VIRTUAL_WIDTH, Diablo.VIRTUAL_HEIGHT, 1.5f);