use of com.watabou.pixeldungeon.sprites.ItemSprite in project pixel-dungeon by watabou.
the class WndChooseWay method createCommonStuff.
private float createCommonStuff(TomeOfMastery tome, String text) {
IconTitle titlebar = new IconTitle();
titlebar.icon(new ItemSprite(tome.image(), null));
titlebar.label(tome.name());
titlebar.setRect(0, 0, WIDTH, 0);
add(titlebar);
HighlightedText hl = new HighlightedText(6);
hl.text(text, WIDTH);
hl.setPos(titlebar.left(), titlebar.bottom() + GAP);
add(hl);
return hl.bottom();
}
use of com.watabou.pixeldungeon.sprites.ItemSprite in project pixel-dungeon by watabou.
the class WndInfoItem method fillFields.
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()));
}
use of com.watabou.pixeldungeon.sprites.ItemSprite in project pixel-dungeon by watabou.
the class WndTradeItem method createDescription.
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();
}
use of com.watabou.pixeldungeon.sprites.ItemSprite in project pixel-dungeon by watabou.
the class ItemSlot method createChildren.
@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);
}
use of com.watabou.pixeldungeon.sprites.ItemSprite in project pixel-dungeon by watabou.
the class GameScene method addHeapSprite.
private void addHeapSprite(Heap heap) {
ItemSprite sprite = heap.sprite = (ItemSprite) heaps.recycle(ItemSprite.class);
sprite.revive();
sprite.link(heap);
heaps.add(sprite);
}
Aggregations