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

View File

@ -30,10 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle; import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import java.util.ArrayList; import java.util.ArrayList;
@ -130,14 +129,12 @@ public class Weightstone extends Item {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline tfMesage = PixelScene.createMultiline( Messages.get(this, "choice"), 8 ); RenderedTextMultiline tfMesage = PixelScene.renderMultiline( Messages.get(this, "choice"), 8 );
tfMesage.maxWidth = WIDTH - MARGIN * 2; tfMesage.maxWidth(WIDTH - MARGIN * 2);
tfMesage.measure(); tfMesage.setPos(MARGIN, titlebar.bottom() + MARGIN);
tfMesage.x = MARGIN;
tfMesage.y = titlebar.bottom() + MARGIN;
add( tfMesage ); add( tfMesage );
float pos = tfMesage.y + tfMesage.height(); float pos = tfMesage.top() + tfMesage.height();
if (weapon.imbue != Weapon.Imbue.LIGHT) { if (weapon.imbue != Weapon.Imbue.LIGHT) {
RedButton btnSpeed = new RedButton( Messages.get(this, "light") ) { RedButton btnSpeed = new RedButton( Messages.get(this, "light") ) {

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.scenes; package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.Image; 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.Flare;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.utils.Random; import com.watabou.utils.Random;
public class AmuletScene extends PixelScene { public class AmuletScene extends PixelScene {
@ -48,11 +48,10 @@ public class AmuletScene extends PixelScene {
public void create() { public void create() {
super.create(); super.create();
BitmapTextMultiline text = null; RenderedTextMultiline text = null;
if (!noText) { if (!noText) {
text = createMultiline( Messages.get(this, "text"), 8 ); text = renderMultiline( Messages.get(this, "text"), 8 );
text.maxWidth = WIDTH; text.maxWidth(WIDTH);
text.measure();
add( text ); add( text );
} }
@ -94,11 +93,10 @@ public class AmuletScene extends PixelScene {
amulet.x = (Camera.main.width - amulet.width) / 2; amulet.x = (Camera.main.width - amulet.width) / 2;
amulet.y = (Camera.main.height - height) / 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; btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP );
text.y = amulet.y + amulet.height + LARGE_GAP;
btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
} }

View File

@ -22,10 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapText; import com.watabou.noosa.BitmapText;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedText; import com.watabou.noosa.RenderedText;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Music; import com.watabou.noosa.audio.Music;
import com.watabou.noosa.ui.Button; import com.watabou.noosa.ui.Button;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
@ -161,7 +161,7 @@ public class RankingsScene extends PixelScene {
protected ItemSprite shield; protected ItemSprite shield;
private Flare flare; private Flare flare;
private BitmapText position; private BitmapText position;
private BitmapTextMultiline desc; private RenderedTextMultiline desc;
private Image steps; private Image steps;
private BitmapText depth; private BitmapText depth;
private Image classIcon; private Image classIcon;
@ -187,7 +187,7 @@ public class RankingsScene extends PixelScene {
desc.text( rec.info ); desc.text( rec.info );
desc.measure(); //desc.measure();
int odd = pos % 2; int odd = pos % 2;
@ -235,7 +235,7 @@ public class RankingsScene extends PixelScene {
position.alpha(0.8f); position.alpha(0.8f);
add( position ); add( position );
desc = createMultiline( 7 ); desc = renderMultiline( 7 );
add( desc ); add( desc );
depth = new BitmapText( PixelScene.pixelFont); depth = new BitmapText( PixelScene.pixelFont);
@ -277,10 +277,8 @@ public class RankingsScene extends PixelScene {
depth.x = steps.x + (steps.width - depth.width()) / 2; depth.x = steps.x + (steps.width - depth.width()) / 2;
depth.y = steps.y + (steps.height - depth.height()) / 2 + 1; depth.y = steps.y + (steps.height - depth.height()) / 2 + 1;
desc.x = shield.x + shield.width + GAP; desc.setPos(shield.x + shield.width + GAP, shield.y + (shield.height - desc.height()) / 2 + 1);
desc.maxWidth = (int)(steps.x - desc.x); desc.maxWidth((int)(steps.x - desc.left()));
desc.measure();
desc.y = shield.y + (shield.height - desc.height()) / 2 + 1;
} }
@Override @Override

View File

@ -23,13 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import java.util.HashMap; import java.util.HashMap;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; 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.Camera;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.Group; import com.watabou.noosa.Group;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedText; import com.watabou.noosa.RenderedText;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.BitmaskEmitter; import com.watabou.noosa.particles.BitmaskEmitter;
import com.watabou.noosa.particles.Emitter; import com.watabou.noosa.particles.Emitter;
@ -198,20 +197,12 @@ public class StartScene extends PixelScene {
if (!(huntressUnlocked = Badges.isUnlocked( Badges.Badge.BOSS_SLAIN_3 ))) { if (!(huntressUnlocked = Badges.isUnlocked( Badges.Badge.BOSS_SLAIN_3 ))) {
BitmapTextMultiline text = PixelScene.createMultiline( Messages.get(this, "unlock"), 9 ); RenderedTextMultiline text = PixelScene.renderMultiline( Messages.get(this, "unlock"), 9 );
text.maxWidth = (int)width; text.maxWidth((int)width);
text.measure(); 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(); ExitButton btnExit = new ExitButton();

View File

@ -20,8 +20,8 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.ui.Component; import com.watabou.noosa.ui.Component;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
@ -37,7 +37,7 @@ public class IconTitle extends Component {
private static final float GAP = 2; private static final float GAP = 2;
protected Image imIcon; protected Image imIcon;
protected BitmapTextMultiline tfLabel; protected RenderedTextMultiline tfLabel;
protected HealthBar health; protected HealthBar health;
private float healthLvl = Float.NaN; private float healthLvl = Float.NaN;
@ -65,7 +65,7 @@ public class IconTitle extends Component {
imIcon = new Image(); imIcon = new Image();
add( imIcon ); add( imIcon );
tfLabel = PixelScene.createMultiline( FONT_SIZE ); tfLabel = PixelScene.renderMultiline( (int)FONT_SIZE );
tfLabel.hardlight( Window.TITLE_COLOR ); tfLabel.hardlight( Window.TITLE_COLOR );
add( tfLabel ); add( tfLabel );
@ -81,15 +81,13 @@ public class IconTitle extends Component {
imIcon.x = x; imIcon.x = x;
imIcon.y = y; imIcon.y = y;
tfLabel.x = imIcon.x + imIcon.width() + GAP; tfLabel.setPos(imIcon.x + imIcon.width() + GAP, imIcon.height > tfLabel.height() ?
tfLabel.maxWidth = (int)(width - tfLabel.x); imIcon.y + (imIcon.height() - tfLabel.height()) / 2 :
tfLabel.measure(); imIcon.y);
tfLabel.y = imIcon.height > tfLabel.height() ? tfLabel.maxWidth((int)(width - tfLabel.left()));
imIcon.y + (imIcon.height() - tfLabel.baseLine()) / 2 :
imIcon.y;
if (health.visible) { if (health.visible) {
health.setRect( tfLabel.x, Math.max( tfLabel.y + tfLabel.height(), imIcon.y + imIcon.height() - health.height() ), tfLabel.maxWidth, 0 ); health.setRect( tfLabel.left(), Math.max( tfLabel.top() + tfLabel.height(), imIcon.y + imIcon.height() - health.height() ), tfLabel.maxWidth(), 0 );
height = health.bottom(); height = health.bottom();
} else { } else {
height = Math.max( imIcon.height(), tfLabel.height() ); height = Math.max( imIcon.height(), tfLabel.height() );

View File

@ -20,13 +20,12 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner; import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.RenderedTextMultiline;
public class WndBadge extends Window { public class WndBadge extends Window {
@ -40,27 +39,19 @@ public class WndBadge extends Window {
Image icon = BadgeBanner.image( badge.image ); Image icon = BadgeBanner.image( badge.image );
icon.scale.set( 2 ); icon.scale.set( 2 );
add( icon ); add( icon );
BitmapTextMultiline info = PixelScene.createMultiline( badge.desc(), 8 ); //TODO: this used to be centered, should probably figure that out.
info.maxWidth = WIDTH - MARGIN * 2; RenderedTextMultiline info = PixelScene.renderMultiline( badge.desc(), 8 );
info.measure(); info.maxWidth(WIDTH - MARGIN * 2);
add(info);
float w = Math.max( icon.width(), info.width() ) + MARGIN * 2; float w = Math.max( icon.width(), info.width() ) + MARGIN * 2;
icon.x = (w - icon.width()) / 2; icon.x = (w - icon.width()) / 2;
icon.y = MARGIN; icon.y = MARGIN;
float pos = icon.y + icon.height() + MARGIN;
for (BitmapText line : info.new LineSplitter().split()) {
line.measure();
line.x = (w - line.width()) / 2;
line.y = pos;
add( line );
pos += line.height();
}
resize( (int)w, (int)(pos + MARGIN) ); info.setPos((w - info.width()) / 2, icon.y + icon.height() + MARGIN);
resize( (int)w, (int)(info.bottom() + MARGIN) );
BadgeBanner.highlight( icon, badge.image ); BadgeBanner.highlight( icon, badge.image );
} }

View File

@ -20,22 +20,22 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.ui.Component;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Chrome; import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot; import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.ui.Component;
public class WndBlacksmith extends Window { public class WndBlacksmith extends Window {
@ -60,10 +60,9 @@ public class WndBlacksmith extends Window {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( Messages.get(this, "prompt"), 6 ); RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "prompt"), 6 );
message.maxWidth = WIDTH; message.maxWidth( WIDTH);
message.measure(); message.setPos(0, titlebar.bottom() + GAP);
message.y = titlebar.bottom() + GAP;
add( message ); add( message );
btnItem1 = new ItemButton() { btnItem1 = new ItemButton() {
@ -73,7 +72,7 @@ public class WndBlacksmith extends Window {
GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(WndBlacksmith.class, "select") ); GameScene.selectItem( itemSelector, WndBag.Mode.UPGRADEABLE, Messages.get(WndBlacksmith.class, "select") );
} }
}; };
btnItem1.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.y + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE ); btnItem1.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + BTN_GAP, BTN_SIZE, BTN_SIZE );
add( btnItem1 ); add( btnItem1 );
btnItem2 = new ItemButton() { btnItem2 = new ItemButton() {

View File

@ -20,18 +20,18 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
public class WndImp extends Window { public class WndImp extends Window {
@ -49,10 +49,9 @@ public class WndImp extends Window {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( Messages.get(this, "message"), 6 ); RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "message"), 6 );
message.maxWidth = WIDTH; message.maxWidth(WIDTH);
message.measure(); message.setPos(0, titlebar.bottom() + GAP);
message.y = titlebar.bottom() + GAP;
add( message ); add( message );
RedButton btnReward = new RedButton( Messages.get(this, "reward") ) { RedButton btnReward = new RedButton( Messages.get(this, "reward") ) {
@ -61,7 +60,7 @@ public class WndImp extends Window {
takeReward( imp, tokens, Imp.Quest.reward ); takeReward( imp, tokens, Imp.Quest.reward );
} }
}; };
btnReward.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT ); btnReward.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnReward ); add( btnReward );
resize( WIDTH, (int)btnReward.bottom() ); resize( WIDTH, (int)btnReward.bottom() );

View File

@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.gltextures.SmartTexture; import com.watabou.gltextures.SmartTexture;
import com.watabou.gltextures.TextureCache; import com.watabou.gltextures.TextureCache;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.TextureFilm; import com.watabou.noosa.TextureFilm;
public class WndInfoBuff extends Window { public class WndInfoBuff extends Window {
@ -56,13 +56,11 @@ public class WndInfoBuff extends Window {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline txtInfo = PixelScene.createMultiline(buff.desc(), 6); RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
txtInfo.maxWidth = WIDTH; txtInfo.maxWidth(width);
txtInfo.measure(); txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
txtInfo.x = titlebar.left();
txtInfo.y = titlebar.bottom() + GAP;
add( txtInfo ); add( txtInfo );
resize( WIDTH, (int)(txtInfo.y + txtInfo.height()) ); resize( WIDTH, (int)(txtInfo.top() + txtInfo.height()) );
} }
} }

View File

@ -20,16 +20,16 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ui.CustomTileVisual;
import com.watabou.noosa.Image;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.CustomTileVisual;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.Image;
public class WndInfoCell extends Window { public class WndInfoCell extends Window {
@ -85,7 +85,7 @@ public class WndInfoCell extends Window {
titlebar.setRect(0, 0, WIDTH, 0); titlebar.setRect(0, 0, WIDTH, 0);
add(titlebar); add(titlebar);
BitmapTextMultiline info = PixelScene.createMultiline(6); RenderedTextMultiline info = PixelScene.renderMultiline(6);
add(info); add(info);
for (Blob blob:Dungeon.level.blobs.values()) { for (Blob blob:Dungeon.level.blobs.values()) {
@ -98,11 +98,9 @@ public class WndInfoCell extends Window {
} }
info.text( desc ); info.text( desc );
info.maxWidth = WIDTH; info.maxWidth(WIDTH);
info.measure(); info.setPos(titlebar.left(), titlebar.bottom() + GAP);
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
resize( WIDTH, (int)(info.y + info.height()) ); resize( WIDTH, (int)(info.top() + info.height()) );
} }
} }

View File

@ -21,22 +21,22 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot; import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
public class WndInfoItem extends Window { public class WndInfoItem extends Window {
private static final float GAP = 2; private static final float GAP = 2;
private static final int WIDTH_P = 120; private static final int WIDTH_P = 120;
@ -119,13 +119,11 @@ public class WndInfoItem extends Window {
titlebar.setRect( 0, 0, width, 0 ); titlebar.setRect( 0, 0, width, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline txtInfo = PixelScene.createMultiline( info, 6 ); RenderedTextMultiline txtInfo = PixelScene.renderMultiline( info, 6 );
txtInfo.maxWidth = width; txtInfo.maxWidth(width);
txtInfo.measure(); txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
txtInfo.x = titlebar.left();
txtInfo.y = titlebar.bottom() + GAP;
add( txtInfo ); add( txtInfo );
resize( width, (int)(txtInfo.y + txtInfo.height()) ); resize( width, (int)(txtInfo.top() + txtInfo.height()) );
} }
} }

View File

@ -21,15 +21,13 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.watabou.noosa.BitmapTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot; import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.watabou.noosa.RenderedTextMultiline;
public class WndItem extends Window { public class WndItem extends Window {
@ -46,7 +44,7 @@ public class WndItem extends Window {
super(); super();
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
IconTitle titlebar = new IconTitle( item ); IconTitle titlebar = new IconTitle( item );
titlebar.setRect( 0, 0, width, 0 ); titlebar.setRect( 0, 0, width, 0 );
add( titlebar ); add( titlebar );
@ -57,14 +55,12 @@ public class WndItem extends Window {
titlebar.color( ItemSlot.DEGRADED ); titlebar.color( ItemSlot.DEGRADED );
} }
BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 ); RenderedTextMultiline info = PixelScene.renderMultiline( item.info(), 6 );
info.maxWidth = width; info.maxWidth(width);
info.measure(); info.setPos(titlebar.left(), titlebar.bottom() + GAP);
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
add( info ); add( info );
float y = info.y + info.height() + GAP; float y = info.top() + info.height() + GAP;
float x = 0; float x = 0;
if (Dungeon.hero.isAlive() && owner != null) { if (Dungeon.hero.isAlive() && owner != null) {

View File

@ -21,9 +21,9 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.watabou.noosa.BitmapTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.RenderedTextMultiline;
public class WndMessage extends Window { public class WndMessage extends Window {
@ -35,10 +35,9 @@ public class WndMessage extends Window {
super(); super();
BitmapTextMultiline info = PixelScene.createMultiline( text, 6 ); RenderedTextMultiline info = PixelScene.renderMultiline( text, 6 );
info.maxWidth = (ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2; info.maxWidth((ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2);
info.measure(); info.setPos(MARGIN, MARGIN);
info.x = info.y = MARGIN;
add( info ); add( info );
resize( resize(

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.watabou.noosa.BitmapTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
@ -40,16 +39,15 @@ public class WndOptions extends Window {
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P; int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 ); RenderedTextMultiline tfTitle = PixelScene.renderMultiline( title, 9 );
tfTitle.hardlight( TITLE_COLOR ); tfTitle.hardlight( TITLE_COLOR );
tfTitle.x = tfTitle.y = MARGIN; tfTitle.setPos(MARGIN, MARGIN);
tfTitle.maxWidth = width - MARGIN * 2; tfTitle.maxWidth(width - MARGIN * 2);
tfTitle.measure();
add( tfTitle ); add( tfTitle );
RenderedTextMultiline tfMesage = PixelScene.renderMultiline( 6 ); RenderedTextMultiline tfMesage = PixelScene.renderMultiline( 6 );
tfMesage.text(message, width - MARGIN * 2); tfMesage.text(message, width - MARGIN * 2);
tfMesage.setPos( MARGIN, tfTitle.y + tfTitle.height() + MARGIN ); tfMesage.setPos( MARGIN, tfTitle.top() + tfTitle.height() + MARGIN );
add( tfMesage ); add( tfMesage );
float pos = tfMesage.bottom() + MARGIN; float pos = tfMesage.bottom() + MARGIN;

View File

@ -20,21 +20,21 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.Game;
import com.shatteredpixel.shatteredpixeldungeon.Rankings; import com.shatteredpixel.shatteredpixeldungeon.Rankings;
import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh; import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.Game;
public class WndResurrect extends Window { public class WndResurrect extends Window {
private static final int WIDTH = 120; private static final int WIDTH = 120;
private static final int BTN_HEIGHT = 20; private static final int BTN_HEIGHT = 20;
private static final float GAP = 2; private static final float GAP = 2;
@ -55,10 +55,9 @@ public class WndResurrect extends Window {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( Messages.get(this, "message"), 6 ); RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "message"), 6 );
message.maxWidth = WIDTH; message.maxWidth(WIDTH);
message.measure(); message.setPos(0, titlebar.bottom() + GAP);
message.y = titlebar.bottom() + GAP;
add( message ); add( message );
RedButton btnYes = new RedButton( Messages.get(this, "yes") ) { RedButton btnYes = new RedButton( Messages.get(this, "yes") ) {
@ -72,7 +71,7 @@ public class WndResurrect extends Window {
Game.switchScene( InterlevelScene.class ); Game.switchScene( InterlevelScene.class );
} }
}; };
btnYes.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT ); btnYes.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnYes ); add( btnYes );
RedButton btnNo = new RedButton( Messages.get(this, "no") ) { RedButton btnNo = new RedButton( Messages.get(this, "no") ) {

View File

@ -32,7 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GreatCrabSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
public class WndSadGhost extends Window { public class WndSadGhost extends Window {
@ -45,22 +45,22 @@ public class WndSadGhost extends Window {
super(); super();
IconTitle titlebar = new IconTitle(); IconTitle titlebar = new IconTitle();
BitmapTextMultiline message; RenderedTextMultiline message;
switch (type){ switch (type){
case 1:default: case 1:default:
titlebar.icon( new FetidRatSprite() ); titlebar.icon( new FetidRatSprite() );
titlebar.label( Messages.get(this, "rat_title") ); titlebar.label( Messages.get(this, "rat_title") );
message = PixelScene.createMultiline( Messages.get(this, "rat")+Messages.get(this, "give_item"), 6 ); message = PixelScene.renderMultiline( Messages.get(this, "rat")+Messages.get(this, "give_item"), 6 );
break; break;
case 2: case 2:
titlebar.icon( new GnollTricksterSprite() ); titlebar.icon( new GnollTricksterSprite() );
titlebar.label( Messages.get(this, "gnoll_title") ); titlebar.label( Messages.get(this, "gnoll_title") );
message = PixelScene.createMultiline( Messages.get(this, "gnoll")+Messages.get(this, "give_item"), 6 ); message = PixelScene.renderMultiline( Messages.get(this, "gnoll")+Messages.get(this, "give_item"), 6 );
break; break;
case 3: case 3:
titlebar.icon( new GreatCrabSprite()); titlebar.icon( new GreatCrabSprite());
titlebar.label( Messages.get(this, "crab_title") ); titlebar.label( Messages.get(this, "crab_title") );
message = PixelScene.createMultiline( Messages.get(this, "crab")+Messages.get(this, "give_item"), 6 ); message = PixelScene.renderMultiline( Messages.get(this, "crab")+Messages.get(this, "give_item"), 6 );
break; break;
} }
@ -68,9 +68,8 @@ public class WndSadGhost extends Window {
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar ); add( titlebar );
message.maxWidth = WIDTH; message.maxWidth(WIDTH);
message.measure(); message.setPos(0, titlebar.bottom() + GAP);
message.y = titlebar.bottom() + GAP;
add( message ); add( message );
RedButton btnWeapon = new RedButton( Messages.get(this, "weapon") ) { RedButton btnWeapon = new RedButton( Messages.get(this, "weapon") ) {
@ -79,7 +78,7 @@ public class WndSadGhost extends Window {
selectReward( ghost, Ghost.Quest.weapon ); selectReward( ghost, Ghost.Quest.weapon );
} }
}; };
btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT ); btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnWeapon ); add( btnWeapon );
if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) { if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) {

View File

@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.input.Touchscreen.Touch; import com.watabou.input.Touchscreen.Touch;
import com.watabou.noosa.BitmapTextMultiline;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.RenderedTextMultiline;
import com.watabou.noosa.TouchArea; import com.watabou.noosa.TouchArea;
import com.watabou.utils.SparseArray; import com.watabou.utils.SparseArray;
@ -58,25 +58,19 @@ public class WndStory extends Window {
CHAPTERS.put( ID_HALLS, "halls" ); CHAPTERS.put( ID_HALLS, "halls" );
}; };
private BitmapTextMultiline tf; private RenderedTextMultiline tf;
private float delay; private float delay;
public WndStory( String text ) { public WndStory( String text ) {
super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) ); super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
tf = PixelScene.createMultiline( text, 7 ); tf = PixelScene.renderMultiline( text, 7 );
tf.maxWidth = ShatteredPixelDungeon.landscape() ? tf.maxWidth(ShatteredPixelDungeon.landscape() ?
WIDTH_L - MARGIN * 2: WIDTH_L - MARGIN * 2:
WIDTH_P - MARGIN *2; WIDTH_P - MARGIN *2);
tf.measure(); tf.invert();
tf.ra = bgR; tf.setPos(MARGIN, 0);
tf.ga = bgG;
tf.ba = bgB;
tf.rm = -bgR;
tf.gm = -bgG;
tf.bm = -bgB;
tf.x = MARGIN;
add( tf ); add( tf );
add( new TouchArea( chrome ) { add( new TouchArea( chrome ) {

View File

@ -20,16 +20,16 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper;
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot; import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
@ -37,7 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
public class WndTradeItem extends Window { public class WndTradeItem extends Window {
@ -214,14 +214,12 @@ public class WndTradeItem extends Window {
} }
// Description // Description
BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 ); RenderedTextMultiline info = PixelScene.renderMultiline( item.info(), 6 );
info.maxWidth = WIDTH; info.maxWidth(WIDTH);
info.measure(); info.setPos(titlebar.left(), titlebar.bottom() + GAP);
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
add( info ); add( info );
return info.y + info.height(); return info.bottom();
} }
private void sell( Item item ) { private void sell( Item item ) {

View File

@ -20,21 +20,21 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.noosa.BitmapTextMultiline; import com.watabou.noosa.RenderedTextMultiline;
public class WndWandmaker extends Window { public class WndWandmaker extends Window {
@ -61,10 +61,9 @@ public class WndWandmaker extends Window {
msg = Messages.get(this, "berry"); msg = Messages.get(this, "berry");
} }
BitmapTextMultiline message = PixelScene.createMultiline( msg, 6 ); RenderedTextMultiline message = PixelScene.renderMultiline( msg, 6 );
message.maxWidth = WIDTH; message.maxWidth(WIDTH);
message.measure(); message.setPos(0, titlebar.bottom() + GAP);
message.y = titlebar.bottom() + GAP;
add( message ); add( message );
RedButton btnWand1 = new RedButton( Wandmaker.Quest.wand1.name() ) { RedButton btnWand1 = new RedButton( Wandmaker.Quest.wand1.name() ) {
@ -73,7 +72,7 @@ public class WndWandmaker extends Window {
selectReward( wandmaker, item, Wandmaker.Quest.wand1 ); selectReward( wandmaker, item, Wandmaker.Quest.wand1 );
} }
}; };
btnWand1.setRect(0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT); btnWand1.setRect(0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT);
add( btnWand1 ); add( btnWand1 );
RedButton btnWand2 = new RedButton( Wandmaker.Quest.wand2.name() ) { RedButton btnWand2 = new RedButton( Wandmaker.Quest.wand2.name() ) {