Search in sources :

Example 51 with Image

use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.

the class TerrainFeaturesTilemap method tile.

public static Image tile(int pos, int tile) {
    RectF uv = instance.tileset.get(instance.getTileVisual(pos, tile, true));
    if (uv == null)
        return null;
    Image img = new Image(instance.texture);
    img.frame(uv);
    return img;
}
Also used : RectF(com.watabou.utils.RectF) Image(com.watabou.noosa.Image)

Example 52 with Image

use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.

the class BuffIndicator method layout.

@Override
protected void layout() {
    ArrayList<Buff> newBuffs = new ArrayList<>();
    for (Buff buff : ch.buffs()) {
        if (buff.icon() != NONE) {
            newBuffs.add(buff);
        }
    }
    // remove any icons no longer present
    for (Buff buff : buffIcons.keySet().toArray(new Buff[0])) {
        if (!newBuffs.contains(buff)) {
            Image icon = buffIcons.get(buff).icon;
            icon.origin.set(SIZE / 2);
            add(icon);
            add(new AlphaTweener(icon, 0, 0.6f) {

                @Override
                protected void updateValues(float progress) {
                    super.updateValues(progress);
                    image.scale.set(1 + 5 * progress);
                }

                @Override
                protected void onComplete() {
                    image.killAndErase();
                }
            });
            buffIcons.get(buff).destroy();
            remove(buffIcons.get(buff));
            buffIcons.remove(buff);
        }
    }
    // add new icons
    for (Buff buff : newBuffs) {
        if (!buffIcons.containsKey(buff)) {
            BuffIcon icon = new BuffIcon(buff);
            add(icon);
            buffIcons.put(buff, icon);
        }
    }
    // layout
    int pos = 0;
    for (BuffIcon icon : buffIcons.values()) {
        icon.updateIcon();
        icon.setRect(x + pos * (SIZE + 2), y, 9, 12);
        pos++;
    }
}
Also used : ArrayList(java.util.ArrayList) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Buff(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff) WndInfoBuff(com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoBuff) Image(com.watabou.noosa.Image)

Example 53 with Image

use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.

the class BossHealthBar method createChildren.

@Override
protected void createChildren() {
    bar = new Image(asset, 0, 0, 64, 16);
    add(bar);
    width = bar.width;
    height = bar.height;
    hp = new Image(asset, 15, 19, 47, 4);
    add(hp);
    skull = new Image(asset, 5, 18, 6, 6);
    add(skull);
    blood = new Emitter();
    blood.pos(skull);
    blood.pour(BloodParticle.FACTORY, 0.3f);
    blood.autoKill = false;
    blood.on = false;
    add(blood);
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) Image(com.watabou.noosa.Image)

Example 54 with Image

use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.

the class DungeonTerrainTilemap method tile.

public static Image tile(int pos, int tile) {
    Image img = new Image(instance.texture);
    img.frame(instance.tileset.get(instance.getTileVisual(pos, tile, true)));
    return img;
}
Also used : Image(com.watabou.noosa.Image)

Example 55 with Image

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

the class AboutScene method create.

@Override
public void create() {
    super.create();
    Text text = createText(getTXT(), null);
    text.camera = uiCamera;
    text.x = align((Camera.main.width - text.width()) / 2);
    text.y = align((Camera.main.height - text.height()) / 3);
    Text email = createTouchEmail(Game.getVar(R.string.AboutScene_Mail), text);
    Text visit = createText(Game.getVar(R.string.AboutScene_OurSite), email);
    Text site = createTouchLink(LNK, visit);
    createText("\n" + getTRN(), site);
    Image nyrdie = Icons.NYRDIE.get();
    nyrdie.x = align(text.x + (text.width() - nyrdie.width) / 2);
    nyrdie.y = text.y - nyrdie.height - 8;
    add(nyrdie);
    new Flare(7, 64).color(0x332211, true).show(nyrdie, 0).angularSpeed = -20;
    Archs archs = new Archs();
    archs.setSize(Camera.main.width, Camera.main.height);
    addToBack(archs);
    ExitButton btnExit = new ExitButton();
    btnExit.setPos(Camera.main.width - btnExit.width(), 0);
    add(btnExit);
    fadeIn();
}
Also used : Flare(com.watabou.pixeldungeon.effects.Flare) Archs(com.watabou.pixeldungeon.ui.Archs) ExitButton(com.watabou.pixeldungeon.ui.ExitButton) Text(com.watabou.noosa.Text) Image(com.watabou.noosa.Image)

Aggregations

Image (com.watabou.noosa.Image)63 TouchArea (com.watabou.noosa.TouchArea)10 Group (com.watabou.noosa.Group)8 Archs (com.watabou.pixeldungeon.ui.Archs)8 Touch (com.watabou.input.Touchscreen.Touch)7 BitmapText (com.watabou.noosa.BitmapText)6 Emitter (com.watabou.noosa.particles.Emitter)6 AlphaTweener (com.watabou.noosa.tweeners.AlphaTweener)6 ExitButton (com.watabou.pixeldungeon.ui.ExitButton)6 Archs (com.shatteredpixel.shatteredpixeldungeon.ui.Archs)4 NinePatch (com.watabou.noosa.NinePatch)4 Text (com.watabou.noosa.Text)4 Flare (com.watabou.pixeldungeon.effects.Flare)4 Point (com.watabou.utils.Point)4 ExitButton (com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton)3 NoosaInputProcessor (com.watabou.input.NoosaInputProcessor)3 TextureFilm (com.watabou.noosa.TextureFilm)3 RedButton (com.watabou.pixeldungeon.ui.RedButton)3 RectF (android.graphics.RectF)2 Flare (com.shatteredpixel.shatteredpixeldungeon.effects.Flare)2