Search in sources :

Example 16 with Graphic

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

the class FactoryGraphicHeadless method createImageBufferAlpha.

@Override
public ImageBuffer createImageBufferAlpha(int width, int height) {
    final ImageBuffer buffer = new ImageBufferHeadless(width, height, Transparency.TRANSLUCENT);
    final Graphic g = buffer.createGraphic();
    g.setColor(ColorRgba.TRANSPARENT);
    g.drawRect(0, 0, width, height, true);
    g.dispose();
    return buffer;
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) Graphic(com.b3dgs.lionengine.graphic.Graphic) FactoryGraphic(com.b3dgs.lionengine.graphic.FactoryGraphic)

Example 17 with Graphic

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

the class FactoryGraphicHeadless method createImageBuffer.

@Override
public ImageBuffer createImageBuffer(int width, int height, ColorRgba transparency) {
    Check.notNull(transparency);
    final ImageBuffer buffer = new ImageBufferHeadless(width, height, Transparency.BITMASK);
    final Graphic g = buffer.createGraphic();
    g.setColor(transparency);
    g.drawRect(0, 0, width, height, true);
    g.dispose();
    return buffer;
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) Graphic(com.b3dgs.lionengine.graphic.Graphic) FactoryGraphic(com.b3dgs.lionengine.graphic.FactoryGraphic)

Example 18 with Graphic

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

the class FactoryGraphicAwt method createImageBuffer.

@Override
public ImageBuffer createImageBuffer(int width, int height) {
    final BufferedImage image = ToolsAwt.createImage(width, height, java.awt.Transparency.OPAQUE);
    final ImageBuffer buffer = new ImageBufferAwt(image);
    final Graphic g = buffer.createGraphic();
    g.setColor(ColorRgba.BLACK);
    g.drawRect(0, 0, width, height, true);
    g.dispose();
    return buffer;
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) Graphic(com.b3dgs.lionengine.graphic.Graphic) FactoryGraphic(com.b3dgs.lionengine.graphic.FactoryGraphic) BufferedImage(java.awt.image.BufferedImage)

Example 19 with Graphic

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

the class FactoryGraphicAwt method createImageBufferAlpha.

@Override
public ImageBuffer createImageBufferAlpha(int width, int height) {
    final BufferedImage image = ToolsAwt.createImage(width, height, java.awt.Transparency.TRANSLUCENT);
    final ImageBuffer buffer = new ImageBufferAwt(image);
    final Graphic g = buffer.createGraphic();
    g.setColor(ColorRgba.TRANSPARENT);
    g.drawRect(0, 0, width, height, true);
    g.dispose();
    return buffer;
}
Also used : ImageBuffer(com.b3dgs.lionengine.graphic.ImageBuffer) Graphic(com.b3dgs.lionengine.graphic.Graphic) FactoryGraphic(com.b3dgs.lionengine.graphic.FactoryGraphic) BufferedImage(java.awt.image.BufferedImage)

Example 20 with Graphic

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

the class SequenceRenderer method render.

/**
 * Local render routine.
 */
void render() {
    if (screen.isReady()) {
        final Graphic g = screen.getGraphic();
        renderer.render(g);
        scanline.render(g);
    }
}
Also used : Graphic(com.b3dgs.lionengine.graphic.Graphic)

Aggregations

Graphic (com.b3dgs.lionengine.graphic.Graphic)45 Test (org.junit.jupiter.api.Test)18 ImageBuffer (com.b3dgs.lionengine.graphic.ImageBuffer)12 FactoryGraphic (com.b3dgs.lionengine.graphic.FactoryGraphic)9 Test (org.junit.Test)8 BufferedImage (java.awt.image.BufferedImage)5 GraphicMock (com.b3dgs.lionengine.graphic.GraphicMock)4 LionEngineException (com.b3dgs.lionengine.LionEngineException)3 Resolution (com.b3dgs.lionengine.Resolution)3 FactoryGraphicMock (com.b3dgs.lionengine.graphic.FactoryGraphicMock)3 Media (com.b3dgs.lionengine.Media)2 ColorRgba (com.b3dgs.lionengine.graphic.ColorRgba)2 SpriteFont (com.b3dgs.lionengine.graphic.SpriteFont)2 Text (com.b3dgs.lionengine.graphic.Text)2 Align (com.b3dgs.lionengine.Align)1 Surface (com.b3dgs.lionengine.Surface)1 Tile (com.b3dgs.lionengine.game.feature.tile.Tile)1 Image (com.b3dgs.lionengine.graphic.Image)1 Sprite (com.b3dgs.lionengine.graphic.Sprite)1 SpriteAnimated (com.b3dgs.lionengine.graphic.SpriteAnimated)1