Merging 1.7.5 Source: scenes changes
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
import android.opengl.GLES20;
|
||||
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
@@ -63,20 +67,39 @@ public class TitleScene extends PixelScene {
|
||||
int w = Camera.main.width;
|
||||
int h = Camera.main.height;
|
||||
|
||||
float height = 180;
|
||||
|
||||
Archs archs = new Archs();
|
||||
archs.setSize( w, h );
|
||||
add( archs );
|
||||
|
||||
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
|
||||
add( title );
|
||||
|
||||
|
||||
float height = title.height +
|
||||
(ShatteredPixelDungeon.landscape() ? DashboardItem.SIZE : DashboardItem.SIZE * 2);
|
||||
|
||||
title.x = (w - title.width()) / 2;
|
||||
title.y = (h - height) / 2;
|
||||
|
||||
placeTorch( title.x + 18, title.y + 20 );
|
||||
placeTorch( title.x + title.width - 18, title.y + 20 );
|
||||
|
||||
Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) {
|
||||
private float time = 0;
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
am = (float)Math.sin( -(time += Game.elapsed) );
|
||||
}
|
||||
@Override
|
||||
public void draw() {
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE );
|
||||
super.draw();
|
||||
GLES20.glBlendFunc( GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
};
|
||||
signs.x = title.x;
|
||||
signs.y = title.y;
|
||||
add( signs );
|
||||
|
||||
DashboardItem btnBadges = new DashboardItem( TXT_BADGES, 3 ) {
|
||||
@Override
|
||||
@@ -84,7 +107,6 @@ public class TitleScene extends PixelScene {
|
||||
ShatteredPixelDungeon.switchNoFade( BadgesScene.class );
|
||||
}
|
||||
};
|
||||
btnBadges.setPos( w / 2 - btnBadges.width(), (h + height) / 2 - DashboardItem.SIZE );
|
||||
add( btnBadges );
|
||||
|
||||
DashboardItem btnAbout = new DashboardItem( TXT_ABOUT, 1 ) {
|
||||
@@ -93,7 +115,6 @@ public class TitleScene extends PixelScene {
|
||||
ShatteredPixelDungeon.switchNoFade( AboutScene.class );
|
||||
}
|
||||
};
|
||||
btnAbout.setPos( w / 2, (h + height) / 2 - DashboardItem.SIZE );
|
||||
add( btnAbout );
|
||||
|
||||
DashboardItem btnPlay = new DashboardItem( TXT_PLAY, 0 ) {
|
||||
@@ -102,7 +123,6 @@ public class TitleScene extends PixelScene {
|
||||
ShatteredPixelDungeon.switchNoFade( StartScene.class );
|
||||
}
|
||||
};
|
||||
btnPlay.setPos( w / 2 - btnPlay.width(), btnAbout.top() - DashboardItem.SIZE );
|
||||
add( btnPlay );
|
||||
|
||||
DashboardItem btnHighscores = new DashboardItem( TXT_HIGHSCORES, 2 ) {
|
||||
@@ -111,10 +131,22 @@ public class TitleScene extends PixelScene {
|
||||
ShatteredPixelDungeon.switchNoFade( RankingsScene.class );
|
||||
}
|
||||
};
|
||||
btnHighscores.setPos( w / 2, btnPlay.top() );
|
||||
add( btnHighscores );
|
||||
|
||||
BitmapText source = new BitmapText( "PD source v 1.7.2a", font1x );
|
||||
if (ShatteredPixelDungeon.landscape()) {
|
||||
float y = (h + height) / 2 - DashboardItem.SIZE;
|
||||
btnHighscores .setPos( w / 2 - btnHighscores.width(), y );
|
||||
btnBadges .setPos( w / 2, y );
|
||||
btnPlay .setPos( btnHighscores.left() - btnPlay.width(), y );
|
||||
btnAbout .setPos( btnBadges.right(), y );
|
||||
} else {
|
||||
btnBadges.setPos( w / 2 - btnBadges.width(), (h + height) / 2 - DashboardItem.SIZE );
|
||||
btnAbout.setPos( w / 2, (h + height) / 2 - DashboardItem.SIZE );
|
||||
btnPlay.setPos( w / 2 - btnPlay.width(), btnAbout.top() - DashboardItem.SIZE );
|
||||
btnHighscores.setPos( w / 2, btnPlay.top() );
|
||||
}
|
||||
|
||||
BitmapText source = new BitmapText( "PD source v 1.7.5a", font1x );
|
||||
source.measure();
|
||||
source.hardlight( 0x444444 );
|
||||
source.x = w - source.width();
|
||||
|
||||
Reference in New Issue
Block a user