本文整理汇总了Java中com.watabou.noosa.BitmapText.height方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapText.height方法的具体用法?Java BitmapText.height怎么用?Java BitmapText.height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.noosa.BitmapText
的用法示例。
在下文中一共展示了BitmapText.height方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WndBadge
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBadge( Badges.Badge badge ) {
super();
Image icon = BadgeBanner.image( badge.image );
icon.scale.set( 2 );
add( icon );
BitmapTextMultiline info = PixelScene.createMultiline( badge.description, 8 );
info.maxWidth = WIDTH - MARGIN * 2;
info.measure();
float w = Math.max( icon.width(), info.width() ) + MARGIN * 2;
icon.x = (w - icon.width()) / 2;
icon.y = MARGIN;
float pos = icon.y + icon.height() + MARGIN;
for (BitmapText line : info.new LineSplitter().split()) {
line.measure();
line.x = PixelScene.align( (w - line.width()) / 2 );
line.y = PixelScene.align( pos );
add( line );
pos += line.height();
}
resize( (int)w, (int)(pos + MARGIN) );
BadgeBanner.highlight( icon, badge.image );
}
示例2: WndBadge
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBadge( Badges.Badge badge ) {
super();
Image icon = BadgeBanner.image( badge.image );
icon.scale.set( 2 );
add( icon );
BitmapTextMultiline info = PixelScene.createMultiline( badge.description, 8 );
info.maxWidth = WIDTH - MARGIN * 2;
info.measure();
float w = Math.max( icon.width(), info.width() ) + MARGIN * 2;
icon.x = (w - icon.width()) / 2;
icon.y = MARGIN;
float pos = icon.y + icon.height() + MARGIN;
for (BitmapText line : info.new LineSplitter().split()) {
line.measure();
line.x = PixelScene.align( (w - line.width()) / 2 );
line.y = PixelScene.align( pos );
add( line );
pos += line.height();
}
resize( (int)w, (int)(pos + MARGIN) );
BadgeBanner.highlight( icon, badge.image );
}
示例3: WndChallenges
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndChallenges( int checked, boolean editable ) {
super();
this.editable = editable;
BitmapText title = PixelScene.createText( TITLE, 9 );
title.hardlight( TITLE_COLOR );
title.measure();
title.x = PixelScene.align( camera, (WIDTH - title.width()) / 2 );
add( title );
boxes = new ArrayList<CheckBox>();
float pos = title.height() + GAP;
for (int i=0; i < Challenges.NAMES.length; i++) {
CheckBox cb = new CheckBox( Challenges.NAMES[i] );
cb.checked( (checked & Challenges.MASKS[i]) != 0 );
cb.active = editable;
if (i > 0) {
pos += GAP;
}
cb.setRect( 0, pos, WIDTH, BTN_HEIGHT );
pos = cb.bottom();
add( cb );
boxes.add( cb );
}
resize( WIDTH, (int)pos );
}
示例4: WndBag
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
nCols = PixelDungeon.landscape() ? COLS_L : COLS_P;
nRows = (Belongings.BACKPACK_SIZE + 4 + 1) / nCols + ((Belongings.BACKPACK_SIZE + 4 + 1) % nCols > 0 ? 1 : 0);
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 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( WandHolster.class ),
stuff.getItem( Keyring.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
tab.setSize( TAB_WIDTH, tabHeight() );
add( tab );
tab.select( b == bag );
}
}
}
示例5: WndBag
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
nCols = YetAnotherPixelDungeon.landscape() ? COLS_L : COLS_P;
nRows = YetAnotherPixelDungeon.landscape() ? ROWS_L : ROWS_P ;
// nRows = (Belongings.BACKPACK_SIZE + 4 + 1) / nCols + ((Belongings.BACKPACK_SIZE + 4 + 1) % nCols > 0 ? 1 : 0) + ( !YetAnotherPixelDungeon.landscape() ? 1 : 0 );
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 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
ArrayList<Bag> bags = new ArrayList<>();
bags.add( stuff.backpack );
bags.add( stuff.getItem( Keyring.class ) );
bags.add( stuff.getItem( HerbPouch.class ) );
bags.add( stuff.getItem( PotionSash.class ) );
bags.add( stuff.getItem( ScrollHolder.class ) );
bags.add( stuff.getItem( WandHolster.class ) );
while(bags.remove(null));
int tabWidth = ( slotsWidth + 12 ) / bags.size() ;
for (Bag b : bags) {
BagTab tab = new BagTab( b );
tab.setSize( tabWidth, tabHeight() );
add( tab );
tab.select( b == bag );
}
}
示例6: WndBag
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
nCols = ShatteredPixelDungeon.landscape() ? COLS_L : COLS_P;
nRows = (Belongings.BACKPACK_SIZE + 4 + 1) / nCols + ((Belongings.BACKPACK_SIZE + 4 + 1) % nCols > 0 ? 1 : 0);
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 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( PotionBandolier.class ),
stuff.getItem( WandHolster.class ),
stuff.getItem( AnkhChain.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
add( tab );
tab.select( b == bag );
}
}
layoutTabs();
}
示例7: WndBag
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
BitmapText txtTitle = PixelScene.createText( title != null ? title : Utils.capitalize( bag.name() ), 9 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(SLOT_SIZE * COLS + SLOT_MARGIN * (COLS - 1) - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize(
SLOT_SIZE * COLS + SLOT_MARGIN * (COLS - 1),
SLOT_SIZE * ROWS + SLOT_MARGIN * (ROWS - 1) + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( WandHolster.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
tab.setSize( TAB_WIDTH, tabHeight() );
add( tab );
tab.select( b == bag );
}
}
}
示例8: WndBag
import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
super();
this.listener = listener;
this.mode = mode;
this.title = title;
lastMode = mode;
lastBag = bag;
nCols = ShatteredPixelDungeon.landscape() ? COLS_L : COLS_P;
nRows = (Belongings.BACKPACK_SIZE + 4 + 1) / nCols + ((Belongings.BACKPACK_SIZE + 4 + 1) % nCols > 0 ? 1 : 0);
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 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.measure();
txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
add( txtTitle );
placeItems( bag );
resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
Belongings stuff = Dungeon.hero.belongings;
Bag[] bags = {
stuff.backpack,
stuff.getItem( SeedPouch.class ),
stuff.getItem( ScrollHolder.class ),
stuff.getItem( PotionBandolier.class ),
stuff.getItem( WandHolster.class )};
for (Bag b : bags) {
if (b != null) {
BagTab tab = new BagTab( b );
add( tab );
tab.select( b == bag );
}
}
layoutTabs();
}