use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class TerrainFeaturesTilemap method tile.
public static Image tile(int pos, int tile) {
RectF uv = instance.tileset.get(instance.getTileVisual(pos, tile, true));
if (uv == null)
return null;
Image img = new Image(instance.texture);
img.frame(uv);
return img;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BuffIndicator method layout.
@Override
protected void layout() {
ArrayList<Buff> newBuffs = new ArrayList<>();
for (Buff buff : ch.buffs()) {
if (buff.icon() != NONE) {
newBuffs.add(buff);
}
}
// remove any icons no longer present
for (Buff buff : buffIcons.keySet().toArray(new Buff[0])) {
if (!newBuffs.contains(buff)) {
Image icon = buffIcons.get(buff).icon;
icon.origin.set(SIZE / 2);
add(icon);
add(new AlphaTweener(icon, 0, 0.6f) {
@Override
protected void updateValues(float progress) {
super.updateValues(progress);
image.scale.set(1 + 5 * progress);
}
@Override
protected void onComplete() {
image.killAndErase();
}
});
buffIcons.get(buff).destroy();
remove(buffIcons.get(buff));
buffIcons.remove(buff);
}
}
// add new icons
for (Buff buff : newBuffs) {
if (!buffIcons.containsKey(buff)) {
BuffIcon icon = new BuffIcon(buff);
add(icon);
buffIcons.put(buff, icon);
}
}
// layout
int pos = 0;
for (BuffIcon icon : buffIcons.values()) {
icon.updateIcon();
icon.setRect(x + pos * (SIZE + 2), y, 9, 12);
pos++;
}
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BossHealthBar method createChildren.
@Override
protected void createChildren() {
bar = new Image(asset, 0, 0, 64, 16);
add(bar);
width = bar.width;
height = bar.height;
hp = new Image(asset, 15, 19, 47, 4);
add(hp);
skull = new Image(asset, 5, 18, 6, 6);
add(skull);
blood = new Emitter();
blood.pos(skull);
blood.pour(BloodParticle.FACTORY, 0.3f);
blood.autoKill = false;
blood.on = false;
add(blood);
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class DungeonTerrainTilemap method tile.
public static Image tile(int pos, int tile) {
Image img = new Image(instance.texture);
img.frame(instance.tileset.get(instance.getTileVisual(pos, tile, true)));
return img;
}
use of com.watabou.noosa.Image in project pixel-dungeon-remix by NYRDS.
the class AboutScene method create.
@Override
public void create() {
super.create();
Text text = createText(getTXT(), null);
text.camera = uiCamera;
text.x = align((Camera.main.width - text.width()) / 2);
text.y = align((Camera.main.height - text.height()) / 3);
Text email = createTouchEmail(Game.getVar(R.string.AboutScene_Mail), text);
Text visit = createText(Game.getVar(R.string.AboutScene_OurSite), email);
Text site = createTouchLink(LNK, visit);
createText("\n" + getTRN(), site);
Image nyrdie = Icons.NYRDIE.get();
nyrdie.x = align(text.x + (text.width() - nyrdie.width) / 2);
nyrdie.y = text.y - nyrdie.height - 8;
add(nyrdie);
new Flare(7, 64).color(0x332211, true).show(nyrdie, 0).angularSpeed = -20;
Archs archs = new Archs();
archs.setSize(Camera.main.width, Camera.main.height);
addToBack(archs);
ExitButton btnExit = new ExitButton();
btnExit.setPos(Camera.main.width - btnExit.width(), 0);
add(btnExit);
fadeIn();
}
Aggregations