Search in sources :

Example 6 with ItemSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

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 : DiscardedItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.DiscardedItemSprite) ItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)

Example 7 with ItemSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class WndTradeItem method createDescription.

private float createDescription(Item item, boolean forSale) {
    // Title
    IconTitle titlebar = new IconTitle();
    titlebar.icon(new ItemSprite(item));
    titlebar.label(forSale ? Messages.get(this, "sale", item.toString(), price(item)) : Messages.titleCase(item.toString()));
    titlebar.setRect(0, 0, WIDTH, 0);
    add(titlebar);
    // Upgraded / degraded
    if (item.levelKnown) {
        if (item.level() < 0) {
            titlebar.color(ItemSlot.DEGRADED);
        } else if (item.level() > 0) {
            titlebar.color(ItemSlot.UPGRADED);
        }
    }
    // Description
    RenderedTextMultiline info = PixelScene.renderMultiline(item.info(), 6);
    info.maxWidth(WIDTH);
    info.setPos(titlebar.left(), titlebar.bottom() + GAP);
    add(info);
    return info.bottom();
}
Also used : RenderedTextMultiline(com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline) ItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)

Example 8 with ItemSprite

use of com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Combo method getIcon.

@Override
public Image getIcon() {
    Image icon;
    if (((Hero) target).belongings.weapon != null) {
        icon = new ItemSprite(((Hero) target).belongings.weapon.image, null);
    } else {
        icon = new ItemSprite(new Item() {

            {
                image = ItemSpriteSheet.WEAPON_HOLDER;
            }
        });
    }
    if (count >= 10)
        icon.tint(0xFFFF0000);
    else if (count >= 8)
        icon.tint(0xFFFFCC00);
    else if (count >= 6)
        icon.tint(0xFFFFFF00);
    else if (count >= 4)
        icon.tint(0xFFCCFF00);
    else
        icon.tint(0xFF00FF00);
    return icon;
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Hero(com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero) ItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite) Image(com.watabou.noosa.Image)

Aggregations

ItemSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)8 RenderedTextMultiline (com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline)2 BitmapText (com.watabou.noosa.BitmapText)2 Image (com.watabou.noosa.Image)2 RenderedText (com.watabou.noosa.RenderedText)2 Hero (com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero)1 Ankh (com.shatteredpixel.shatteredpixeldungeon.items.Ankh)1 DewVial (com.shatteredpixel.shatteredpixeldungeon.items.DewVial)1 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)1 Honeypot (com.shatteredpixel.shatteredpixeldungeon.items.Honeypot)1 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)1 Stylus (com.shatteredpixel.shatteredpixeldungeon.items.Stylus)1 Torch (com.shatteredpixel.shatteredpixeldungeon.items.Torch)1 PlateArmor (com.shatteredpixel.shatteredpixeldungeon.items.armor.PlateArmor)1 CloakOfShadows (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows)1 DriedRose (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose)1 EtherealChains (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.EtherealChains)1 HornOfPlenty (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty)1 TalismanOfForesight (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight)1 TimekeepersHourglass (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass)1