本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite类的典型用法代码示例。如果您正苦于以下问题:Java ItemSprite类的具体用法?Java ItemSprite怎么用?Java ItemSprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemSprite类属于com.shatteredpixel.shatteredpixeldungeon.sprites包,在下文中一共展示了ItemSprite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChildren
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
shield = new ItemSprite( ItemSpriteSheet.TOMB, null );
add( shield );
position = new BitmapText( PixelScene.font1x );
position.alpha(0.8f);
add( position );
desc = createMultiline( 7 );
add( desc );
depth = new BitmapText( PixelScene.font1x );
depth.alpha(0.8f);
steps = new Image();
classIcon = new Image();
add( classIcon );
level = new BitmapText( PixelScene.font1x );
level.alpha(0.8f);
}
示例2: fillFields
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的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()) );
}
示例3: createChildren
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
icon = new ItemSprite();
add( icon );
topLeft = new BitmapText( PixelScene.font1x );
add( topLeft );
topRight = new BitmapText( PixelScene.font1x );
add( topRight );
bottomRight = new BitmapText( PixelScene.font1x );
add( bottomRight );
}
示例4: fillFields
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private void fillFields( int image, ItemSprite.Glowing glowing, int titleColor, String title, String info ) {
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( image, glowing ) );
titlebar.label( Messages.titleCase( title ), titleColor );
titlebar.setRect( 0, 0, width, 0 );
add( titlebar );
RenderedTextMultiline txtInfo = PixelScene.renderMultiline( info, 6 );
txtInfo.maxWidth(width);
txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
add( txtInfo );
resize( width, (int)(txtInfo.top() + txtInfo.height()) );
}
示例5: placeTitle
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
protected void placeTitle( Bag bag, int width ){
RenderedText txtTitle = PixelScene.renderText(
title != null ? Messages.titleCase(title) : Messages.titleCase( bag.name() ), 9 );
txtTitle.hardlight( TITLE_COLOR );
txtTitle.x = 1;
txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.baseLine()) / 2f - 1;
PixelScene.align(txtTitle);
add( txtTitle );
ItemSprite gold = new ItemSprite(ItemSpriteSheet.GOLD, null);
gold.x = width - gold.width() - 1;
gold.y = (TITLE_HEIGHT - gold.height())/2f - 1;
PixelScene.align(gold);
add(gold);
BitmapText amt = new BitmapText( Integer.toString(Dungeon.gold), PixelScene.pixelFont );
amt.hardlight(TITLE_COLOR);
amt.measure();
amt.x = width - gold.width() - amt.width() - 2;
amt.y = (TITLE_HEIGHT - amt.baseLine())/2f - 1;
PixelScene.align(amt);
add(amt);
}
示例6: WndImp
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public WndImp( final Imp imp, final DwarfToken tokens ) {
super();
IconTitle titlebar = new IconTitle();
titlebar.icon( new ItemSprite( tokens.image(), null ) );
titlebar.label( Messages.titleCase( tokens.name() ) );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
RenderedTextMultiline message = PixelScene.renderMultiline( Messages.get(this, "message"), 6 );
message.maxWidth(WIDTH);
message.setPos(0, titlebar.bottom() + GAP);
add( message );
RedButton btnReward = new RedButton( Messages.get(this, "reward") ) {
@Override
protected void onClick() {
takeReward( imp, tokens, Imp.Quest.reward );
}
};
btnReward.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnReward );
resize( WIDTH, (int)btnReward.bottom() );
}
示例7: splash
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
protected void splash( int cell ) {
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
final int color = ItemSprite.pick( image, 8, 10 );
Char ch = Actor.findChar(cell);
if (ch != null) {
Buff.detach(ch, Burning.class);
Buff.detach(ch, Ooze.class);
Splash.at( ch.sprite.center(), color, 5 );
} else {
Splash.at( cell, color, 5 );
}
}
示例8: CatalogItem
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public CatalogItem(Item item, boolean IDed, boolean seen ) {
super( new ItemSprite(item), Messages.titleCase(item.trueName()));
this.item = item;
this.seen = seen;
if (!seen) {
icon.copy( new ItemSprite( ItemSpriteSheet.WEAPON_HOLDER + currentItemIdx, null) );
label.text("???");
label.hardlight( 0x999999 );
} else if (!IDed) {
icon.copy( new ItemSprite( ItemSpriteSheet.WEAPON_HOLDER + currentItemIdx, null) );
label.hardlight( 0xCCCCCC );
}
}
示例9: createChildren
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
icon = new ItemSprite();
add( icon );
topLeft = new BitmapText( PixelScene.pixelFont);
add( topLeft );
topRight = new BitmapText( PixelScene.pixelFont);
add( topRight );
bottomRight = new BitmapText( PixelScene.pixelFont);
add( bottomRight );
}
示例10: reset
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public void reset( Item item, int cell, float endX, float endY ) {
view( item );
active =
visible =
true;
PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell);
Point screen = Camera.main.cameraToScreen(tile.x, tile.y);
PointF start = camera().screenToCamera(screen.x, screen.y);
x = this.startX = start.x - ItemSprite.SIZE / 2;
y = this.startY = start.y - ItemSprite.SIZE / 2;
this.endX = endX - ItemSprite.SIZE / 2;
this.endY = endY - ItemSprite.SIZE / 2;
left = DURATION;
scale.set( startScale = Camera.main.zoom / camera().zoom );
}
示例11: reset
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public void reset( Item item, int cell, float endX, float endY ) {
view( item );
active =
visible =
true;
PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell);
Point screen = Camera.main.cameraToScreen(tile.x, tile.y);
PointF start = camera().screenToCamera(screen.x, screen.y);
x = this.startX = start.x - ItemSprite.SIZE / 2;
y = this.startY = start.y - ItemSprite.SIZE / 2;
this.endX = endX - ItemSprite.SIZE / 2;
this.endY = endY - ItemSprite.SIZE / 2;
left = DURATION;
scale.set( startScale = Camera.main.zoom / camera().zoom );
}
示例12: WndWandmaker
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的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( TXT_BATTLE ) {
@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( TXT_NON_BATTLE ) {
@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() );
}
示例13: WndImp
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的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() );
}
示例14: createDescription
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private float createDescription( Item item, boolean forSale ) {
// Title
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 );
// Upgraded / degraded
if (item.levelKnown && item.level > 0) {
titlebar.color( ItemSlot.UPGRADED );
} else if (item.levelKnown && item.level < 0) {
titlebar.color( ItemSlot.DEGRADED );
}
// Description
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();
}
示例15: createChildren
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
sprite = new ItemSprite();
add( sprite );
label = PixelScene.createText( 8 );
add( label );
}