Search in sources :

Example 26 with Image

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

the class SimpleButton method createChildren.

@Override
protected void createChildren() {
    image = new Image();
    add(image);
    add(new TouchArea(image) {

        @Override
        protected void onTouchDown(Touch touch) {
            image.brightness(1.2f);
        }

        @Override
        protected void onTouchUp(Touch touch) {
            image.brightness(1.0f);
        }

        @Override
        protected void onClick(Touch touch) {
            SimpleButton.this.onClick();
        }
    });
}
Also used : TouchArea(com.watabou.noosa.TouchArea) Image(com.watabou.noosa.Image) Touch(com.watabou.input.Touchscreen.Touch)

Example 27 with Image

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

the class StatusPane method createChildren.

@Override
protected void createChildren() {
    shield = new NinePatch(Assets.getStatus(), 80, 0, 30 + 18, 0);
    add(shield);
    add(new TouchArea(0, 1, 30, 30) {

        @Override
        protected void onClick(Touch touch) {
            Image sprite = hero.getSprite();
            if (!sprite.isVisible()) {
                Camera.main.focusOn(sprite);
            }
            GameScene.show(new WndHero());
        }
    });
    avatar = hero.getHeroSprite().avatar();
    add(avatar);
    blood = new Emitter();
    blood.pos(avatar);
    blood.pour(BloodParticle.FACTORY, 0.3f);
    blood.autoKill = false;
    blood.on = false;
    add(blood);
    int compassTarget = currentLevel.entrance;
    if (currentLevel.hasCompassTarget()) {
        // Set to compass target if exists
        compassTarget = currentLevel.getCompassTarget();
    } else if (currentLevel.hasExit(0)) {
        // Set to first exit if exists
        compassTarget = currentLevel.getExit(0);
    }
    compass = new Compass(compassTarget, currentLevel);
    add(compass);
    hp = new Image(Assets.HP_BAR);
    add(hp);
    sp = new Image(Assets.SP_BAR);
    add(sp);
    exp = new Image(Assets.XP_BAR);
    add(exp);
    level = new BitmapText(PixelScene.font1x);
    level.hardlight(0xFFEBA4);
    add(level);
    depth = new BitmapText(Integer.toString(Dungeon.depth), PixelScene.font1x);
    depth.hardlight(0xCACFC2);
    depth.measure();
    add(depth);
    hero.belongings.countIronKeys();
    keys = new BitmapText(PixelScene.font1x);
    keys.hardlight(0xCACFC2);
    add(keys);
    danger = new DangerIndicator();
    add(danger);
    loot = new LootIndicator();
    add(loot);
    buffs = new BuffIndicator(hero);
    add(buffs);
    btnMenu = new MenuButton(new Image(Assets.getStatus(), 114, 3, 12, 11), WndGame.class);
    add(btnMenu);
    btnHats = new MenuButton(new Image(Assets.getStatus(), 114, 18, 12, 11), WndHats.class);
    btnSpells = new MenuButton(new Image(Assets.getStatus(), 2, 33, 12, 11), WndHeroSpells.class);
    if (!Flavours.haveHats()) {
        btnHats.enable(false);
    }
    if (!hero.spellUser) {
        btnSpells.enable(false);
    }
    add(btnSpells);
    add(btnHats);
}
Also used : Emitter(com.watabou.noosa.particles.Emitter) NinePatch(com.watabou.noosa.NinePatch) WndGame(com.watabou.pixeldungeon.windows.WndGame) Touch(com.watabou.input.Touchscreen.Touch) Image(com.watabou.noosa.Image) CompositeTextureImage(com.watabou.noosa.CompositeTextureImage) WndHero(com.watabou.pixeldungeon.windows.WndHero) WndHats(com.watabou.pixeldungeon.windows.WndHats) TouchArea(com.watabou.noosa.TouchArea) BitmapText(com.watabou.noosa.BitmapText) WndHeroSpells(com.nyrds.pixeldungeon.windows.WndHeroSpells)

Example 28 with Image

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

the class Tool method createChildren.

@Override
protected void createChildren() {
    super.createChildren();
    base = new Image(Assets.getToolbar());
    add(base);
}
Also used : Image(com.watabou.noosa.Image)

Example 29 with Image

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

the class IconTitle method createChildren.

@Override
protected void createChildren() {
    imIcon = new Image();
    add(imIcon);
    tfLabel = PixelScene.createMultiline(GuiProperties.titleFontSize());
    tfLabel.hardlight(Window.TITLE_COLOR);
    add(tfLabel);
}
Also used : Image(com.watabou.noosa.Image)

Example 30 with Image

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

the class QuickSlot method createChildren.

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

        @Override
        protected void onClick() {
            if (targeting) {
                GameScene.handleCell(lastTarget.getPos());
            } else {
                Item item = select();
                if (item == lastItem) {
                    useTargeting();
                } else {
                    lastItem = item;
                }
                if (item != null) {
                    item.execute(Dungeon.hero);
                }
            }
        }

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

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

        @Override
        protected void onTouchUp() {
            icon.resetColor();
        }
    };
    add(slot);
    crossB = Icons.TARGET.get();
    crossB.setVisible(false);
    add(crossB);
    crossM = new Image();
    crossM.copy(crossB);
}
Also used : Item(com.watabou.pixeldungeon.items.Item) 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