v0.3.4a: re-added align methods pt.2

Also moved rendered text multiline into the core game
This commit is contained in:
Evan Debenham
2016-02-12 13:46:42 -05:00
committed by Evan Debenham
parent ac9c50f2ac
commit b110c0db8c
49 changed files with 465 additions and 203 deletions
@@ -22,20 +22,19 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import android.content.Intent;
import android.net.Uri;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.input.Touchscreen.Touch;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedText;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.TouchArea;
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
public class AboutScene extends PixelScene {
@@ -65,6 +64,7 @@ public class AboutScene extends PixelScene {
Image shpx = Icons.SHPX.get();
shpx.x = (colWidth - shpx.width()) / 2;
shpx.y = colTop;
align(shpx);
add( shpx );
new Flare( 7, 64 ).color( 0x225511, true ).show( shpx, 0 ).angularSpeed = +20;
@@ -75,12 +75,14 @@ public class AboutScene extends PixelScene {
shpxtitle.x = (colWidth - shpxtitle.width()) / 2;
shpxtitle.y = shpx.y + shpx.height + 5;
align(shpxtitle);
RenderedTextMultiline shpxtext = renderMultiline( TXT_SHPX, 8 );
shpxtext.maxWidth((int)Math.min(colWidth, 120));
add( shpxtext );
shpxtext.setPos((colWidth - shpxtext.width()) / 2, shpxtitle.y + shpxtitle.height() + 12);
align(shpxtext);
RenderedTextMultiline shpxlink = renderMultiline( LNK_SHPX, 8 );
shpxlink.maxWidth(shpxtext.maxWidth());
@@ -88,6 +90,7 @@ public class AboutScene extends PixelScene {
add( shpxlink );
shpxlink.setPos((colWidth - shpxlink.width()) / 2, shpxtext.bottom() + 6);
align(shpxlink);
TouchArea shpxhotArea = new TouchArea( shpxlink.left(), shpxlink.top(), shpxlink.width(), shpxlink.height() ) {
@Override
@@ -103,6 +106,7 @@ public class AboutScene extends PixelScene {
wata.y = ShatteredPixelDungeon.landscape() ?
colTop:
shpxlink.top() + wata.height + 20;
align(wata);
add( wata );
new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
@@ -113,12 +117,14 @@ public class AboutScene extends PixelScene {
wataTitle.x = wataOffset + (colWidth - wataTitle.width()) / 2;
wataTitle.y = wata.y + wata.height + 11;
align(wataTitle);
RenderedTextMultiline wataText = renderMultiline( TXT_WATA, 8 );
wataText.maxWidth((int)Math.min(colWidth, 120));
add( wataText );
wataText.setPos(wataOffset + (colWidth - wataText.width()) / 2, wataTitle.y + wataTitle.height() + 12);
align(wataText);
RenderedTextMultiline wataLink = renderMultiline( LNK_WATA, 8 );
wataLink.maxWidth((int)Math.min(colWidth, 120));
@@ -126,6 +132,7 @@ public class AboutScene extends PixelScene {
add(wataLink);
wataLink.setPos(wataOffset + (colWidth - wataLink.width()) / 2 , wataText.bottom() + 6);
align(wataLink);
TouchArea hotArea = new TouchArea( wataLink.left(), wataLink.top(), wataLink.width(), wataLink.height() ) {
@Override