Grade12Programs/src/game/drawing/Draw.java
public static void renderToScreen() {
        Graphics2D g2 = (Graphics2D) panel.getGraphics();
        if(g2 != null) {
            if(lastAlpha != 1.0f || alphaBetweenFrames != 1.0f) {
                int rule = AlphaComposite.SRC_OVER;
                Composite comp = AlphaComposite.getInstance(rule , (float) alphaBetweenFrames );
                g2.setComposite(comp);
                lastAlpha = alphaBetweenFrames;
            }
            g2.drawImage(buffer, 0, 0, null);
            g2.dispose();
        }
    }
// draws the buffer to the jpanel
draws the buffer to the jpanel
draws the buffer to the jpanel
public static void renderToScreen() {
        Graphics2D g2 = (Graphics2D) panel.getGraphics();
        if(g2 != null) {
            if(lastAlpha != 1.0f || alphaBetweenFrames != 1.0f) {
                int rule = AlphaComposite.SRC_OVER;
                Composite comp = AlphaComposite.getInstance(rule , (float) alphaBetweenFrames );
                g2.setComposite(comp);
                lastAlpha = alphaBetweenFrames;
            }
            g2.drawImage(buffer, 0, 0, null);
            g2.dispose();
        }
    }
public static void renderToScreen ( ) { Graphics2D g2 = ( Graphics2D ) panel . getGraphics ( ) ; if ( g2 != null ) { if ( lastAlpha != 1.0f || alphaBetweenFrames != 1.0f ) { int rule = AlphaComposite . SRC_OVER ; Composite comp = AlphaComposite . getInstance ( rule , ( float ) alphaBetweenFrames ) ; g2 . setComposite ( comp ) ; lastAlpha = alphaBetweenFrames ; } g2 . drawImage ( buffer , 0 , 0 , null ) ; g2 . dispose ( ) ; } }
draws the buffer to the jpanel
draws the buffer to the jpanel