Search in sources :

Example 1 with RasterImage

use of com.b3dgs.lionengine.graphic.raster.RasterImage in project lionengine by b3dgs.

the class MapTileRasteredModel method loadSheets.

@Override
public boolean loadSheets() {
    if (raster == null || !raster.exists()) {
        return false;
    }
    final int th = map.getTileHeight();
    final int sheetsCount = map.getSheetsNumber();
    for (int sheetId = 0; sheetId < sheetsCount; sheetId++) {
        final Integer sheet = Integer.valueOf(sheetId);
        final RasterImage rasterImage = new RasterImage(map.getSheet(sheetId).getSurface(), raster, th);
        rasterImage.loadRasters(true, sheet.toString());
        count = -1;
        final List<SpriteTiled> rastersSheet = getRasters(sheet);
        for (final ImageBuffer bufferRaster : rasterImage.getRasters()) {
            final SpriteTiled sheetRaster = Drawable.loadSpriteTiled(bufferRaster, map.getTileWidth(), th);
            rastersSheet.add(sheetRaster);
            count++;
        }
    }
    return true;
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) SpriteTiled(com.b3dgs.lionengine.graphic.drawable.SpriteTiled) RasterImage(com.b3dgs.lionengine.graphic.raster.RasterImage)

Aggregations

ImageBuffer (com.b3dgs.lionengine.graphic.ImageBuffer)1 SpriteTiled (com.b3dgs.lionengine.graphic.drawable.SpriteTiled)1 RasterImage (com.b3dgs.lionengine.graphic.raster.RasterImage)1