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);
}
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();
}
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;
}
Aggregations