Search in sources :

Example 1 with ItemSprite

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();
}
Also used : HighlightedText(com.watabou.pixeldungeon.ui.HighlightedText) ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite)

Example 2 with ItemSprite

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()));
}
Also used : ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite) BitmapTextMultiline(com.watabou.noosa.BitmapTextMultiline)

Example 3 with ItemSprite

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();
}
Also used : ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite) BitmapTextMultiline(com.watabou.noosa.BitmapTextMultiline)

Example 4 with ItemSprite

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);
}
Also used : BitmapText(com.watabou.noosa.BitmapText) ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite)

Example 5 with ItemSprite

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);
}
Also used : ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite) DiscardedItemSprite(com.watabou.pixeldungeon.sprites.DiscardedItemSprite)

Aggregations

ItemSprite (com.watabou.pixeldungeon.sprites.ItemSprite)5 BitmapTextMultiline (com.watabou.noosa.BitmapTextMultiline)2 BitmapText (com.watabou.noosa.BitmapText)1 DiscardedItemSprite (com.watabou.pixeldungeon.sprites.DiscardedItemSprite)1 HighlightedText (com.watabou.pixeldungeon.ui.HighlightedText)1