Skip to content

Commit

Permalink
add semi-transparent background to info label
Browse files Browse the repository at this point in the history
resolves #15
  • Loading branch information
Sesu8642 committed Jan 6, 2025
1 parent 62f994d commit d79e7e2
Show file tree
Hide file tree
Showing 7 changed files with 1,135 additions and 1,056 deletions.
7 changes: 7 additions & 0 deletions assets/skin/pixthulhu-ui.atlas
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ white
orig: 1, 1
offset: 0, 0
index: -1
white-pixel
rotate: false
xy: 491, 834
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
window
rotate: false
xy: 278, 541
Expand Down
14 changes: 14 additions & 0 deletions assets/skin/pixthulhu-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ com.badlogic.gdx.graphics.Color: {
b: 0
a: 1
}
black_semi_transparent: {
r: 0
g: 0
b: 0
a: 0.44662955
}
blue: {
r: 0
g: 0
Expand Down Expand Up @@ -226,6 +232,10 @@ com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
a: 1
}
}
black_semi_transparent: {
name: white-pixel
color: black_semi_transparent
}
}
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: {
Expand Down Expand Up @@ -356,6 +366,10 @@ com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
bestagon: {
font: bestagon
}
overlay_w_bg: {
font: Overlay
background: black_semi_transparent
}
}
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
default: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void initUi() {
Image thumbImage = new Image(thumbSprite);
thumbImage.setColor(skin.getColor(SkinConstants.COLOR_HIGHLIGHT2));

infoTextLabel = new Label("", skin.get(SkinConstants.FONT_OVERLAY, LabelStyle.class));
infoTextLabel = new Label("", skin.get(SkinConstants.FONT_OVERLAY_WITH_BACKGROUND, LabelStyle.class));

rootTable = new Table();
rootTable.setFillParent(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void initUi() {

infoHexagonLabel = new Label("", skin.get(SkinConstants.FONT_HEXAGON, LabelStyle.class));

infoTextLabel = new Label("", skin.get(SkinConstants.FONT_OVERLAY, LabelStyle.class));
infoTextLabel = new Label("", skin.get(SkinConstants.FONT_OVERLAY_WITH_BACKGROUND, LabelStyle.class));

rootTable = new Table();
rootTable.setFillParent(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public final class SkinConstants {

public static final String FONT_HEADLINE = "headline";
public static final String FONT_OVERLAY = "overlay";
public static final String FONT_OVERLAY_WITH_BACKGROUND = "overlay_w_bg";
public static final String FONT_HEXAGON = "bestagon";
public static final String COLOR_HIGHLIGHT2 = "highlight2";
public static final String COLOR_DISABLED = "disabled";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.google.common.collect.ImmutableList;
import com.google.common.eventbus.EventBus;
import de.sesu8642.feudaltactics.dagger.VersionProperty;
import de.sesu8642.feudaltactics.menu.common.dagger.MenuBackgroundCamera;
import de.sesu8642.feudaltactics.menu.common.dagger.MenuBackgroundRenderer;
Expand All @@ -34,8 +33,9 @@ public class InformationMenuPage2Stage extends MenuStage {
* Constructor. See {@link MenuStage#MenuStage}
*/
@Inject
public InformationMenuPage2Stage(EventBus eventBus, @MenuViewport Viewport viewport,
@MenuBackgroundCamera OrthographicCamera camera, @MenuBackgroundRenderer MapRenderer mapRenderer, Skin skin,
public InformationMenuPage2Stage(@MenuViewport Viewport viewport,
@MenuBackgroundCamera OrthographicCamera camera,
@MenuBackgroundRenderer MapRenderer mapRenderer, Skin skin,
@VersionProperty String gameVersion) {
super(viewport, BUTTON_TEXTS, camera, mapRenderer, skin);
Label bottomRightLabel = new Label(String.format("Version %s", gameVersion),
Expand Down
Loading

0 comments on commit d79e7e2

Please sign in to comment.