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();
}
});
}
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);
}
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);
}
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);
}
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);
}
Aggregations