v0.3.4: implemented rendered text in all single-line cases
This commit is contained in:
committed by
Evan Debenham
parent
dc70009ae6
commit
13d6beda67
@@ -50,9 +50,9 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
public class WndBag extends WndTabbed {
|
||||
@@ -113,9 +113,8 @@ public class WndBag extends WndTabbed {
|
||||
int slotsWidth = SLOT_SIZE * nCols + SLOT_MARGIN * (nCols - 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.measure();
|
||||
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
|
||||
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
|
||||
add( txtTitle );
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
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.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||
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 {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WndCatalogus extends WndTabbed {
|
||||
|
||||
private static final int ITEM_HEIGHT = 18;
|
||||
|
||||
private BitmapText txtTitle;
|
||||
private RenderedText txtTitle;
|
||||
private ScrollPane list;
|
||||
|
||||
private ArrayList<ListItem> items = new ArrayList<>();
|
||||
@@ -62,9 +62,8 @@ public class WndCatalogus extends WndTabbed {
|
||||
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.measure();
|
||||
add( txtTitle );
|
||||
|
||||
list = new ScrollPane( new Component() ) {
|
||||
@@ -110,7 +109,6 @@ public class WndCatalogus extends WndTabbed {
|
||||
private void updateList() {
|
||||
|
||||
txtTitle.text( Messages.get(this, "title", showPotions ? Messages.get(this, "potions") : Messages.get(this, "scrolls") ) );
|
||||
txtTitle.measure();
|
||||
txtTitle.x = (width - txtTitle.width()) / 2;
|
||||
|
||||
items.clear();
|
||||
@@ -148,7 +146,7 @@ public class WndCatalogus extends WndTabbed {
|
||||
private boolean identified;
|
||||
|
||||
private ItemSprite sprite;
|
||||
private BitmapText label;
|
||||
private RenderedText label;
|
||||
|
||||
public ListItem( Class<? extends Item> cl ) {
|
||||
super();
|
||||
@@ -173,7 +171,7 @@ public class WndCatalogus extends WndTabbed {
|
||||
sprite = new ItemSprite();
|
||||
add( sprite );
|
||||
|
||||
label = PixelScene.createText( 8 );
|
||||
label = PixelScene.renderText( 8 );
|
||||
add( label );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
|
||||
public class WndChallenges extends Window {
|
||||
|
||||
@@ -46,9 +46,8 @@ public class WndChallenges extends Window {
|
||||
|
||||
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.measure();
|
||||
title.x = (WIDTH - title.width()) / 2;
|
||||
title.y = (TTL_HEIGHT - title.height()) / 2;
|
||||
add( title );
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
*/
|
||||
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.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HighlightedText;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
|
||||
public class WndClass extends WndTabbed {
|
||||
|
||||
@@ -116,11 +116,10 @@ public class WndClass extends WndTabbed {
|
||||
pos += GAP;
|
||||
}
|
||||
|
||||
BitmapText dot = PixelScene.createText( DOT, 6 );
|
||||
RenderedText dot = PixelScene.renderText( DOT, 6 );
|
||||
dot.x = MARGIN;
|
||||
dot.y = pos;
|
||||
if (dotWidth == 0) {
|
||||
dot.measure();
|
||||
dotWidth = dot.width();
|
||||
}
|
||||
add( dot );
|
||||
|
||||
@@ -20,30 +20,30 @@
|
||||
*/
|
||||
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.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
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 java.util.Locale;
|
||||
|
||||
public class WndHero extends WndTabbed {
|
||||
|
||||
|
||||
private static final int WIDTH = 100;
|
||||
|
||||
private StatsTab stats;
|
||||
@@ -86,7 +86,7 @@ public class WndHero extends WndTabbed {
|
||||
}
|
||||
|
||||
private class StatsTab extends Group {
|
||||
|
||||
|
||||
private static final int GAP = 5;
|
||||
|
||||
private float pos;
|
||||
@@ -97,7 +97,10 @@ public class WndHero extends WndTabbed {
|
||||
|
||||
IconTitle title = new IconTitle();
|
||||
title.icon( HeroSprite.avatar(hero.heroClass, hero.tier()) );
|
||||
title.label( Messages.get(this, "title", hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ) );
|
||||
if (hero.givenName().equals(hero.className()))
|
||||
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.setRect( 0, 0, WIDTH, 0 );
|
||||
add(title);
|
||||
@@ -140,12 +143,11 @@ public class WndHero extends WndTabbed {
|
||||
|
||||
private void statSlot( String label, String value ) {
|
||||
|
||||
BitmapText txt = PixelScene.createText( label, 8 );
|
||||
RenderedText txt = PixelScene.renderText( label, 8 );
|
||||
txt.y = pos;
|
||||
add( txt );
|
||||
|
||||
txt = PixelScene.createText( value, 8 );
|
||||
txt.measure();
|
||||
txt = PixelScene.renderText( value, 8 );
|
||||
txt.x = 65;
|
||||
txt.y = pos;
|
||||
add( txt );
|
||||
@@ -188,7 +190,7 @@ public class WndHero extends WndTabbed {
|
||||
private Buff buff;
|
||||
|
||||
Image icon;
|
||||
BitmapText txt;
|
||||
RenderedText txt;
|
||||
|
||||
public BuffSlot( Buff buff ){
|
||||
super();
|
||||
@@ -200,7 +202,7 @@ public class WndHero extends WndTabbed {
|
||||
icon.y = this.y;
|
||||
add( icon );
|
||||
|
||||
txt = PixelScene.createText( buff.toString(), 8 );
|
||||
txt = PixelScene.renderText( buff.toString(), 8 );
|
||||
txt.x = icon.width + GAP;
|
||||
txt.y = this.y + (int)(icon.height - txt.baseLine()) / 2;
|
||||
add( txt );
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
@@ -51,15 +52,14 @@ public class WndInfoMob extends WndTitledMessage {
|
||||
private static final int GAP = 2;
|
||||
|
||||
private CharSprite image;
|
||||
private BitmapText name;
|
||||
private RenderedText name;
|
||||
private HealthBar health;
|
||||
private BuffIndicator buffs;
|
||||
|
||||
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.measure();
|
||||
add( name );
|
||||
|
||||
image = mob.sprite();
|
||||
|
||||
@@ -20,19 +20,20 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Journal;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
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.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||
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 {
|
||||
|
||||
@@ -42,7 +43,7 @@ public class WndJournal extends Window {
|
||||
|
||||
private static final int ITEM_HEIGHT = 18;
|
||||
|
||||
private BitmapText txtTitle;
|
||||
private RenderedText txtTitle;
|
||||
private ScrollPane list;
|
||||
|
||||
public WndJournal() {
|
||||
@@ -50,9 +51,8 @@ public class WndJournal extends Window {
|
||||
super();
|
||||
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.measure();
|
||||
txtTitle.x = (WIDTH - txtTitle.width()) / 2;
|
||||
add( txtTitle );
|
||||
|
||||
@@ -79,7 +79,7 @@ public class WndJournal extends Window {
|
||||
|
||||
private static class ListItem extends Component {
|
||||
|
||||
private BitmapText feature;
|
||||
private RenderedText feature;
|
||||
private BitmapText depth;
|
||||
|
||||
private Image icon;
|
||||
@@ -88,7 +88,6 @@ public class WndJournal extends Window {
|
||||
super();
|
||||
|
||||
feature.text( f.desc() );
|
||||
feature.measure();
|
||||
|
||||
depth.text( Integer.toString( d ) );
|
||||
depth.measure();
|
||||
@@ -101,7 +100,7 @@ public class WndJournal extends Window {
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
feature = PixelScene.createText( 9 );
|
||||
feature = PixelScene.renderText( 9 );
|
||||
add( feature );
|
||||
|
||||
depth = new BitmapText( PixelScene.pixelFont);
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
|
||||
public class WndList extends Window {
|
||||
|
||||
@@ -47,11 +48,10 @@ public class WndList extends Window {
|
||||
pos += GAP;
|
||||
}
|
||||
|
||||
BitmapText dot = PixelScene.createText( DOT, 6 );
|
||||
RenderedText dot = PixelScene.renderText( DOT, 6 );
|
||||
dot.x = MARGIN;
|
||||
dot.y = pos;
|
||||
if (dotWidth == 0) {
|
||||
dot.measure();
|
||||
dotWidth = dot.width();
|
||||
}
|
||||
add( dot );
|
||||
|
||||
@@ -20,13 +20,23 @@
|
||||
*/
|
||||
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.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList;
|
||||
@@ -36,21 +46,12 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
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 {
|
||||
|
||||
|
||||
private static final int WIDTH = 115;
|
||||
private static final int HEIGHT = 144;
|
||||
|
||||
|
||||
private Thread thread;
|
||||
private String error = null;
|
||||
|
||||
@@ -139,7 +140,7 @@ public class WndRanking extends WndTabbed {
|
||||
private class StatsTab extends Group {
|
||||
|
||||
private int GAP = 4;
|
||||
|
||||
|
||||
public StatsTab() {
|
||||
super();
|
||||
|
||||
@@ -185,7 +186,7 @@ public class WndRanking extends WndTabbed {
|
||||
pos = statSlot( this, Messages.get(this, "gold"), Integer.toString( Statistics.goldCollected ), pos );
|
||||
|
||||
pos += GAP;
|
||||
|
||||
|
||||
pos = statSlot( this, Messages.get(this, "food"), Integer.toString( Statistics.foodEaten ), pos );
|
||||
pos = statSlot( this, Messages.get(this, "alchemy"), Integer.toString( Statistics.potionsCooked ), pos );
|
||||
pos = statSlot( this, Messages.get(this, "ankhs"), Integer.toString( Statistics.ankhsUsed ), pos );
|
||||
@@ -193,12 +194,11 @@ public class WndRanking extends WndTabbed {
|
||||
|
||||
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;
|
||||
parent.add( txt );
|
||||
|
||||
txt = PixelScene.createText( value, 7 );
|
||||
txt.measure();
|
||||
txt = PixelScene.renderText( value, 7 );
|
||||
txt.x = WIDTH * 0.65f;
|
||||
txt.y = pos;
|
||||
parent.add( txt );
|
||||
@@ -278,7 +278,7 @@ public class WndRanking extends WndTabbed {
|
||||
|
||||
private ItemSlot slot;
|
||||
private ColorBlock bg;
|
||||
private BitmapText name;
|
||||
private RenderedText name;
|
||||
|
||||
public ItemButton( Item item ) {
|
||||
|
||||
@@ -305,7 +305,7 @@ public class WndRanking extends WndTabbed {
|
||||
slot = new ItemSlot();
|
||||
add( slot );
|
||||
|
||||
name = PixelScene.createText( "?", 7 );
|
||||
name = PixelScene.renderText( "?", 7 );
|
||||
add( name );
|
||||
|
||||
super.createChildren();
|
||||
@@ -323,12 +323,10 @@ public class WndRanking extends WndTabbed {
|
||||
|
||||
String str = Utils.capitalize( item.name() );
|
||||
name.text( str );
|
||||
name.measure();
|
||||
if (name.width() > width - name.x) {
|
||||
do {
|
||||
str = str.substring( 0, str.length() - 1 );
|
||||
name.text( str + "..." );
|
||||
name.measure();
|
||||
} 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.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
@@ -160,8 +160,7 @@ public class WndSettings extends WndTabbed {
|
||||
public UITab(){
|
||||
super();
|
||||
|
||||
BitmapText barDesc = PixelScene.createText(Messages.get(this, "mode"), 9);
|
||||
barDesc.measure();
|
||||
RenderedText barDesc = PixelScene.renderText(Messages.get(this, "mode"), 9);
|
||||
barDesc.x = (WIDTH-barDesc.width())/2;
|
||||
add(barDesc);
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.NinePatch;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.ui.Button;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
@@ -192,21 +192,20 @@ public class WndTabbed extends Window {
|
||||
|
||||
protected class LabeledTab extends Tab {
|
||||
|
||||
private BitmapText btLabel;
|
||||
private RenderedText btLabel;
|
||||
|
||||
public LabeledTab( String label ) {
|
||||
|
||||
super();
|
||||
|
||||
btLabel.text( label );
|
||||
btLabel.measure();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
super.createChildren();
|
||||
|
||||
btLabel = PixelScene.createText( 9 );
|
||||
btLabel = PixelScene.renderText( 9 );
|
||||
add( btLabel );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user