v0.2.4: updated about scene to work with new landscape mode
This commit is contained in:
parent
29755158c0
commit
567be8dfbf
|
@ -33,7 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
|
|
||||||
//FIXME: fix in landscape mode
|
|
||||||
public class AboutScene extends PixelScene {
|
public class AboutScene extends PixelScene {
|
||||||
|
|
||||||
private static final String TTL_SHPX = "Shattered Pixel Dungeon";
|
private static final String TTL_SHPX = "Shattered Pixel Dungeon";
|
||||||
|
@ -58,32 +57,36 @@ public class AboutScene extends PixelScene {
|
||||||
public void create() {
|
public void create() {
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
|
final float colWidth = Camera.main.width / (ShatteredPixelDungeon.landscape() ? 2 : 1);
|
||||||
|
final float colTop = (Camera.main.height / 2) - (ShatteredPixelDungeon.landscape() ? 30 : 90);
|
||||||
|
final float wataOffset = ShatteredPixelDungeon.landscape() ? colWidth : 0;
|
||||||
|
|
||||||
Image shpx = Icons.SHPX.get();
|
Image shpx = Icons.SHPX.get();
|
||||||
shpx.x = align( (Camera.main.width - shpx.width()) / 2 );
|
shpx.x = align( (colWidth - shpx.width()) / 2 );
|
||||||
shpx.y = align( 30 );
|
shpx.y = align( colTop );
|
||||||
add( shpx );
|
add( shpx );
|
||||||
|
|
||||||
new Flare( 7, 64 ).color( 0x225511, true ).show( shpx, 0 ).angularSpeed = +20;
|
new Flare( 7, 64 ).color( 0x225511, true ).show( shpx, 0 ).angularSpeed = +20;
|
||||||
|
|
||||||
BitmapTextMultiline shpxtitle = createMultiline( TTL_SHPX, 8 );
|
BitmapTextMultiline shpxtitle = createMultiline( TTL_SHPX, 8 );
|
||||||
shpxtitle.maxWidth = Math.min( Camera.main.width, 120 );
|
shpxtitle.maxWidth = (int) Math.min( colWidth, 120 );
|
||||||
shpxtitle.measure();
|
shpxtitle.measure();
|
||||||
shpxtitle.hardlight( Window.SHPX_COLOR );
|
shpxtitle.hardlight( Window.SHPX_COLOR );
|
||||||
add( shpxtitle );
|
add( shpxtitle );
|
||||||
|
|
||||||
shpxtitle.x = align( (Camera.main.width - shpxtitle.width()) / 2 );
|
shpxtitle.x = align( (colWidth - shpxtitle.width()) / 2 );
|
||||||
shpxtitle.y = align( shpx.y + shpx.height + 5 );
|
shpxtitle.y = align( shpx.y + shpx.height + 5 );
|
||||||
|
|
||||||
BitmapTextMultiline shpxtext = createMultiline( TXT_SHPX, 8 );
|
BitmapTextMultiline shpxtext = createMultiline( TXT_SHPX, 8 );
|
||||||
shpxtext.maxWidth = Math.min( Camera.main.width, 120 );
|
shpxtext.maxWidth = shpxtitle.maxWidth;
|
||||||
shpxtext.measure();
|
shpxtext.measure();
|
||||||
add( shpxtext );
|
add( shpxtext );
|
||||||
|
|
||||||
shpxtext.x = align( (Camera.main.width - shpxtext.width()) / 2 );
|
shpxtext.x = align( (colWidth - shpxtext.width()) / 2 );
|
||||||
shpxtext.y = align( shpxtitle.y + shpxtitle.height() + 12 );
|
shpxtext.y = align( shpxtitle.y + shpxtitle.height() + 12 );
|
||||||
|
|
||||||
BitmapTextMultiline shpxlink = createMultiline( LNK_SHPX, 8 );
|
BitmapTextMultiline shpxlink = createMultiline( LNK_SHPX, 8 );
|
||||||
shpxlink.maxWidth = Math.min( Camera.main.width, 120 );
|
shpxlink.maxWidth = shpxtitle.maxWidth;
|
||||||
shpxlink.measure();
|
shpxlink.measure();
|
||||||
shpxlink.hardlight( Window.SHPX_COLOR );
|
shpxlink.hardlight( Window.SHPX_COLOR );
|
||||||
add( shpxlink );
|
add( shpxlink );
|
||||||
|
@ -101,39 +104,41 @@ public class AboutScene extends PixelScene {
|
||||||
add( shpxhotArea );
|
add( shpxhotArea );
|
||||||
|
|
||||||
Image wata = Icons.WATA.get();
|
Image wata = Icons.WATA.get();
|
||||||
wata.x = align( (Camera.main.width - wata.width()) / 2 );
|
wata.x = align( wataOffset + (colWidth - wata.width()) / 2 );
|
||||||
wata.y = shpxlink.y + wata.height + 25;
|
wata.y = align( ShatteredPixelDungeon.landscape() ?
|
||||||
|
colTop:
|
||||||
|
shpxlink.y + wata.height + 20);
|
||||||
add( wata );
|
add( wata );
|
||||||
|
|
||||||
new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
|
new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
|
||||||
|
|
||||||
BitmapTextMultiline title = createMultiline( TTL_WATA, 8 );
|
BitmapTextMultiline wataTitle = createMultiline( TTL_WATA, 8 );
|
||||||
title.maxWidth = Math.min( Camera.main.width, 120 );
|
wataTitle.maxWidth = (int) Math.min( colWidth, 120 );
|
||||||
title.measure();
|
wataTitle.measure();
|
||||||
title.hardlight( Window.TITLE_COLOR );
|
wataTitle.hardlight(Window.TITLE_COLOR);
|
||||||
add( title );
|
add( wataTitle );
|
||||||
|
|
||||||
title.x = align( (Camera.main.width - title.width()) / 2 );
|
wataTitle.x = align( wataOffset + (colWidth - wataTitle.width()) / 2 );
|
||||||
title.y = align( wata.y + wata.height + 5 );
|
wataTitle.y = align( wata.y + wata.height + 11 );
|
||||||
|
|
||||||
BitmapTextMultiline text = createMultiline( TXT_WATA, 8 );
|
BitmapTextMultiline wataText = createMultiline( TXT_WATA, 8 );
|
||||||
text.maxWidth = Math.min( Camera.main.width, 120 );
|
wataText.maxWidth = wataTitle.maxWidth;
|
||||||
text.measure();
|
wataText.measure();
|
||||||
add( text );
|
add( wataText );
|
||||||
|
|
||||||
text.x = align( (Camera.main.width - text.width()) / 2 );
|
wataText.x = align( wataOffset + (colWidth - wataText.width()) / 2 );
|
||||||
text.y = align( title.y + title.height() + 12 );
|
wataText.y = align( wataTitle.y + wataTitle.height() + 12 );
|
||||||
|
|
||||||
BitmapTextMultiline link = createMultiline( LNK_WATA, 8 );
|
BitmapTextMultiline wataLink = createMultiline( LNK_WATA, 8 );
|
||||||
link.maxWidth = Math.min( Camera.main.width, 120 );
|
wataLink.maxWidth = wataTitle.maxWidth;
|
||||||
link.measure();
|
wataLink.measure();
|
||||||
link.hardlight( Window.TITLE_COLOR );
|
wataLink.hardlight(Window.TITLE_COLOR);
|
||||||
add( link );
|
add(wataLink);
|
||||||
|
|
||||||
link.x = text.x;
|
wataLink.x = wataText.x;
|
||||||
link.y = text.y + text.height();
|
wataLink.y = wataText.y + wataText.height();
|
||||||
|
|
||||||
TouchArea hotArea = new TouchArea( link ) {
|
TouchArea hotArea = new TouchArea( wataLink ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick( Touch touch ) {
|
protected void onClick( Touch touch ) {
|
||||||
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK_WATA ) );
|
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK_WATA ) );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user