v0.8.1: replaced the border on hero splash arts with a fade

This commit is contained in:
Evan Debenham 2020-06-13 14:47:12 -04:00
parent 225c194de8
commit 389cad9b45
2 changed files with 14 additions and 10 deletions

Binary file not shown.

View File

@ -45,11 +45,11 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndChallenges;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage; import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStartGame; import com.shatteredpixel.shatteredpixeldungeon.windows.WndStartGame;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndTabbed; import com.shatteredpixel.shatteredpixeldungeon.windows.WndTabbed;
import com.watabou.gltextures.TextureCache;
import com.watabou.input.PointerEvent; import com.watabou.input.PointerEvent;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.PointerArea; import com.watabou.noosa.PointerArea;
import com.watabou.utils.DeviceCompat; import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath; import com.watabou.utils.GameMath;
@ -59,7 +59,6 @@ import java.util.ArrayList;
public class HeroSelectScene extends PixelScene { public class HeroSelectScene extends PixelScene {
private Image background; private Image background;
private NinePatch border;
private RenderedTextBlock prompt; private RenderedTextBlock prompt;
//fading UI elements //fading UI elements
@ -93,15 +92,21 @@ public class HeroSelectScene extends PixelScene {
background.y = (Camera.main.height - background.height())/2f; background.y = (Camera.main.height - background.height())/2f;
background.visible = false; background.visible = false;
PixelScene.align(background); PixelScene.align(background);
border = Chrome.get(Chrome.Type.WINDOW_SILVER);
border.size(background.width()+border.marginHor()-4, background.height()+border.marginVer()-4);
border.x = background.x - border.marginLeft()+2;
border.y = background.y - border.marginTop()+2;
border.visible = false;
add(border);
add(background); add(background);
if (background.x > 0){
Image fadeLeft = new Image(TextureCache.createGradient(0xFF000000, 0x00000000));
fadeLeft.x = background.x-2;
fadeLeft.scale.set(4, background.height());
add(fadeLeft);
Image fadeRight = new Image(fadeLeft);
fadeRight.x = background.x + background.width() + 2;
fadeRight.y = background.y + background.height();
fadeRight.angle = 180;
add(fadeRight);
}
prompt = PixelScene.renderTextBlock(Messages.get(WndStartGame.class, "title"), 12); prompt = PixelScene.renderTextBlock(Messages.get(WndStartGame.class, "title"), 12);
prompt.hardlight(Window.TITLE_COLOR); prompt.hardlight(Window.TITLE_COLOR);
prompt.setPos( (Camera.main.width - prompt.width())/2f, (Camera.main.height - HeroBtn.HEIGHT - prompt.height() - 4)); prompt.setPos( (Camera.main.width - prompt.width())/2f, (Camera.main.height - HeroBtn.HEIGHT - prompt.height() - 4));
@ -220,7 +225,6 @@ public class HeroSelectScene extends PixelScene {
background.texture( cl.splashArt() ); background.texture( cl.splashArt() );
background.visible = true; background.visible = true;
background.hardlight(1.5f,1.5f,1.5f); background.hardlight(1.5f,1.5f,1.5f);
border.visible = true;
prompt.visible = false; prompt.visible = false;
startBtn.visible = true; startBtn.visible = true;