Search in sources :

Example 1 with CompositeTextureImage

use of com.watabou.noosa.CompositeTextureImage in project pixel-dungeon-remix by NYRDS.

the class Library method infoHeader.

public static EntryHeader infoHeader(String category, String clazz) {
    EntryHeader ret = new EntryHeader();
    if (category.equals(ITEM)) {
        Item item = ItemFactory.itemByName(clazz);
        ret.header = Utils.capitalize(item.name());
        ret.icon = new ItemSprite(item);
        return ret;
    }
    if (category.equals(MOB)) {
        Mob mob = MobFactory.mobByName(clazz);
        ret.header = Utils.capitalize(mob.getName());
        ret.icon = new CompositeTextureImage();
        ((CompositeTextureImage) ret.icon).copy(mob.sprite().avatar());
        return ret;
    }
    throw new TrackedRuntimeException("unknown category: " + category);
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndInfoItem(com.watabou.pixeldungeon.windows.WndInfoItem) WndInfoMob(com.watabou.pixeldungeon.windows.WndInfoMob) Mob(com.watabou.pixeldungeon.actors.mobs.Mob) CompositeTextureImage(com.watabou.noosa.CompositeTextureImage) TrackedRuntimeException(com.nyrds.android.util.TrackedRuntimeException) ItemSprite(com.watabou.pixeldungeon.sprites.ItemSprite)

Example 2 with CompositeTextureImage

use of com.watabou.noosa.CompositeTextureImage in project pixel-dungeon-remix by NYRDS.

the class CharSprite method avatar.

public CompositeTextureImage avatar() {
    CompositeTextureImage avatar = new CompositeTextureImage(texture);
    avatar.frame(idle.frames[0]);
    avatar.addLayer(texture);
    return avatar;
}
Also used : CompositeTextureImage(com.watabou.noosa.CompositeTextureImage)

Example 3 with CompositeTextureImage

use of com.watabou.noosa.CompositeTextureImage in project pixel-dungeon-remix by NYRDS.

the class HeroSpriteDef method avatar.

@Override
public CompositeTextureImage avatar() {
    if (avatar == null) {
        avatar = new CompositeTextureImage(texture);
        avatar.frame(idle.frames[0]);
    }
    avatar.clearLayers();
    avatar.addLayer(getLayerTexture(LAYER_BODY));
    avatar.addLayer(getLayerTexture(LAYER_HEAD));
    avatar.addLayer(getLayerTexture(LAYER_HAIR));
    avatar.addLayer(getLayerTexture(LAYER_ARMOR));
    avatar.addLayer(getLayerTexture(LAYER_FACIAL_HAIR));
    avatar.addLayer(getLayerTexture(LAYER_HELMET));
    avatar.addLayer(getLayerTexture(LAYER_DEATH));
    avatar.addLayer(getLayerTexture(LAYER_ACCESSORY));
    return avatar;
}
Also used : CompositeTextureImage(com.watabou.noosa.CompositeTextureImage)

Aggregations

CompositeTextureImage (com.watabou.noosa.CompositeTextureImage)3 TrackedRuntimeException (com.nyrds.android.util.TrackedRuntimeException)1 Mob (com.watabou.pixeldungeon.actors.mobs.Mob)1 Item (com.watabou.pixeldungeon.items.Item)1 ItemSprite (com.watabou.pixeldungeon.sprites.ItemSprite)1 WndInfoItem (com.watabou.pixeldungeon.windows.WndInfoItem)1 WndInfoMob (com.watabou.pixeldungeon.windows.WndInfoMob)1