use of com.watabou.noosa.Image in project pixel-dungeon by watabou.
the class HeroSprite method avatar.
public static Image avatar(HeroClass cl, int armorTier) {
RectF patch = tiers().get(armorTier);
Image avatar = new Image(cl.spritesheet());
RectF frame = avatar.texture.uvRect(1, 0, FRAME_WIDTH, FRAME_HEIGHT);
frame.offset(patch.left, patch.top);
avatar.frame(frame);
return avatar;
}
use of com.watabou.noosa.Image in project pixel-dungeon by watabou.
the class BuffIndicator method layout.
@Override
protected void layout() {
clear();
SparseArray<Image> newIcons = new SparseArray<Image>();
for (Buff buff : ch.buffs()) {
int icon = buff.icon();
if (icon != NONE) {
Image img = new Image(texture);
img.frame(film.get(icon));
img.x = x + members.size() * (SIZE + 2);
img.y = y;
add(img);
newIcons.put(icon, img);
}
}
for (Integer key : icons.keyArray()) {
if (newIcons.get(key) == null) {
Image icon = icons.get(key);
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);
}
});
}
}
icons = newIcons;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BitmaskEmitter method emit.
@Override
protected void emit(int index) {
RectF frame = ((Image) target).frame();
float ofsX = frame.left * mapW;
float ofsY = frame.top * mapH;
float x, y;
do {
x = Random.Float(frame.width()) * mapW;
y = Random.Float(frame.height()) * mapH;
} while ((map.getPixel((int) (x + ofsX), (int) (y + ofsY)) & 0x000000FF) == 0);
factory.emit(this, index, target.x + x * target.scale.x, target.y + y * target.scale.y);
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class BadgeBanner method image.
public static Image image(int index) {
Image image = new Image(Assets.BADGES);
if (atlas == null) {
atlas = new TextureFilm(image.texture, 16, 16);
}
image.frame(atlas.get(index));
return image;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class DungeonTilemap method discover.
public void discover(int pos, int oldValue) {
int visual = getTileVisual(pos, oldValue, false);
if (visual < 0)
return;
final Image tile = new Image(texture);
tile.frame(tileset.get(getTileVisual(pos, oldValue, false)));
tile.point(tileToWorld(pos));
parent.add(tile);
parent.add(new AlphaTweener(tile, 0, 0.6f) {
protected void onComplete() {
tile.killAndErase();
killAndErase();
}
});
}
Aggregations