Search in sources :

Example 6 with Image

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

the class HeroSprite method avatar.

public static Image avatar(HeroClass cl, int armorTier) {
    RectF patch = tiers().get(armorTier);
    Image avatar = new Image(cl.spritesheet());
    RectF frame = avatar.texture.uvRect(1, 0, FRAME_WIDTH, FRAME_HEIGHT);
    frame.offset(patch.left, patch.top);
    avatar.frame(frame);
    return avatar;
}
Also used : RectF(android.graphics.RectF) Image(com.watabou.noosa.Image)

Example 7 with Image

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

the class BuffIndicator method layout.

@Override
protected void layout() {
    clear();
    SparseArray<Image> newIcons = new SparseArray<Image>();
    for (Buff buff : ch.buffs()) {
        int icon = buff.icon();
        if (icon != NONE) {
            Image img = new Image(texture);
            img.frame(film.get(icon));
            img.x = x + members.size() * (SIZE + 2);
            img.y = y;
            add(img);
            newIcons.put(icon, img);
        }
    }
    for (Integer key : icons.keyArray()) {
        if (newIcons.get(key) == null) {
            Image icon = icons.get(key);
            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);
                }
            });
        }
    }
    icons = newIcons;
}
Also used : SparseArray(com.watabou.utils.SparseArray) AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Image(com.watabou.noosa.Image) Buff(com.watabou.pixeldungeon.actors.buffs.Buff)

Example 8 with Image

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

the class BitmaskEmitter method emit.

@Override
protected void emit(int index) {
    RectF frame = ((Image) target).frame();
    float ofsX = frame.left * mapW;
    float ofsY = frame.top * mapH;
    float x, y;
    do {
        x = Random.Float(frame.width()) * mapW;
        y = Random.Float(frame.height()) * mapH;
    } while ((map.getPixel((int) (x + ofsX), (int) (y + ofsY)) & 0x000000FF) == 0);
    factory.emit(this, index, target.x + x * target.scale.x, target.y + y * target.scale.y);
}
Also used : RectF(com.watabou.utils.RectF) Image(com.watabou.noosa.Image)

Example 9 with Image

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

the class BadgeBanner method image.

public static Image image(int index) {
    Image image = new Image(Assets.BADGES);
    if (atlas == null) {
        atlas = new TextureFilm(image.texture, 16, 16);
    }
    image.frame(atlas.get(index));
    return image;
}
Also used : Image(com.watabou.noosa.Image) TextureFilm(com.watabou.noosa.TextureFilm)

Example 10 with Image

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

the class DungeonTilemap method discover.

public void discover(int pos, int oldValue) {
    int visual = getTileVisual(pos, oldValue, false);
    if (visual < 0)
        return;
    final Image tile = new Image(texture);
    tile.frame(tileset.get(getTileVisual(pos, oldValue, false)));
    tile.point(tileToWorld(pos));
    parent.add(tile);
    parent.add(new AlphaTweener(tile, 0, 0.6f) {

        protected void onComplete() {
            tile.killAndErase();
            killAndErase();
        }
    });
}
Also used : AlphaTweener(com.watabou.noosa.tweeners.AlphaTweener) Image(com.watabou.noosa.Image) Point(com.watabou.utils.Point)

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