Search in sources :

Example 6 with BitmapText

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

the class WndBag method placeTitle.

protected void placeTitle(Bag bag, int width) {
    RenderedText txtTitle = PixelScene.renderText(title != null ? Messages.titleCase(title) : Messages.titleCase(bag.name()), 9);
    txtTitle.hardlight(TITLE_COLOR);
    txtTitle.x = 1;
    txtTitle.y = (int) (TITLE_HEIGHT - txtTitle.baseLine()) / 2f - 1;
    PixelScene.align(txtTitle);
    add(txtTitle);
    ItemSprite gold = new ItemSprite(ItemSpriteSheet.GOLD, null);
    gold.x = width - gold.width() - 1;
    gold.y = (TITLE_HEIGHT - gold.height()) / 2f - 1;
    PixelScene.align(gold);
    add(gold);
    BitmapText amt = new BitmapText(Integer.toString(Dungeon.gold), PixelScene.pixelFont);
    amt.hardlight(TITLE_COLOR);
    amt.measure();
    amt.x = width - gold.width() - amt.width() - 2;
    amt.y = (TITLE_HEIGHT - amt.baseLine()) / 2f - 1;
    PixelScene.align(amt);
    add(amt);
}
Also used : BitmapText(com.watabou.noosa.BitmapText) RenderedText(com.watabou.noosa.RenderedText) ItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)

Example 7 with BitmapText

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

the class ItemSlot method createChildren.

@Override
protected void createChildren() {
    super.createChildren();
    icon = new ItemSprite();
    add(icon);
    topLeft = new BitmapText(PixelScene.pixelFont);
    add(topLeft);
    topRight = new BitmapText(PixelScene.pixelFont);
    add(topRight);
    bottomRight = new BitmapText(PixelScene.pixelFont);
    add(bottomRight);
}
Also used : BitmapText(com.watabou.noosa.BitmapText) ItemSprite(com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)

Example 8 with BitmapText

use of com.watabou.noosa.BitmapText 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 9 with BitmapText

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

the class DangerIndicator method createChildren.

@Override
protected void createChildren() {
    super.createChildren();
    number = new BitmapText(PixelScene.font1x);
    add(number);
    icon = Icons.SKULL.get();
    add(icon);
}
Also used : BitmapText(com.watabou.noosa.BitmapText)

Example 10 with BitmapText

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

the class GoldIndicator method createChildren.

@Override
protected void createChildren() {
    tf = new BitmapText(PixelScene.font1x);
    tf.hardlight(0xFFFF00);
    add(tf);
    setVisible(false);
}
Also used : BitmapText(com.watabou.noosa.BitmapText)

Aggregations

BitmapText (com.watabou.noosa.BitmapText)20 Image (com.watabou.noosa.Image)6 Archs (com.watabou.pixeldungeon.ui.Archs)4 ExitButton (com.watabou.pixeldungeon.ui.ExitButton)4 NinePatch (com.watabou.noosa.NinePatch)3 ItemSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite)2 Touch (com.watabou.input.Touchscreen.Touch)2 TouchArea (com.watabou.noosa.TouchArea)2 Emitter (com.watabou.noosa.particles.Emitter)2 ItemSprite (com.watabou.pixeldungeon.sprites.ItemSprite)2 WndHero (com.watabou.pixeldungeon.windows.WndHero)2 Callback (com.watabou.utils.Callback)2 WndHeroSpells (com.nyrds.pixeldungeon.windows.WndHeroSpells)1 GameAction (com.shatteredpixel.shatteredpixeldungeon.input.GameAction)1 Archs (com.shatteredpixel.shatteredpixeldungeon.ui.Archs)1 ChangesButton (com.shatteredpixel.shatteredpixeldungeon.ui.ChangesButton)1 ExitButton (com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton)1 LanguageButton (com.shatteredpixel.shatteredpixeldungeon.ui.LanguageButton)1 PrefsButton (com.shatteredpixel.shatteredpixeldungeon.ui.PrefsButton)1 UpdateNotification (com.shatteredpixel.shatteredpixeldungeon.ui.UpdateNotification)1