use of com.watabou.noosa.BitmapText in project pixel-dungeon-remix by NYRDS.
the class ItemSlot method createChildren.
@Override
protected void createChildren() {
super.createChildren();
icon = new ItemSprite();
add(icon);
emitter = new Emitter();
add(emitter);
topLeft = new BitmapText(PixelScene.font1x);
topLeft.setScale(0.8f, 0.8f);
add(topLeft);
topRight = new BitmapText(PixelScene.font1x);
topRight.setScale(0.8f, 0.8f);
add(topRight);
bottomRight = new BitmapText(PixelScene.font1x);
bottomRight.setScale(0.8f, 0.8f);
add(bottomRight);
}
use of com.watabou.noosa.BitmapText 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);
}
use of com.watabou.noosa.BitmapText in project pixel-dungeon by watabou.
the class RankingsScene method create.
@Override
public void create() {
super.create();
Music.INSTANCE.play(Assets.THEME, true);
Music.INSTANCE.volume(1f);
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
archs = new Archs();
archs.setSize(w, h);
add(archs);
Rankings.INSTANCE.load();
if (Rankings.INSTANCE.records.size() > 0) {
float rowHeight = PixelDungeon.landscape() ? ROW_HEIGHT_L : ROW_HEIGHT_P;
float left = (w - Math.min(MAX_ROW_WIDTH, w)) / 2 + GAP;
float top = align((h - rowHeight * Rankings.INSTANCE.records.size()) / 2);
BitmapText title = PixelScene.createText(TXT_TITLE, 9);
title.hardlight(Window.TITLE_COLOR);
title.measure();
title.x = align((w - title.width()) / 2);
title.y = align(top - title.height() - GAP);
add(title);
int pos = 0;
for (Rankings.Record rec : Rankings.INSTANCE.records) {
Record row = new Record(pos, pos == Rankings.INSTANCE.lastRecord, rec);
row.setRect(left, top + pos * rowHeight, w - left * 2, rowHeight);
add(row);
pos++;
}
if (Rankings.INSTANCE.totalNumber >= Rankings.TABLE_SIZE) {
BitmapText label = PixelScene.createText(TXT_TOTAL, 8);
label.hardlight(DEFAULT_COLOR);
label.measure();
add(label);
BitmapText won = PixelScene.createText(Integer.toString(Rankings.INSTANCE.wonNumber), 8);
won.hardlight(Window.TITLE_COLOR);
won.measure();
add(won);
BitmapText total = PixelScene.createText("/" + Rankings.INSTANCE.totalNumber, 8);
total.hardlight(DEFAULT_COLOR);
total.measure();
total.x = align((w - total.width()) / 2);
total.y = align(top + pos * rowHeight + GAP);
add(total);
float tw = label.width() + won.width() + total.width();
label.x = align((w - tw) / 2);
won.x = label.x + label.width();
total.x = won.x + won.width();
label.y = won.y = total.y = align(top + pos * rowHeight + GAP);
}
} else {
BitmapText title = PixelScene.createText(TXT_NO_GAMES, 8);
title.hardlight(DEFAULT_COLOR);
title.measure();
title.x = align((w - title.width()) / 2);
title.y = align((h - title.height()) / 2);
add(title);
}
ExitButton btnExit = new ExitButton();
btnExit.setPos(Camera.main.width - btnExit.width(), 0);
add(btnExit);
fadeIn();
}
use of com.watabou.noosa.BitmapText in project pixel-dungeon by watabou.
the class TitleScene method create.
@Override
public void create() {
super.create();
Music.INSTANCE.play(Assets.THEME, true);
Music.INSTANCE.volume(1f);
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Archs archs = new Archs();
archs.setSize(w, h);
add(archs);
Image title = BannerSprites.get(BannerSprites.Type.PIXEL_DUNGEON);
add(title);
float height = title.height + (PixelDungeon.landscape() ? DashboardItem.SIZE : DashboardItem.SIZE * 2);
title.x = (w - title.width()) / 2;
title.y = (h - height) / 2;
placeTorch(title.x + 18, title.y + 20);
placeTorch(title.x + title.width - 18, title.y + 20);
Image signs = new Image(BannerSprites.get(BannerSprites.Type.PIXEL_DUNGEON_SIGNS)) {
private float time = 0;
@Override
public void update() {
super.update();
am = (float) Math.sin(-(time += Game.elapsed));
}
@Override
public void draw() {
GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);
super.draw();
GLES20.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
}
};
signs.x = title.x;
signs.y = title.y;
add(signs);
DashboardItem btnBadges = new DashboardItem(TXT_BADGES, 3) {
@Override
protected void onClick() {
PixelDungeon.switchNoFade(BadgesScene.class);
}
};
add(btnBadges);
DashboardItem btnAbout = new DashboardItem(TXT_ABOUT, 1) {
@Override
protected void onClick() {
PixelDungeon.switchNoFade(AboutScene.class);
}
};
add(btnAbout);
DashboardItem btnPlay = new DashboardItem(TXT_PLAY, 0) {
@Override
protected void onClick() {
PixelDungeon.switchNoFade(StartScene.class);
}
};
add(btnPlay);
DashboardItem btnHighscores = new DashboardItem(TXT_HIGHSCORES, 2) {
@Override
protected void onClick() {
PixelDungeon.switchNoFade(RankingsScene.class);
}
};
add(btnHighscores);
if (PixelDungeon.landscape()) {
float y = (h + height) / 2 - DashboardItem.SIZE;
btnHighscores.setPos(w / 2 - btnHighscores.width(), y);
btnBadges.setPos(w / 2, y);
btnPlay.setPos(btnHighscores.left() - btnPlay.width(), y);
btnAbout.setPos(btnBadges.right(), y);
} else {
btnBadges.setPos(w / 2 - btnBadges.width(), (h + height) / 2 - DashboardItem.SIZE);
btnAbout.setPos(w / 2, (h + height) / 2 - DashboardItem.SIZE);
btnPlay.setPos(w / 2 - btnPlay.width(), btnAbout.top() - DashboardItem.SIZE);
btnHighscores.setPos(w / 2, btnPlay.top());
}
BitmapText version = new BitmapText("v " + Game.version, font1x);
version.measure();
version.hardlight(0x888888);
version.x = w - version.width();
version.y = h - version.height();
add(version);
PrefsButton btnPrefs = new PrefsButton();
btnPrefs.setPos(0, 0);
add(btnPrefs);
ExitButton btnExit = new ExitButton();
btnExit.setPos(w - btnExit.width(), 0);
add(btnExit);
fadeIn();
}
use of com.watabou.noosa.BitmapText in project pixel-dungeon by watabou.
the class GoldIndicator method createChildren.
@Override
protected void createChildren() {
tf = new BitmapText(PixelScene.font1x);
tf.hardlight(0xFFFF00);
add(tf);
visible = false;
}
Aggregations