v0.3.4: switched to rendered text in a bunch of places

This commit is contained in:
Evan Debenham
2016-01-14 01:26:36 -05:00
committed by Evan Debenham
parent 82da647534
commit 8e508ab040
19 changed files with 130 additions and 183 deletions
@@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
@@ -31,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.utils.Random;
public class AmuletScene extends PixelScene {
@@ -48,11 +48,10 @@ public class AmuletScene extends PixelScene {
public void create() {
super.create();
BitmapTextMultiline text = null;
RenderedTextMultiline text = null;
if (!noText) {
text = createMultiline( Messages.get(this, "text"), 8 );
text.maxWidth = WIDTH;
text.measure();
text = renderMultiline( Messages.get(this, "text"), 8 );
text.maxWidth(WIDTH);
add( text );
}
@@ -94,11 +93,10 @@ public class AmuletScene extends PixelScene {
amulet.x = (Camera.main.width - amulet.width) / 2;
amulet.y = (Camera.main.height - height) / 2;
text.setPos((Camera.main.width - text.width()) / 2, amulet.y + amulet.height + LARGE_GAP);
text.x = (Camera.main.width - text.width()) / 2;
text.y = amulet.y + amulet.height + LARGE_GAP;
btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP );
btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
}
@@ -22,10 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedText;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Music;
import com.watabou.noosa.ui.Button;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
@@ -161,7 +161,7 @@ public class RankingsScene extends PixelScene {
protected ItemSprite shield;
private Flare flare;
private BitmapText position;
private BitmapTextMultiline desc;
private RenderedTextMultiline desc;
private Image steps;
private BitmapText depth;
private Image classIcon;
@@ -187,7 +187,7 @@ public class RankingsScene extends PixelScene {
desc.text( rec.info );
desc.measure();
//desc.measure();
int odd = pos % 2;
@@ -235,7 +235,7 @@ public class RankingsScene extends PixelScene {
position.alpha(0.8f);
add( position );
desc = createMultiline( 7 );
desc = renderMultiline( 7 );
add( desc );
depth = new BitmapText( PixelScene.pixelFont);
@@ -277,10 +277,8 @@ public class RankingsScene extends PixelScene {
depth.x = steps.x + (steps.width - depth.width()) / 2;
depth.y = steps.y + (steps.height - depth.height()) / 2 + 1;
desc.x = shield.x + shield.width + GAP;
desc.maxWidth = (int)(steps.x - desc.x);
desc.measure();
desc.y = shield.y + (shield.height - desc.height()) / 2 + 1;
desc.setPos(shield.x + shield.width + GAP, shield.y + (shield.height - desc.height()) / 2 + 1);
desc.maxWidth((int)(steps.x - desc.left()));
}
@Override
@@ -23,13 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import java.util.HashMap;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.Group;
import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedText;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.BitmaskEmitter;
import com.watabou.noosa.particles.Emitter;
@@ -198,20 +197,12 @@ public class StartScene extends PixelScene {
if (!(huntressUnlocked = Badges.isUnlocked( Badges.Badge.BOSS_SLAIN_3 ))) {
BitmapTextMultiline text = PixelScene.createMultiline( Messages.get(this, "unlock"), 9 );
text.maxWidth = (int)width;
text.measure();
RenderedTextMultiline text = PixelScene.renderMultiline( Messages.get(this, "unlock"), 9 );
text.maxWidth((int)width);
text.hardlight( 0xFFFF00 );
text.setPos(w / 2 - text.width() / 2, (bottom - BUTTON_HEIGHT) + (BUTTON_HEIGHT - text.height()) / 2);
unlock.add(text);
float pos = (bottom - BUTTON_HEIGHT) + (BUTTON_HEIGHT - text.height()) / 2;
for (BitmapText line : text.new LineSplitter().split()) {
line.measure();
line.hardlight( 0xFFFF00 );
line.x = w / 2 - line.width() / 2;
line.y = pos;
unlock.add( line );
pos += line.height();
}
}
ExitButton btnExit = new ExitButton();