Search in sources :

Example 31 with SpriteTiled

use of com.b3dgs.lionengine.graphic.SpriteTiled in project lionengine by b3dgs.

the class SpriteTiledTest method testRender.

/**
 * Test render.
 */
@Test
public void testRender() {
    final Graphic g = Graphics.createImageBuffer(100, 100).createGraphic();
    try {
        final SpriteTiled sprite = new SpriteTiledImpl(Graphics.createImageBuffer(64, 32), 16, 8);
        sprite.render(g);
        sprite.setTile(0);
        sprite.setMirror(Mirror.HORIZONTAL);
        sprite.render(g);
        sprite.setMirror(Mirror.VERTICAL);
        sprite.render(g);
    } finally {
        g.dispose();
    }
}
Also used : Graphic(com.b3dgs.lionengine.graphic.Graphic) SpriteTiled(com.b3dgs.lionengine.graphic.SpriteTiled) Test(org.junit.Test)

Aggregations

SpriteTiled (com.b3dgs.lionengine.graphic.SpriteTiled)31 Test (org.junit.Test)24 ImageBuffer (com.b3dgs.lionengine.graphic.ImageBuffer)6 LionEngineException (com.b3dgs.lionengine.LionEngineException)1 Media (com.b3dgs.lionengine.Media)1 RasterImage (com.b3dgs.lionengine.core.RasterImage)1 FilterBilinear (com.b3dgs.lionengine.core.filter.FilterBilinear)1 Tile (com.b3dgs.lionengine.game.feature.tile.Tile)1 TileRef (com.b3dgs.lionengine.game.feature.tile.TileRef)1 ColorRgba (com.b3dgs.lionengine.graphic.ColorRgba)1 Graphic (com.b3dgs.lionengine.graphic.Graphic)1