Search in sources :

Example 16 with Image

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

the class QuickSlotButton method createChildren.

@Override
protected void createChildren() {
    super.createChildren();
    slot = new ItemSlot() {

        @Override
        protected void onClick() {
            if (!Dungeon.hero.isAlive())
                return;
            if (NoosaInputProcessor.modifier) {
                onLongClick();
                return;
            }
            if (targeting) {
                int cell = autoAim(lastTarget, select(slotNum));
                if (cell != -1) {
                    GameScene.handleCell(cell);
                } else {
                    // couldn't auto-aim, just target the position and hope for the best.
                    GameScene.handleCell(lastTarget.pos);
                }
            } else {
                Item item = select(slotNum);
                if (item.usesTargeting)
                    useTargeting();
                item.execute(Dungeon.hero);
            }
        }

        @Override
        protected boolean onLongClick() {
            return QuickSlotButton.this.onLongClick();
        }

        @Override
        protected void onTouchDown() {
            icon.lightness(0.7f);
        }

        @Override
        protected void onTouchUp() {
            icon.resetColor();
        }
    };
    slot.showParams(true, false, true);
    add(slot);
    crossB = Icons.TARGET.get();
    crossB.visible = false;
    add(crossB);
    crossM = new Image();
    crossM.copy(crossB);
}
Also used : Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Image(com.watabou.noosa.Image)

Example 17 with Image

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

the class StatusPane method createChildren.

@Override
protected void createChildren() {
    bg = new NinePatch(Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0);
    add(bg);
    add(new TouchArea<GameAction>(0, 1, 31, 31) {

        @Override
        protected void onClick(NoosaInputProcessor.Touch touch) {
            Image sprite = Dungeon.hero.sprite;
            if (!sprite.isVisible()) {
                Camera.main.focusOn(sprite);
            }
            GameScene.show(new WndHero());
        }

        @Override
        public boolean onKeyUp(NoosaInputProcessor.Key<GameAction> key) {
            boolean handled = true;
            switch(key.action) {
                case HERO_INFO:
                    onClick(null);
                    break;
                case JOURNAL:
                    GameScene.show(new WndJournal());
                    break;
                default:
                    handled = false;
                    break;
            }
            return handled;
        }
    });
    btnJournal = new JournalButton();
    add(btnJournal);
    btnMenu = new MenuButton();
    add(btnMenu);
    avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier);
    add(avatar);
    compass = new Compass(Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit);
    add(compass);
    rawShielding = new Image(Assets.SHLD_BAR);
    rawShielding.alpha(0.5f);
    add(rawShielding);
    shieldedHP = new Image(Assets.SHLD_BAR);
    add(shieldedHP);
    hp = new Image(Assets.HP_BAR);
    add(hp);
    exp = new Image(Assets.XP_BAR);
    add(exp);
    bossHP = new BossHealthBar();
    add(bossHP);
    level = new BitmapText(PixelScene.pixelFont);
    level.hardlight(0xFFEBA4);
    add(level);
    depth = new BitmapText(Integer.toString(Dungeon.depth), PixelScene.pixelFont);
    depth.hardlight(0xCACFC2);
    depth.measure();
    add(depth);
    danger = new DangerIndicator();
    add(danger);
    buffs = new BuffIndicator(Dungeon.hero);
    add(buffs);
    add(pickedUp = new Toolbar.PickedUpItem());
}
Also used : WndJournal(com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal) NinePatch(com.watabou.noosa.NinePatch) Image(com.watabou.noosa.Image) WndHero(com.shatteredpixel.shatteredpixeldungeon.windows.WndHero) BitmapText(com.watabou.noosa.BitmapText) NoosaInputProcessor(com.watabou.input.NoosaInputProcessor) GameAction(com.shatteredpixel.shatteredpixeldungeon.input.GameAction)

Example 18 with Image

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

the class IconTitle method createChildren.

@Override
protected void createChildren() {
    imIcon = new Image();
    add(imIcon);
    tfLabel = PixelScene.renderMultiline((int) FONT_SIZE);
    tfLabel.hardlight(Window.TITLE_COLOR);
    add(tfLabel);
    health = new HealthBar();
    add(health);
}
Also used : HealthBar(com.shatteredpixel.shatteredpixeldungeon.ui.HealthBar) Image(com.watabou.noosa.Image)

Example 19 with Image

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

the class DungeonTilemap method discover.

public void discover(int pos) {
    final Image tile = tile(pos);
    if (tile == null) {
        return;
    }
    tile.point(tileToWorld(pos));
    // For bright mode
    tile.rm = tile.gm = tile.bm = rm;
    tile.ra = tile.ga = tile.ba = ra;
    getParent().add(tile);
    getParent().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)

Example 20 with Image

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

the class VariativeDungeonTilemap method tile.

@Override
public Image tile(int pos) {
    CompositeImage img = new CompositeImage(getTexture());
    img.frame(getTileset().get(data[pos]));
    Image deco = new Image(getTexture());
    deco.frame(getTileset().get(mDecoMap[pos]));
    img.addLayer(deco);
    return img;
}
Also used : CompositeImage(com.watabou.noosa.CompositeImage) CompositeImage(com.watabou.noosa.CompositeImage) 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