v1.3.2: improved the amulet scene's visuals
This commit is contained in:
+15
-6
@@ -22,6 +22,7 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||||
@@ -29,9 +30,15 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
|
import com.watabou.noosa.ColorBlock;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.tweeners.Delayer;
|
import com.watabou.noosa.tweeners.Delayer;
|
||||||
@@ -40,7 +47,7 @@ import com.watabou.utils.Random;
|
|||||||
public class AmuletScene extends PixelScene {
|
public class AmuletScene extends PixelScene {
|
||||||
|
|
||||||
private static final int WIDTH = 120;
|
private static final int WIDTH = 120;
|
||||||
private static final int BTN_HEIGHT = 18;
|
private static final int BTN_HEIGHT = 20;
|
||||||
private static final float SMALL_GAP = 2;
|
private static final float SMALL_GAP = 2;
|
||||||
private static final float LARGE_GAP = 8;
|
private static final float LARGE_GAP = 8;
|
||||||
|
|
||||||
@@ -52,8 +59,8 @@ public class AmuletScene extends PixelScene {
|
|||||||
inGameScene = true;
|
inGameScene = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RedButton btnExit = null;
|
StyledButton btnExit = null;
|
||||||
RedButton btnStay = null;
|
StyledButton btnStay = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
@@ -62,14 +69,14 @@ public class AmuletScene extends PixelScene {
|
|||||||
RenderedTextBlock text = null;
|
RenderedTextBlock text = null;
|
||||||
if (!noText) {
|
if (!noText) {
|
||||||
text = renderTextBlock( Messages.get(this, "text"), 8 );
|
text = renderTextBlock( Messages.get(this, "text"), 8 );
|
||||||
text.maxWidth(WIDTH);
|
text.maxWidth( PixelScene.landscape() ? 2*WIDTH-4 : WIDTH);
|
||||||
add( text );
|
add( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
amulet = new Image( Assets.Sprites.AMULET );
|
amulet = new Image( Assets.Sprites.AMULET );
|
||||||
add( amulet );
|
add( amulet );
|
||||||
|
|
||||||
btnExit = new RedButton( Messages.get(this, "exit") ) {
|
btnExit = new StyledButton(Chrome.Type.GREY_BUTTON_TR, Messages.get(this, "exit") ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
Dungeon.win( Amulet.class );
|
Dungeon.win( Amulet.class );
|
||||||
@@ -94,10 +101,11 @@ public class AmuletScene extends PixelScene {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
btnExit.icon(new ItemSprite(ItemSpriteSheet.AMULET));
|
||||||
btnExit.setSize( WIDTH, BTN_HEIGHT );
|
btnExit.setSize( WIDTH, BTN_HEIGHT );
|
||||||
add( btnExit );
|
add( btnExit );
|
||||||
|
|
||||||
btnStay = new RedButton( Messages.get(this, "stay") ) {
|
btnStay = new StyledButton(Chrome.Type.GREY_BUTTON_TR, Messages.get(this, "stay") ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -105,6 +113,7 @@ public class AmuletScene extends PixelScene {
|
|||||||
btnStay.enable(false);
|
btnStay.enable(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
btnStay.icon(Icons.CLOSE.get());
|
||||||
btnStay.setSize( WIDTH, BTN_HEIGHT );
|
btnStay.setSize( WIDTH, BTN_HEIGHT );
|
||||||
add( btnStay );
|
add( btnStay );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user