Merge branch 'master' into 'master'

Upscaled logo & splashscreen for mobile forge

See merge request core-developers/forge!3555
This commit is contained in:
Anthony Calosa
2021-01-04 01:45:37 +00:00
8 changed files with 46 additions and 4 deletions

View File

@@ -27,7 +27,6 @@ import forge.game.keyword.Keyword;
import forge.game.player.Player;
import forge.game.spellability.SpellAbilityStackInstance;
import forge.game.trigger.TriggerType;
import forge.game.zone.ZoneType;
import forge.util.CardTranslation;
import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView;

View File

@@ -37,6 +37,7 @@ public class FSkin {
private static FileHandle preferredDir;
private static String preferredName;
private static boolean loaded = false;
public static Texture hdLogo = null;
public static void changeSkin(final String skinName) {
final ForgePreferences prefs = FModel.getPreferences();
@@ -124,6 +125,9 @@ public class FSkin {
if (splashScreen != null) {
final FileHandle f = getSkinFile("bg_splash.png");
final FileHandle f2 = getSkinFile("bg_splash_hd.png"); //HD Splashscreen
final FileHandle f3 = getSkinFile("hd_logo.png");
if (!f.exists()) {
if (!skinName.equals("default")) {
FSkin.loadLight("default", splashScreen);
@@ -136,7 +140,21 @@ public class FSkin {
final int w = txSplash.getWidth();
final int h = txSplash.getHeight();
splashScreen.setBackground(new TextureRegion(txSplash, 0, 0, w, h - 100));
if (f2.exists()) {
Texture txSplashHD = new Texture(f2, true);
txSplashHD.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
splashScreen.setBackground(new TextureRegion(txSplashHD));
} else {
splashScreen.setBackground(new TextureRegion(txSplash, 0, 0, w, h - 100));
}
if (f3.exists()) {
Texture txOverlay = new Texture(f3, true);
txOverlay.setFilter(Texture.TextureFilter.MipMapLinearLinear, Texture.TextureFilter.Linear);
hdLogo = txOverlay;
} else {
hdLogo = null;
}
Pixmap pxSplash = new Pixmap(f);
FProgressBar.BACK_COLOR = new Color(pxSplash.getPixel(25, h - 75));

View File

@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.Align;
import forge.FThreads;
import forge.Forge;
import forge.Graphics;
import forge.assets.FSkin;
import forge.assets.FSkinColor;
import forge.assets.FSkinColor.Colors;
import forge.assets.FSkinFont;
@@ -101,7 +102,10 @@ public class LoadingOverlay extends FOverlay {
g.fillRect(BACK_COLOR, x, y, panelWidth, panelHeight);
g.drawRect(Utils.scale(2), FORE_COLOR, x, y, panelWidth, panelHeight);
y += padding;
g.drawImage(FSkinImage.LOGO, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
if (FSkin.hdLogo == null)
g.drawImage(FSkinImage.LOGO, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
else
g.drawImage(FSkin.hdLogo, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
y += logoSize + padding;
g.drawText(caption, FONT, FORE_COLOR, x, y, panelWidth, getHeight(), false, Align.center, false);
}

View File

@@ -6,6 +6,8 @@ import java.util.List;
import com.badlogic.gdx.utils.Align;
import forge.Forge;
import forge.Graphics;
import forge.assets.FImage;
import forge.assets.FSkin;
import forge.assets.FSkinColor;
import forge.assets.FSkinColor.Colors;
import forge.assets.FSkinImage;
@@ -32,7 +34,26 @@ public class HomeScreen extends FScreen {
public static final HomeScreen instance = new HomeScreen();
private final FLabel lblLogo = add(new FLabel.Builder().icon(FSkinImage.LOGO).iconInBackground().iconScaleFactor(1).build());
private final FLabel lblLogo = add(new FLabel.Builder().icon(
new FImage() {
final float size = Forge.getScreenWidth() * 0.6f;
@Override
public float getWidth() {
return size;
}
@Override
public float getHeight() {
return size;
}
@Override
public void draw(Graphics g, float x, float y, float w, float h) {
if (FSkin.hdLogo == null)
FSkinImage.LOGO.draw(g, x, y, w, h);
else
g.drawImage(FSkin.hdLogo, x, y, w, h);
}
}
).iconInBackground().iconScaleFactor(1).build());
private final ButtonScroller buttonScroller = add(new ButtonScroller());
private final List<MenuButton> buttons = new ArrayList<>();
private int activeButtonIndex, baseButtonCount;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB