use of com.watabou.noosa.BitmapText in project pixel-dungeon by watabou.
the class StatusPane method createChildren.
@Override
protected void createChildren() {
shield = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 0);
add(shield);
add(new TouchArea(0, 1, 30, 30) {
@Override
protected void onClick(Touch touch) {
Image sprite = Dungeon.hero.sprite;
if (!sprite.isVisible()) {
Camera.main.focusOn(sprite);
}
GameScene.show(new WndHero());
}
});
btnMenu = new MenuButton();
add(btnMenu);
avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier);
add(avatar);
blood = new BitmaskEmitter(avatar);
blood.pour(BloodParticle.FACTORY, 0.3f);
blood.autoKill = false;
blood.on = false;
add(blood);
compass = new Compass(Dungeon.level.exit);
add(compass);
hp = new Image(Assets.HP_BAR);
add(hp);
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);
Dungeon.hero.belongings.countIronKeys();
keys = new BitmapText(PixelScene.font1x);
keys.hardlight(0xCACFC2);
add(keys);
danger = new DangerIndicator();
add(danger);
loot = new LootIndicator();
add(loot);
resume = new ResumeButton();
add(resume);
buffs = new BuffIndicator(Dungeon.hero);
add(buffs);
}
use of com.watabou.noosa.BitmapText in project shattered-pixel-dungeon-gdx by 00-Evan.
the class PixelScene method createText.
public static BitmapText createText(String text, float size) {
chooseFont(size);
BitmapText result = new BitmapText(text, font);
result.scale.set(scale);
return result;
}
use of com.watabou.noosa.BitmapText in project shattered-pixel-dungeon-gdx by 00-Evan.
the class TitleScene method create.
@Override
public void create() {
super.create();
Music.INSTANCE.play(Assets.THEME, true);
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 topRegion = Math.max(95f, h * 0.45f);
title.x = (w - title.width()) / 2f;
if (SPDSettings.landscape())
title.y = (topRegion - title.height()) / 2f;
else
title.y = 16 + (topRegion - title.height() - 16) / 2f;
align(title);
placeTorch(title.x + 22, title.y + 46);
placeTorch(title.x + title.width - 22, title.y + 46);
Image signs = new Image(BannerSprites.get(BannerSprites.Type.PIXEL_DUNGEON_SIGNS)) {
private float time = 0;
@Override
public void update() {
super.update();
am = Math.max(0f, (float) Math.sin(time += Game.elapsed));
if (time >= 1.5f * Math.PI)
time = 0;
}
@Override
public void draw() {
Blending.setLightMode();
super.draw();
Blending.setNormalMode();
}
};
signs.x = title.x + (title.width() - signs.width()) / 2f;
signs.y = title.y;
add(signs);
DashboardItem btnBadges = new DashboardItem(Messages.get(this, "badges"), 3) {
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(BadgesScene.class);
}
};
add(btnBadges);
DashboardItem btnAbout = new DashboardItem(Messages.get(this, "about"), 1) {
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(AboutScene.class);
}
};
add(btnAbout);
DashboardItem btnPlay = new DashboardItem(Messages.get(this, "play"), 0) {
@Override
protected void onClick() {
if (GamesInProgress.checkAll().size() == 0) {
TitleScene.this.add(new WndStartGame(1));
} else {
ShatteredPixelDungeon.switchNoFade(StartScene.class);
}
}
};
add(btnPlay);
DashboardItem btnRankings = new DashboardItem(Messages.get(this, "rankings"), 2) {
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(RankingsScene.class);
}
};
add(btnRankings);
if (SPDSettings.landscape()) {
btnRankings.setPos(w / 2 - btnRankings.width(), topRegion);
btnBadges.setPos(w / 2, topRegion);
btnPlay.setPos(btnRankings.left() - btnPlay.width(), topRegion);
btnAbout.setPos(btnBadges.right(), topRegion);
} else {
btnPlay.setPos(w / 2 - btnPlay.width(), topRegion);
btnRankings.setPos(w / 2, btnPlay.top());
btnBadges.setPos(w / 2 - btnBadges.width(), btnPlay.top() + DashboardItem.SIZE);
btnAbout.setPos(w / 2, btnBadges.top());
}
BitmapText version = new BitmapText("v " + Game.version + "", pixelFont);
version.measure();
version.hardlight(0xCCCCCC);
version.x = w - version.width();
version.y = h - version.height();
add(version);
Button changes = new ChangesButton();
changes.setPos(w - changes.width(), h - version.height() - changes.height());
add(changes);
int pos = 0;
PrefsButton btnPrefs = new PrefsButton();
btnPrefs.setRect(pos, 0, 16, 16);
add(btnPrefs);
pos += btnPrefs.width();
LanguageButton btnLang = new LanguageButton();
btnLang.setRect(pos, 0, 14, 16);
add(btnLang);
ExitButton btnExit = new ExitButton();
btnExit.setPos(w - btnExit.width(), 0);
add(btnExit);
UpdateNotification updInfo = new UpdateNotification();
updInfo.setPos(0, h - updInfo.height());
add(updInfo);
fadeIn();
}
use of com.watabou.noosa.BitmapText in project shattered-pixel-dungeon-gdx by 00-Evan.
the class DangerIndicator method createChildren.
@Override
protected void createChildren() {
super.createChildren();
number = new BitmapText(PixelScene.pixelFont);
add(number);
icon = Icons.SKULL.get();
add(icon);
}
use of com.watabou.noosa.BitmapText in project shattered-pixel-dungeon-gdx by 00-Evan.
the class GoldIndicator method createChildren.
@Override
protected void createChildren() {
tf = new BitmapText(PixelScene.pixelFont);
tf.hardlight(0xFFFF00);
add(tf);
visible = false;
}
Aggregations