Search in sources :

Example 1 with CompositeImage

use of com.watabou.noosa.CompositeImage in project pixel-dungeon-remix by NYRDS.

the class VariativeDungeonTilemap method tile.

@Override
public Image tile(int pos) {
    CompositeImage img = new CompositeImage(getTexture());
    img.frame(getTileset().get(data[pos]));
    Image deco = new Image(getTexture());
    deco.frame(getTileset().get(mDecoMap[pos]));
    img.addLayer(deco);
    return img;
}
Also used : CompositeImage(com.watabou.noosa.CompositeImage) CompositeImage(com.watabou.noosa.CompositeImage) Image(com.watabou.noosa.Image)

Example 2 with CompositeImage

use of com.watabou.noosa.CompositeImage in project pixel-dungeon-remix by NYRDS.

the class CustomLayerTilemap method tile.

@Override
public Image tile(int pos) {
    ArrayList<Image> imgs = new ArrayList<>();
    if (data[pos] >= 0) {
        Image img = new Image(getTexture());
        img.frame(getTileset().get(data[pos]));
        imgs.add(img);
    }
    for (CustomLayerTilemap layer : mLayers) {
        if (layer.data[pos] >= 0) {
            Image img = new Image(layer.getTexture());
            img.frame(layer.getTileset().get(layer.data[pos]));
            imgs.add(img);
        }
    }
    if (!imgs.isEmpty()) {
        return new CompositeImage(imgs);
    }
    return null;
}
Also used : CompositeImage(com.watabou.noosa.CompositeImage) ArrayList(java.util.ArrayList) Image(com.watabou.noosa.Image) CompositeImage(com.watabou.noosa.CompositeImage)

Aggregations

CompositeImage (com.watabou.noosa.CompositeImage)2 Image (com.watabou.noosa.Image)2 ArrayList (java.util.ArrayList)1