本文整理汇总了Java中com.watabou.noosa.BitmapTextMultiline类的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextMultiline类的具体用法?Java BitmapTextMultiline怎么用?Java BitmapTextMultiline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BitmapTextMultiline类属于com.watabou.noosa包,在下文中一共展示了BitmapTextMultiline类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fillFields
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
private void fillFields( int image, ItemSprite.Glowing glowing, int titleColor, String title, String info ) {
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( image, glowing ) );
titlebar.label( Utils.capitalize( title ), titleColor );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline txtInfo = PixelScene.createMultiline( info, 6 );
txtInfo.maxWidth = WIDTH;
txtInfo.measure();
txtInfo.x = titlebar.left();
txtInfo.y = titlebar.bottom() + GAP;
add( txtInfo );
resize( WIDTH, (int)(txtInfo.y + txtInfo.height()) );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:18,代码来源:WndInfoItem.java
示例2: WndInfoPlant
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndInfoPlant( Plant plant ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new PlantSprite( plant.image ) );
titlebar.label( plant.plantName );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline info = PixelScene.createMultiline( 6 );
add( info );
info.text( plant.desc() );
info.maxWidth = WIDTH;
info.measure();
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
resize( WIDTH, (int)(info.y + info.height()) );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:22,代码来源:WndInfoPlant.java
示例3: WndInfoBuff
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndInfoBuff(Buff buff){
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get( Assets.BUFFS_LARGE );
film = new TextureFilm( icons, 16, 16 );
Image buffIcon = new Image( icons );
buffIcon.frame( film.get(buff.icon()) );
titlebar.icon( buffIcon );
titlebar.label( Utils.capitalize(buff.toString()), Window.TITLE_COLOR );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline txtInfo = PixelScene.createMultiline(buff.desc(), 6);
txtInfo.maxWidth = WIDTH;
txtInfo.measure();
txtInfo.x = titlebar.left();
txtInfo.y = titlebar.bottom() + GAP;
add( txtInfo );
resize( WIDTH, (int)(txtInfo.y + txtInfo.height()) );
}
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:26,代码来源:WndInfoBuff.java
示例4: WndChanges
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndChanges() {
super();
resize( WIDTH, HEIGHT );
txtTitle = PixelScene.createText(TXT_TITLE, 9);
txtTitle.hardlight( Window.SHPX_COLOR );
txtTitle.measure();
txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 );
add( txtTitle );
BitmapTextMultiline txtChanges = PixelScene.createMultiline(TXT_CHANGES, 9);
Component content = new Component();
content.add(txtChanges);
text = new ScrollPane( content ) {
};
add( text );
text.setRect( 0, txtTitle.height(), WIDTH, HEIGHT - txtTitle.height() );
}
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:23,代码来源:WndChanges.java
示例5: createDescription
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
private float createDescription( Item item, boolean forSale ) {
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( item.image(), item.glowing() ) );
titlebar.label( forSale ?
Utils.format( TXT_SALE, item.toString(), price( item ) ) :
Utils.capitalize( item.toString() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
if (item.levelKnown && item.level > 0) {
titlebar.color( ItemSlot.UPGRADED );
} else if (item.levelKnown && item.level < 0) {
titlebar.color( ItemSlot.DEGRADED );
}
BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 );
info.maxWidth = WIDTH;
info.measure();
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
add( info );
return info.y + info.height();
}
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:26,代码来源:WndTradeItem.java
示例6: WndList
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndList(String[] items) {
super();
float pos = MARGIN;
float dotWidth = 0;
float maxWidth = 0;
for (int i = 0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
BitmapText dot = PixelScene.createText(DOT, 6);
dot.x = MARGIN;
dot.y = pos;
if (dotWidth == 0) {
dot.measure();
dotWidth = dot.width();
}
add(dot);
BitmapTextMultiline item = PixelScene.createMultiline(items[i], 6);
item.x = dot.x + dotWidth;
item.y = pos;
item.maxWidth = (int) (WIDTH - MARGIN * 2 - dotWidth);
item.measure();
add(item);
pos += item.height();
float w = item.width();
if (w > maxWidth) {
maxWidth = w;
}
}
resize((int) (maxWidth + dotWidth + MARGIN * 2), (int) (pos + MARGIN));
}
开发者ID:G2159687,项目名称:ESPD,代码行数:40,代码来源:WndList.java
示例7: WndList
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndList( String[] items ) {
super();
float pos = MARGIN;
float dotWidth = 0;
float maxWidth = 0;
for (int i=0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
RenderedText dot = PixelScene.renderText( "-", 6 );
dot.x = MARGIN;
dot.y = pos;
if (dotWidth == 0) {
dotWidth = dot.width();
}
add( dot );
BitmapTextMultiline item = PixelScene.createMultiline( items[i], 6 );
item.x = dot.x + dotWidth;
item.y = pos;
item.maxWidth = (int)(WIDTH - MARGIN * 2 - dotWidth);
item.measure();
add( item );
pos += item.height();
float w = item.width();
if (w > maxWidth) {
maxWidth = w;
}
}
resize( (int)(maxWidth + dotWidth + MARGIN * 2), (int)(pos + MARGIN) );
}
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:39,代码来源:WndList.java
示例8: PerksTab
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public PerksTab() {
super();
float dotWidth = 0;
String[] items = cl.perks();
float pos = MARGIN;
for (int i=0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
BitmapText dot = PixelScene.createText( DOT, 6 );
dot.x = MARGIN;
dot.y = pos;
if (dotWidth == 0) {
dot.measure();
dotWidth = dot.width();
}
add( dot );
BitmapTextMultiline item = PixelScene.createMultiline( items[i], 6 );
item.x = dot.x + dotWidth;
item.y = pos;
item.maxWidth = (int)(WIDTH - MARGIN * 2 - dotWidth);
item.measure();
add( item );
pos += item.height();
float w = item.width();
if (w > width) {
width = w;
}
}
width += MARGIN + dotWidth;
height = pos + MARGIN;
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:41,代码来源:WndClass.java
示例9: WndImp
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndImp( final Imp imp, final DwarfToken tokens ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( tokens.image(), null ) );
titlebar.label( Utils.capitalize( tokens.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
message.maxWidth = WIDTH;
message.measure();
message.y = titlebar.bottom() + GAP;
add( message );
RedButton btnReward = new RedButton( TXT_REWARD ) {
@Override
protected void onClick() {
takeReward( imp, tokens, Imp.Quest.reward );
}
};
btnReward.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnReward );
resize( WIDTH, (int)btnReward.bottom() );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:28,代码来源:WndImp.java
示例10: WndMessage
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndMessage( String text ) {
super();
BitmapTextMultiline info = PixelScene.createMultiline( text, 6 );
info.maxWidth = (PixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2;
info.measure();
info.x = info.y = MARGIN;
add( info );
resize(
(int)info.width() + MARGIN * 2,
(int)info.height() + MARGIN * 2 );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:15,代码来源:WndMessage.java
示例11: createDescription
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
private float createDescription( Item item, boolean forSale ) {
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( item.image(), item.glowing() ) );
titlebar.label( forSale ?
Utils.format( TXT_SALE, item.toString(), price( item ) ) :
Utils.capitalize( item.toString() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
if (item.levelKnown) {
if (item.level() < 0) {
titlebar.color( ItemSlot.DEGRADED );
} else if (item.level() > 0) {
titlebar.color( item.isBroken() ? ItemSlot.WARNING : ItemSlot.UPGRADED );
}
}
BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 );
info.maxWidth = WIDTH;
info.measure();
info.x = titlebar.left();
info.y = titlebar.bottom() + GAP;
add( info );
return info.y + info.height();
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:28,代码来源:WndTradeItem.java
示例12: WndOptions
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndOptions( String title, String message, String... options ) {
super();
BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 );
tfTitle.hardlight( TITLE_COLOR );
tfTitle.x = tfTitle.y = MARGIN;
tfTitle.maxWidth = WIDTH - MARGIN * 2;
tfTitle.measure();
add( tfTitle );
BitmapTextMultiline tfMesage = PixelScene.createMultiline( message, 8 );
tfMesage.maxWidth = WIDTH - MARGIN * 2;
tfMesage.measure();
tfMesage.x = MARGIN;
tfMesage.y = tfTitle.y + tfTitle.height() + MARGIN;
add( tfMesage );
float pos = tfMesage.y + tfMesage.height() + MARGIN;
for (int i=0; i < options.length; i++) {
final int index = i;
RedButton btn = new RedButton( options[i] ) {
@Override
protected void onClick() {
hide();
onSelect( index );
}
};
btn.setRect( MARGIN, pos, WIDTH - MARGIN * 2, BUTTON_HEIGHT );
add( btn );
pos += BUTTON_HEIGHT + MARGIN;
}
resize( WIDTH, (int)pos );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:37,代码来源:WndOptions.java
示例13: WndBadge
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的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 );
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:32,代码来源:WndBadge.java
示例14: layout
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
@Override
protected void layout() {
float pos = y;
for (int i=length-1; i >= 0; i--) {
BitmapTextMultiline entry = (BitmapTextMultiline)members.get( i );
entry.x = x;
entry.y = pos - entry.height();
pos -= entry.height();
}
}
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:11,代码来源:GameLog.java
示例15: WndWandmaker
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndWandmaker( final Wandmaker wandmaker, final Item item ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( item.image(), null ) );
titlebar.label( Utils.capitalize( item.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
message.maxWidth = WIDTH;
message.measure();
message.y = titlebar.bottom() + GAP;
add( message );
RedButton btnBattle = new RedButton( Wandmaker.Quest.wand1.name( true) ) {
@Override
protected void onClick() {
selectReward( wandmaker, item, Wandmaker.Quest.wand1 );
}
};
btnBattle.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnBattle );
RedButton btnNonBattle = new RedButton( Wandmaker.Quest.wand2.name( true ) ) {
@Override
protected void onClick() {
selectReward( wandmaker, item, Wandmaker.Quest.wand2 );
}
};
btnNonBattle.setRect( 0, btnBattle.bottom() + GAP, WIDTH, BTN_HEIGHT );
add( btnNonBattle );
resize( WIDTH, (int)btnNonBattle.bottom() );
}
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:37,代码来源:WndWandmaker.java
示例16: WndSadGhost
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndSadGhost( final Ghost ghost, final Item item ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( item.image(), null ) );
titlebar.label( Utils.capitalize( item.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
BitmapTextMultiline message = PixelScene.createMultiline( item instanceof DriedRose ? TXT_ROSE : TXT_RAT, 6 );
message.maxWidth = WIDTH;
message.measure();
message.y = titlebar.bottom() + GAP;
add( message );
RedButton btnWeapon = new RedButton( Ghost.Quest.weapon.toString() ) {
@Override
protected void onClick() {
selectReward( ghost, item, Ghost.Quest.weapon );
}
};
btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnWeapon );
RedButton btnArmor = new RedButton( Ghost.Quest.armor.toString() ) {
@Override
protected void onClick() {
selectReward( ghost, item, Ghost.Quest.armor );
}
};
btnArmor.setRect( 0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT );
add( btnArmor );
resize( WIDTH, (int)btnArmor.bottom() );
}
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:37,代码来源:WndSadGhost.java
示例17: HistoryTab
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public HistoryTab() {
super();
String[] items = cl.history();
float pos = MARGIN;
for (int i=0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
BitmapTextMultiline item = PixelScene.createMultiline( items[i], 6 );
item.x = MARGIN;
item.y = pos;
item.maxWidth = WIDTH - MARGIN * 2;
item.measure();
add( item );
pos += item.height();
float w = item.width();
if (w > width) {
width = w;
}
}
width += MARGIN;
height = pos + MARGIN;
}
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:30,代码来源:WndClass.java
示例18: DetailsTab
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public DetailsTab() {
super();
float dotWidth = 0;
String[] items = cl.details();
float pos = MARGIN;
for (int i=0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
BitmapText dot = PixelScene.createText( DOT, 6 );
dot.x = MARGIN;
dot.y = pos;
if (dotWidth == 0) {
dot.measure();
dotWidth = dot.width();
}
add( dot );
BitmapTextMultiline item = PixelScene.createMultiline( items[i], 6 );
item.x = dot.x + dotWidth;
item.y = pos;
item.maxWidth = (int)(WIDTH - MARGIN * 2 - dotWidth);
item.measure();
add( item );
pos += item.height();
float w = item.width();
if (w > width) {
width = w;
}
}
width += MARGIN + dotWidth;
height = pos + MARGIN;
}
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:41,代码来源:WndClass.java
示例19: WndMessage
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public WndMessage( String text ) {
super();
BitmapTextMultiline info = PixelScene.createMultiline( text, 6 );
info.maxWidth = (YetAnotherPixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2;
info.measure();
info.x = info.y = MARGIN;
add( info );
resize(
(int)info.width() + MARGIN * 2,
(int)info.height() + MARGIN * 2 );
}
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:15,代码来源:WndMessage.java
示例20: PerksTab
import com.watabou.noosa.BitmapTextMultiline; //导入依赖的package包/类
public PerksTab() {
super();
float dotWidth = 0;
String[] items = cl.perks();
float pos = MARGIN;
for (int i=0; i < items.length; i++) {
if (i > 0) {
pos += GAP;
}
BitmapText dot = PixelScene.createText( DOT, 6 );
dot.x = MARGIN;
dot.y = pos;
if (dotWidth == 0) {
dot.measure();
dotWidth = dot.width();
}
add( dot );
BitmapTextMultiline item = PixelScene.createMultiline( items[i], 6 );
item.x = dot.x + dotWidth;
item.y = pos;
item.maxWidth = (int)(WIDTH - MARGIN * 2 - dotWidth);
item.measure();
add( item );
pos += item.height();
float w = item.width();
if (w > width) {
width = w;
}
}
width += MARGIN + dotWidth;
height = pos + MARGIN;
}
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:41,代码来源:WndClass.java
注:本文中的com.watabou.noosa.BitmapTextMultiline类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论