v0.3.4: implemented rendered text in all single-line cases
This commit is contained in:
parent
dc70009ae6
commit
13d6beda67
|
@ -23,10 +23,10 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBadge;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBadge;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
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;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
|
@ -71,9 +71,8 @@ public class BadgesScene extends PixelScene {
|
||||||
float left = (w - size * nCols) / 2;
|
float left = (w - size * nCols) / 2;
|
||||||
float top = (h - size * nRows) / 2;
|
float top = (h - size * nRows) / 2;
|
||||||
|
|
||||||
BitmapText title = PixelScene.createText( Messages.get(this, "title"), 9 );
|
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
|
||||||
title.hardlight(Window.TITLE_COLOR);
|
title.hardlight(Window.TITLE_COLOR);
|
||||||
title.measure();
|
|
||||||
title.x = (w - title.width()) / 2 ;
|
title.x = (w - title.width()) / 2 ;
|
||||||
title.y = (top - title.baseLine()) / 2 ;
|
title.y = (top - title.baseLine()) / 2 ;
|
||||||
add(title);
|
add(title);
|
||||||
|
|
|
@ -31,9 +31,9 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ public class InterlevelScene extends PixelScene {
|
||||||
private Phase phase;
|
private Phase phase;
|
||||||
private float timeLeft;
|
private float timeLeft;
|
||||||
|
|
||||||
private BitmapText message;
|
private RenderedText message;
|
||||||
|
|
||||||
private Thread thread;
|
private Thread thread;
|
||||||
private Exception error = null;
|
private Exception error = null;
|
||||||
|
@ -73,8 +73,7 @@ public class InterlevelScene extends PixelScene {
|
||||||
|
|
||||||
String text = Messages.get(Mode.class, mode.name());
|
String text = Messages.get(Mode.class, mode.name());
|
||||||
|
|
||||||
message = PixelScene.createText( text, 9 );
|
message = PixelScene.renderText( text, 9 );
|
||||||
message.measure();
|
|
||||||
message.x = (Camera.main.width - message.width()) / 2;
|
message.x = (Camera.main.width - message.width()) / 2;
|
||||||
message.y = (Camera.main.height - message.height()) / 2;
|
message.y = (Camera.main.height - message.height()) / 2;
|
||||||
add( message );
|
add( message );
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.watabou.noosa.BitmapText;
|
||||||
import com.watabou.noosa.BitmapTextMultiline;
|
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.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;
|
||||||
|
@ -71,9 +72,8 @@ public class RankingsScene extends PixelScene {
|
||||||
|
|
||||||
Rankings.INSTANCE.load();
|
Rankings.INSTANCE.load();
|
||||||
|
|
||||||
BitmapText title = PixelScene.createText( Messages.get(this, "title"), 9);
|
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9);
|
||||||
title.hardlight(Window.SHPX_COLOR);
|
title.hardlight(Window.SHPX_COLOR);
|
||||||
title.measure();
|
|
||||||
title.x = (w - title.width()) / 2;
|
title.x = (w - title.width()) / 2;
|
||||||
title.y = GAP;
|
title.y = GAP;
|
||||||
add(title);
|
add(title);
|
||||||
|
@ -103,19 +103,16 @@ public class RankingsScene extends PixelScene {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rankings.INSTANCE.totalNumber >= Rankings.TABLE_SIZE) {
|
if (Rankings.INSTANCE.totalNumber >= Rankings.TABLE_SIZE) {
|
||||||
BitmapText label = PixelScene.createText( Messages.get(this, "total") + " ", 8 );
|
RenderedText label = PixelScene.renderText( Messages.get(this, "total") + " ", 8 );
|
||||||
label.hardlight( 0xCCCCCC );
|
label.hardlight( 0xCCCCCC );
|
||||||
label.measure();
|
|
||||||
add( label );
|
add( label );
|
||||||
|
|
||||||
BitmapText won = PixelScene.createText( Integer.toString( Rankings.INSTANCE.wonNumber ), 8 );
|
RenderedText won = PixelScene.renderText( Integer.toString( Rankings.INSTANCE.wonNumber ), 8 );
|
||||||
won.hardlight( Window.SHPX_COLOR );
|
won.hardlight( Window.SHPX_COLOR );
|
||||||
won.measure();
|
|
||||||
add( won );
|
add( won );
|
||||||
|
|
||||||
BitmapText total = PixelScene.createText( "/" + Rankings.INSTANCE.totalNumber, 8 );
|
RenderedText total = PixelScene.renderText( "/" + Rankings.INSTANCE.totalNumber, 8 );
|
||||||
total.hardlight( 0xCCCCCC );
|
total.hardlight( 0xCCCCCC );
|
||||||
total.measure();
|
|
||||||
total.x = (w - total.width()) / 2;
|
total.x = (w - total.width()) / 2;
|
||||||
total.y = top + pos * rowHeight + GAP;
|
total.y = top + pos * rowHeight + GAP;
|
||||||
add( total );
|
add( total );
|
||||||
|
@ -130,9 +127,8 @@ public class RankingsScene extends PixelScene {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
BitmapText noRec = PixelScene.createText(Messages.get(this, "no_games"), 8);
|
RenderedText noRec = PixelScene.renderText(Messages.get(this, "no_games"), 8);
|
||||||
noRec.hardlight( 0xCCCCCC );
|
noRec.hardlight( 0xCCCCCC );
|
||||||
noRec.measure();
|
|
||||||
noRec.x = (w - noRec.width()) / 2;
|
noRec.x = (w - noRec.width()) / 2;
|
||||||
noRec.y = (h - noRec.height()) / 2;
|
noRec.y = (h - noRec.height()) / 2;
|
||||||
add(noRec);
|
add(noRec);
|
||||||
|
|
|
@ -29,6 +29,7 @@ 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.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;
|
||||||
|
@ -313,7 +314,7 @@ public class StartScene extends PixelScene {
|
||||||
private static final int SECONDARY_COLOR_N = 0xCACFC2;
|
private static final int SECONDARY_COLOR_N = 0xCACFC2;
|
||||||
private static final int SECONDARY_COLOR_H = 0xFFFF88;
|
private static final int SECONDARY_COLOR_H = 0xFFFF88;
|
||||||
|
|
||||||
private BitmapText secondary;
|
private RenderedText secondary;
|
||||||
|
|
||||||
public GameButton( String primary ) {
|
public GameButton( String primary ) {
|
||||||
super( primary );
|
super( primary );
|
||||||
|
@ -325,7 +326,7 @@ public class StartScene extends PixelScene {
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
super.createChildren();
|
super.createChildren();
|
||||||
|
|
||||||
secondary = createText( 6 );
|
secondary = renderText( 6 );
|
||||||
add( secondary );
|
add( secondary );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +346,6 @@ public class StartScene extends PixelScene {
|
||||||
|
|
||||||
public void secondary( String text, boolean highlighted ) {
|
public void secondary( String text, boolean highlighted ) {
|
||||||
secondary.text( text );
|
secondary.text( text );
|
||||||
secondary.measure();
|
|
||||||
|
|
||||||
secondary.hardlight( highlighted ? SECONDARY_COLOR_H : SECONDARY_COLOR_N );
|
secondary.hardlight( highlighted ? SECONDARY_COLOR_H : SECONDARY_COLOR_N );
|
||||||
}
|
}
|
||||||
|
@ -368,7 +368,7 @@ public class StartScene extends PixelScene {
|
||||||
private HeroClass cl;
|
private HeroClass cl;
|
||||||
|
|
||||||
private Image avatar;
|
private Image avatar;
|
||||||
private BitmapText name;
|
private RenderedText name;
|
||||||
private Emitter emitter;
|
private Emitter emitter;
|
||||||
|
|
||||||
private float brightness;
|
private float brightness;
|
||||||
|
@ -392,8 +392,7 @@ public class StartScene extends PixelScene {
|
||||||
highlighted = BASIC_HIGHLIGHTED;
|
highlighted = BASIC_HIGHLIGHTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
name.text( cl.name() );
|
name.text( cl.title().toUpperCase() );
|
||||||
name.measure();
|
|
||||||
name.hardlight( normal );
|
name.hardlight( normal );
|
||||||
|
|
||||||
brightness = MIN_BRIGHTNESS;
|
brightness = MIN_BRIGHTNESS;
|
||||||
|
@ -408,7 +407,7 @@ public class StartScene extends PixelScene {
|
||||||
avatar = new Image( Assets.AVATARS );
|
avatar = new Image( Assets.AVATARS );
|
||||||
add( avatar );
|
add( avatar );
|
||||||
|
|
||||||
name = PixelScene.createText( 9 );
|
name = PixelScene.renderText( 9 );
|
||||||
add( name );
|
add( name );
|
||||||
|
|
||||||
emitter = new BitmaskEmitter( avatar );
|
emitter = new BitmaskEmitter( avatar );
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.watabou.noosa.BitmapText;
|
||||||
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;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.ui.Button;
|
import com.watabou.noosa.ui.Button;
|
||||||
|
@ -214,14 +215,13 @@ public class TitleScene extends PixelScene {
|
||||||
private static final int IMAGE_SIZE = 32;
|
private static final int IMAGE_SIZE = 32;
|
||||||
|
|
||||||
private Image image;
|
private Image image;
|
||||||
private BitmapText label;
|
private RenderedText label;
|
||||||
|
|
||||||
public DashboardItem( String text, int index ) {
|
public DashboardItem( String text, int index ) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
image.frame( image.texture.uvRect( index * IMAGE_SIZE, 0, (index + 1) * IMAGE_SIZE, IMAGE_SIZE ) );
|
image.frame( image.texture.uvRect( index * IMAGE_SIZE, 0, (index + 1) * IMAGE_SIZE, IMAGE_SIZE ) );
|
||||||
this.label.text( text );
|
this.label.text( text );
|
||||||
this.label.measure();
|
|
||||||
|
|
||||||
setSize( SIZE, SIZE );
|
setSize( SIZE, SIZE );
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ public class TitleScene extends PixelScene {
|
||||||
image = new Image( Assets.DASHBOARD );
|
image = new Image( Assets.DASHBOARD );
|
||||||
add( image );
|
add( image );
|
||||||
|
|
||||||
label = createText( 9 );
|
label = renderText( 9 );
|
||||||
add( label );
|
add( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.ui.Component;
|
import com.watabou.noosa.ui.Component;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
@ -85,7 +85,7 @@ public class BadgesList extends ScrollPane {
|
||||||
private Badges.Badge badge;
|
private Badges.Badge badge;
|
||||||
|
|
||||||
private Image icon;
|
private Image icon;
|
||||||
private BitmapText label;
|
private RenderedText label;
|
||||||
|
|
||||||
public ListItem( Badges.Badge badge ) {
|
public ListItem( Badges.Badge badge ) {
|
||||||
super();
|
super();
|
||||||
|
@ -100,7 +100,7 @@ public class BadgesList extends ScrollPane {
|
||||||
icon = new Image();
|
icon = new Image();
|
||||||
add( icon );
|
add( icon );
|
||||||
|
|
||||||
label = PixelScene.createText( 6 );
|
label = PixelScene.renderText( 6 );
|
||||||
add( label );
|
add( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ public abstract class OptionSlider extends Component {
|
||||||
|
|
||||||
private TouchArea touchArea;
|
private TouchArea touchArea;
|
||||||
|
|
||||||
private BitmapText title;
|
private RenderedText title;
|
||||||
private BitmapText minTxt;
|
private RenderedText minTxt;
|
||||||
private BitmapText maxTxt;
|
private RenderedText maxTxt;
|
||||||
|
|
||||||
//values are expressed internally as ints, but they can easily be interpreted as something else externally.
|
//values are expressed internally as ints, but they can easily be interpreted as something else externally.
|
||||||
private int minVal;
|
private int minVal;
|
||||||
|
@ -54,11 +54,8 @@ public abstract class OptionSlider extends Component {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.title.text(title);
|
this.title.text(title);
|
||||||
this.title.measure();
|
|
||||||
this.minTxt.text(minTxt);
|
this.minTxt.text(minTxt);
|
||||||
this.minTxt.measure();
|
|
||||||
this.maxTxt.text(maxTxt);
|
this.maxTxt.text(maxTxt);
|
||||||
this.maxTxt.measure();
|
|
||||||
|
|
||||||
this.minVal = minVal;
|
this.minVal = minVal;
|
||||||
this.maxVal = maxVal;
|
this.maxVal = maxVal;
|
||||||
|
@ -95,9 +92,9 @@ public abstract class OptionSlider extends Component {
|
||||||
add( BG = Chrome.get(Chrome.Type.BUTTON));
|
add( BG = Chrome.get(Chrome.Type.BUTTON));
|
||||||
BG.alpha(0.5f);
|
BG.alpha(0.5f);
|
||||||
|
|
||||||
add(title = PixelScene.createText(9));
|
add(title = PixelScene.renderText(9));
|
||||||
add(this.minTxt = PixelScene.createText(6));
|
add(this.minTxt = PixelScene.renderText(6));
|
||||||
add(this.maxTxt = PixelScene.createText(6));
|
add(this.maxTxt = PixelScene.renderText(6));
|
||||||
|
|
||||||
add(sliderBG = new ColorBlock(1, 1, 0xFF222222));
|
add(sliderBG = new ColorBlock(1, 1, 0xFF222222));
|
||||||
sliderNode = Chrome.get(Chrome.Type.BUTTON);
|
sliderNode = Chrome.get(Chrome.Type.BUTTON);
|
||||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||||
import com.watabou.noosa.BitmapText;
|
import com.watabou.noosa.BitmapText;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.NinePatch;
|
import com.watabou.noosa.NinePatch;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.ui.Button;
|
import com.watabou.noosa.ui.Button;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
@ -32,14 +33,13 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
public class RedButton extends Button {
|
public class RedButton extends Button {
|
||||||
|
|
||||||
protected NinePatch bg;
|
protected NinePatch bg;
|
||||||
protected BitmapText text;
|
protected RenderedText text;
|
||||||
protected Image icon;
|
protected Image icon;
|
||||||
|
|
||||||
public RedButton( String label ) {
|
public RedButton( String label ) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
text.text( label );
|
text.text( label );
|
||||||
text.measure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,7 +49,7 @@ public class RedButton extends Button {
|
||||||
bg = Chrome.get( Chrome.Type.BUTTON );
|
bg = Chrome.get( Chrome.Type.BUTTON );
|
||||||
add( bg );
|
add( bg );
|
||||||
|
|
||||||
text = PixelScene.createText( 9 );
|
text = PixelScene.renderText( 9 );
|
||||||
add( text );
|
add( text );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,6 @@ public class RedButton extends Button {
|
||||||
|
|
||||||
public void text( String value ) {
|
public void text( String value ) {
|
||||||
text.text( value );
|
text.text( value );
|
||||||
text.measure();
|
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||||
import com.watabou.gltextures.TextureCache;
|
import com.watabou.gltextures.TextureCache;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.ColorBlock;
|
import com.watabou.noosa.ColorBlock;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
public class WndBag extends WndTabbed {
|
public class WndBag extends WndTabbed {
|
||||||
|
@ -113,9 +113,8 @@ public class WndBag extends WndTabbed {
|
||||||
int slotsWidth = SLOT_SIZE * nCols + SLOT_MARGIN * (nCols - 1);
|
int slotsWidth = SLOT_SIZE * nCols + SLOT_MARGIN * (nCols - 1);
|
||||||
int slotsHeight = SLOT_SIZE * nRows + SLOT_MARGIN * (nRows - 1);
|
int slotsHeight = SLOT_SIZE * nRows + SLOT_MARGIN * (nRows - 1);
|
||||||
|
|
||||||
BitmapText txtTitle = PixelScene.createText( title != null ? title : Utils.capitalize( bag.name() ), 9 );
|
RenderedText txtTitle = PixelScene.renderText( title != null ? title : Utils.capitalize( bag.name() ), 9 );
|
||||||
txtTitle.hardlight( TITLE_COLOR );
|
txtTitle.hardlight( TITLE_COLOR );
|
||||||
txtTitle.measure();
|
|
||||||
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
|
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
|
||||||
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
|
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
|
||||||
add( txtTitle );
|
add( txtTitle );
|
||||||
|
|
|
@ -20,20 +20,20 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.ui.Component;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
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.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.ui.Component;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class WndCatalogus extends WndTabbed {
|
public class WndCatalogus extends WndTabbed {
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class WndCatalogus extends WndTabbed {
|
||||||
|
|
||||||
private static final int ITEM_HEIGHT = 18;
|
private static final int ITEM_HEIGHT = 18;
|
||||||
|
|
||||||
private BitmapText txtTitle;
|
private RenderedText txtTitle;
|
||||||
private ScrollPane list;
|
private ScrollPane list;
|
||||||
|
|
||||||
private ArrayList<ListItem> items = new ArrayList<>();
|
private ArrayList<ListItem> items = new ArrayList<>();
|
||||||
|
@ -62,9 +62,8 @@ public class WndCatalogus extends WndTabbed {
|
||||||
resize( WIDTH_P, HEIGHT_P );
|
resize( WIDTH_P, HEIGHT_P );
|
||||||
}
|
}
|
||||||
|
|
||||||
txtTitle = PixelScene.createText( Messages.get(this, "title"), 9 );
|
txtTitle = PixelScene.renderText( Messages.get(this, "title"), 9 );
|
||||||
txtTitle.hardlight( Window.TITLE_COLOR );
|
txtTitle.hardlight( Window.TITLE_COLOR );
|
||||||
txtTitle.measure();
|
|
||||||
add( txtTitle );
|
add( txtTitle );
|
||||||
|
|
||||||
list = new ScrollPane( new Component() ) {
|
list = new ScrollPane( new Component() ) {
|
||||||
|
@ -110,7 +109,6 @@ public class WndCatalogus extends WndTabbed {
|
||||||
private void updateList() {
|
private void updateList() {
|
||||||
|
|
||||||
txtTitle.text( Messages.get(this, "title", showPotions ? Messages.get(this, "potions") : Messages.get(this, "scrolls") ) );
|
txtTitle.text( Messages.get(this, "title", showPotions ? Messages.get(this, "potions") : Messages.get(this, "scrolls") ) );
|
||||||
txtTitle.measure();
|
|
||||||
txtTitle.x = (width - txtTitle.width()) / 2;
|
txtTitle.x = (width - txtTitle.width()) / 2;
|
||||||
|
|
||||||
items.clear();
|
items.clear();
|
||||||
|
@ -148,7 +146,7 @@ public class WndCatalogus extends WndTabbed {
|
||||||
private boolean identified;
|
private boolean identified;
|
||||||
|
|
||||||
private ItemSprite sprite;
|
private ItemSprite sprite;
|
||||||
private BitmapText label;
|
private RenderedText label;
|
||||||
|
|
||||||
public ListItem( Class<? extends Item> cl ) {
|
public ListItem( Class<? extends Item> cl ) {
|
||||||
super();
|
super();
|
||||||
|
@ -173,7 +171,7 @@ public class WndCatalogus extends WndTabbed {
|
||||||
sprite = new ItemSprite();
|
sprite = new ItemSprite();
|
||||||
add( sprite );
|
add( sprite );
|
||||||
|
|
||||||
label = PixelScene.createText( 8 );
|
label = PixelScene.renderText( 8 );
|
||||||
add( label );
|
add( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,15 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
import com.watabou.noosa.BitmapText;
|
import com.watabou.noosa.RenderedText;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class WndChallenges extends Window {
|
public class WndChallenges extends Window {
|
||||||
|
|
||||||
|
@ -46,9 +46,8 @@ public class WndChallenges extends Window {
|
||||||
|
|
||||||
this.editable = editable;
|
this.editable = editable;
|
||||||
|
|
||||||
BitmapText title = PixelScene.createText( Messages.get(this, "title"), 9 );
|
RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
|
||||||
title.hardlight( TITLE_COLOR );
|
title.hardlight( TITLE_COLOR );
|
||||||
title.measure();
|
|
||||||
title.x = (WIDTH - title.width()) / 2;
|
title.x = (WIDTH - title.width()) / 2;
|
||||||
title.y = (TTL_HEIGHT - title.height()) / 2;
|
title.y = (TTL_HEIGHT - title.height()) / 2;
|
||||||
add( title );
|
add( title );
|
||||||
|
|
|
@ -20,16 +20,16 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.watabou.noosa.BitmapTextMultiline;
|
||||||
|
import com.watabou.noosa.Group;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HighlightedText;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HighlightedText;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||||
import com.watabou.noosa.BitmapText;
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.BitmapTextMultiline;
|
|
||||||
import com.watabou.noosa.Group;
|
|
||||||
|
|
||||||
public class WndClass extends WndTabbed {
|
public class WndClass extends WndTabbed {
|
||||||
|
|
||||||
|
@ -116,11 +116,10 @@ public class WndClass extends WndTabbed {
|
||||||
pos += GAP;
|
pos += GAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitmapText dot = PixelScene.createText( DOT, 6 );
|
RenderedText dot = PixelScene.renderText( DOT, 6 );
|
||||||
dot.x = MARGIN;
|
dot.x = MARGIN;
|
||||||
dot.y = pos;
|
dot.y = pos;
|
||||||
if (dotWidth == 0) {
|
if (dotWidth == 0) {
|
||||||
dot.measure();
|
|
||||||
dotWidth = dot.width();
|
dotWidth = dot.width();
|
||||||
}
|
}
|
||||||
add( dot );
|
add( dot );
|
||||||
|
|
|
@ -20,28 +20,28 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
|
import com.watabou.gltextures.SmartTexture;
|
||||||
|
import com.watabou.gltextures.TextureCache;
|
||||||
|
import com.watabou.noosa.Group;
|
||||||
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.TextureFilm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
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.sprites.HeroSprite;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
|
||||||
import com.watabou.gltextures.SmartTexture;
|
|
||||||
import com.watabou.gltextures.TextureCache;
|
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Group;
|
|
||||||
import com.watabou.noosa.Image;
|
|
||||||
import com.watabou.noosa.TextureFilm;
|
|
||||||
import com.watabou.noosa.ui.Button;
|
import com.watabou.noosa.ui.Button;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class WndHero extends WndTabbed {
|
public class WndHero extends WndTabbed {
|
||||||
|
|
||||||
private static final int WIDTH = 100;
|
private static final int WIDTH = 100;
|
||||||
|
@ -97,7 +97,10 @@ public class WndHero extends WndTabbed {
|
||||||
|
|
||||||
IconTitle title = new IconTitle();
|
IconTitle title = new IconTitle();
|
||||||
title.icon( HeroSprite.avatar(hero.heroClass, hero.tier()) );
|
title.icon( HeroSprite.avatar(hero.heroClass, hero.tier()) );
|
||||||
|
if (hero.givenName().equals(hero.className()))
|
||||||
title.label( Messages.get(this, "title", hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ) );
|
title.label( Messages.get(this, "title", hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ) );
|
||||||
|
else
|
||||||
|
title.label((hero.givenName() + "\n" + Messages.get(this, "title", hero.lvl, hero.className())).toUpperCase(Locale.ENGLISH));
|
||||||
title.color(Window.SHPX_COLOR);
|
title.color(Window.SHPX_COLOR);
|
||||||
title.setRect( 0, 0, WIDTH, 0 );
|
title.setRect( 0, 0, WIDTH, 0 );
|
||||||
add(title);
|
add(title);
|
||||||
|
@ -140,12 +143,11 @@ public class WndHero extends WndTabbed {
|
||||||
|
|
||||||
private void statSlot( String label, String value ) {
|
private void statSlot( String label, String value ) {
|
||||||
|
|
||||||
BitmapText txt = PixelScene.createText( label, 8 );
|
RenderedText txt = PixelScene.renderText( label, 8 );
|
||||||
txt.y = pos;
|
txt.y = pos;
|
||||||
add( txt );
|
add( txt );
|
||||||
|
|
||||||
txt = PixelScene.createText( value, 8 );
|
txt = PixelScene.renderText( value, 8 );
|
||||||
txt.measure();
|
|
||||||
txt.x = 65;
|
txt.x = 65;
|
||||||
txt.y = pos;
|
txt.y = pos;
|
||||||
add( txt );
|
add( txt );
|
||||||
|
@ -188,7 +190,7 @@ public class WndHero extends WndTabbed {
|
||||||
private Buff buff;
|
private Buff buff;
|
||||||
|
|
||||||
Image icon;
|
Image icon;
|
||||||
BitmapText txt;
|
RenderedText txt;
|
||||||
|
|
||||||
public BuffSlot( Buff buff ){
|
public BuffSlot( Buff buff ){
|
||||||
super();
|
super();
|
||||||
|
@ -200,7 +202,7 @@ public class WndHero extends WndTabbed {
|
||||||
icon.y = this.y;
|
icon.y = this.y;
|
||||||
add( icon );
|
add( icon );
|
||||||
|
|
||||||
txt = PixelScene.createText( buff.toString(), 8 );
|
txt = PixelScene.renderText( buff.toString(), 8 );
|
||||||
txt.x = icon.width + GAP;
|
txt.x = icon.width + GAP;
|
||||||
txt.y = this.y + (int)(icon.height - txt.baseLine()) / 2;
|
txt.y = this.y + (int)(icon.height - txt.baseLine()) / 2;
|
||||||
add( txt );
|
add( txt );
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.watabou.noosa.BitmapText;
|
import com.watabou.noosa.BitmapText;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.ui.Component;
|
import com.watabou.noosa.ui.Component;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
|
@ -51,15 +52,14 @@ public class WndInfoMob extends WndTitledMessage {
|
||||||
private static final int GAP = 2;
|
private static final int GAP = 2;
|
||||||
|
|
||||||
private CharSprite image;
|
private CharSprite image;
|
||||||
private BitmapText name;
|
private RenderedText name;
|
||||||
private HealthBar health;
|
private HealthBar health;
|
||||||
private BuffIndicator buffs;
|
private BuffIndicator buffs;
|
||||||
|
|
||||||
public MobTitle( Mob mob ) {
|
public MobTitle( Mob mob ) {
|
||||||
|
|
||||||
name = PixelScene.createText( Utils.capitalize( mob.name ), 9 );
|
name = PixelScene.renderText( Utils.capitalize( mob.name ), 9 );
|
||||||
name.hardlight( TITLE_COLOR );
|
name.hardlight( TITLE_COLOR );
|
||||||
name.measure();
|
|
||||||
add( name );
|
add( name );
|
||||||
|
|
||||||
image = mob.sprite();
|
image = mob.sprite();
|
||||||
|
|
|
@ -20,19 +20,20 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import java.util.Collections;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Journal;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.watabou.noosa.BitmapText;
|
||||||
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.ui.Component;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Journal;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Image;
|
|
||||||
import com.watabou.noosa.ui.Component;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
public class WndJournal extends Window {
|
public class WndJournal extends Window {
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ public class WndJournal extends Window {
|
||||||
|
|
||||||
private static final int ITEM_HEIGHT = 18;
|
private static final int ITEM_HEIGHT = 18;
|
||||||
|
|
||||||
private BitmapText txtTitle;
|
private RenderedText txtTitle;
|
||||||
private ScrollPane list;
|
private ScrollPane list;
|
||||||
|
|
||||||
public WndJournal() {
|
public WndJournal() {
|
||||||
|
@ -50,9 +51,8 @@ public class WndJournal extends Window {
|
||||||
super();
|
super();
|
||||||
resize( WIDTH, ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P );
|
resize( WIDTH, ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P );
|
||||||
|
|
||||||
txtTitle = PixelScene.createText( Messages.get(this, "title"), 9 );
|
txtTitle = PixelScene.renderText( Messages.get(this, "title"), 9 );
|
||||||
txtTitle.hardlight( Window.TITLE_COLOR );
|
txtTitle.hardlight( Window.TITLE_COLOR );
|
||||||
txtTitle.measure();
|
|
||||||
txtTitle.x = (WIDTH - txtTitle.width()) / 2;
|
txtTitle.x = (WIDTH - txtTitle.width()) / 2;
|
||||||
add( txtTitle );
|
add( txtTitle );
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public class WndJournal extends Window {
|
||||||
|
|
||||||
private static class ListItem extends Component {
|
private static class ListItem extends Component {
|
||||||
|
|
||||||
private BitmapText feature;
|
private RenderedText feature;
|
||||||
private BitmapText depth;
|
private BitmapText depth;
|
||||||
|
|
||||||
private Image icon;
|
private Image icon;
|
||||||
|
@ -88,7 +88,6 @@ public class WndJournal extends Window {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
feature.text( f.desc() );
|
feature.text( f.desc() );
|
||||||
feature.measure();
|
|
||||||
|
|
||||||
depth.text( Integer.toString( d ) );
|
depth.text( Integer.toString( d ) );
|
||||||
depth.measure();
|
depth.measure();
|
||||||
|
@ -101,7 +100,7 @@ public class WndJournal extends Window {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
feature = PixelScene.createText( 9 );
|
feature = PixelScene.renderText( 9 );
|
||||||
add( feature );
|
add( feature );
|
||||||
|
|
||||||
depth = new BitmapText( PixelScene.pixelFont);
|
depth = new BitmapText( PixelScene.pixelFont);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.watabou.noosa.BitmapText;
|
||||||
import com.watabou.noosa.BitmapTextMultiline;
|
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.RenderedText;
|
||||||
|
|
||||||
public class WndList extends Window {
|
public class WndList extends Window {
|
||||||
|
|
||||||
|
@ -47,11 +48,10 @@ public class WndList extends Window {
|
||||||
pos += GAP;
|
pos += GAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitmapText dot = PixelScene.createText( DOT, 6 );
|
RenderedText dot = PixelScene.renderText( DOT, 6 );
|
||||||
dot.x = MARGIN;
|
dot.x = MARGIN;
|
||||||
dot.y = pos;
|
dot.y = pos;
|
||||||
if (dotWidth == 0) {
|
if (dotWidth == 0) {
|
||||||
dot.measure();
|
|
||||||
dotWidth = dot.width();
|
dotWidth = dot.width();
|
||||||
}
|
}
|
||||||
add( dot );
|
add( dot );
|
||||||
|
|
|
@ -20,13 +20,23 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.watabou.noosa.ColorBlock;
|
||||||
|
import com.watabou.noosa.Game;
|
||||||
|
import com.watabou.noosa.Group;
|
||||||
|
import com.watabou.noosa.Image;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
import com.watabou.noosa.ui.Button;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList;
|
||||||
|
@ -36,15 +46,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||||
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.BitmapText;
|
|
||||||
import com.watabou.noosa.ColorBlock;
|
|
||||||
import com.watabou.noosa.Game;
|
|
||||||
import com.watabou.noosa.Group;
|
|
||||||
import com.watabou.noosa.Image;
|
|
||||||
import com.watabou.noosa.audio.Sample;
|
|
||||||
import com.watabou.noosa.ui.Button;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class WndRanking extends WndTabbed {
|
public class WndRanking extends WndTabbed {
|
||||||
|
|
||||||
|
@ -193,12 +194,11 @@ public class WndRanking extends WndTabbed {
|
||||||
|
|
||||||
private float statSlot( Group parent, String label, String value, float pos ) {
|
private float statSlot( Group parent, String label, String value, float pos ) {
|
||||||
|
|
||||||
BitmapText txt = PixelScene.createText( label, 7 );
|
RenderedText txt = PixelScene.renderText( label, 7 );
|
||||||
txt.y = pos;
|
txt.y = pos;
|
||||||
parent.add( txt );
|
parent.add( txt );
|
||||||
|
|
||||||
txt = PixelScene.createText( value, 7 );
|
txt = PixelScene.renderText( value, 7 );
|
||||||
txt.measure();
|
|
||||||
txt.x = WIDTH * 0.65f;
|
txt.x = WIDTH * 0.65f;
|
||||||
txt.y = pos;
|
txt.y = pos;
|
||||||
parent.add( txt );
|
parent.add( txt );
|
||||||
|
@ -278,7 +278,7 @@ public class WndRanking extends WndTabbed {
|
||||||
|
|
||||||
private ItemSlot slot;
|
private ItemSlot slot;
|
||||||
private ColorBlock bg;
|
private ColorBlock bg;
|
||||||
private BitmapText name;
|
private RenderedText name;
|
||||||
|
|
||||||
public ItemButton( Item item ) {
|
public ItemButton( Item item ) {
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ public class WndRanking extends WndTabbed {
|
||||||
slot = new ItemSlot();
|
slot = new ItemSlot();
|
||||||
add( slot );
|
add( slot );
|
||||||
|
|
||||||
name = PixelScene.createText( "?", 7 );
|
name = PixelScene.renderText( "?", 7 );
|
||||||
add( name );
|
add( name );
|
||||||
|
|
||||||
super.createChildren();
|
super.createChildren();
|
||||||
|
@ -323,12 +323,10 @@ public class WndRanking extends WndTabbed {
|
||||||
|
|
||||||
String str = Utils.capitalize( item.name() );
|
String str = Utils.capitalize( item.name() );
|
||||||
name.text( str );
|
name.text( str );
|
||||||
name.measure();
|
|
||||||
if (name.width() > width - name.x) {
|
if (name.width() > width - name.x) {
|
||||||
do {
|
do {
|
||||||
str = str.substring( 0, str.length() - 1 );
|
str = str.substring( 0, str.length() - 1 );
|
||||||
name.text( str + "..." );
|
name.text( str + "..." );
|
||||||
name.measure();
|
|
||||||
} while (name.width() > width - name.x);
|
} while (name.width() > width - name.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.OptionSlider;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.OptionSlider;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
|
@ -160,8 +160,7 @@ public class WndSettings extends WndTabbed {
|
||||||
public UITab(){
|
public UITab(){
|
||||||
super();
|
super();
|
||||||
|
|
||||||
BitmapText barDesc = PixelScene.createText(Messages.get(this, "mode"), 9);
|
RenderedText barDesc = PixelScene.renderText(Messages.get(this, "mode"), 9);
|
||||||
barDesc.measure();
|
|
||||||
barDesc.x = (WIDTH-barDesc.width())/2;
|
barDesc.x = (WIDTH-barDesc.width())/2;
|
||||||
add(barDesc);
|
add(barDesc);
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.NinePatch;
|
import com.watabou.noosa.NinePatch;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.ui.Button;
|
import com.watabou.noosa.ui.Button;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
@ -192,21 +192,20 @@ public class WndTabbed extends Window {
|
||||||
|
|
||||||
protected class LabeledTab extends Tab {
|
protected class LabeledTab extends Tab {
|
||||||
|
|
||||||
private BitmapText btLabel;
|
private RenderedText btLabel;
|
||||||
|
|
||||||
public LabeledTab( String label ) {
|
public LabeledTab( String label ) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
btLabel.text( label );
|
btLabel.text( label );
|
||||||
btLabel.measure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
super.createChildren();
|
super.createChildren();
|
||||||
|
|
||||||
btLabel = PixelScene.createText( 9 );
|
btLabel = PixelScene.renderText( 9 );
|
||||||
add( btLabel );
|
add( btLabel );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user