Grade12Programs/src/game/drawing/Draw.java
public static void image(String imageName, int x, int y, double angle, double scale) {
    	Sprite spr = Sprites.get(imageName);
    	
        int half = (int) (spr.drawLimit * scale);
        if ((x + half > drawLimitLeft && x - half < drawLimitRight && y + half > drawLimitTop && y - half < drawLimitBottom) || absoluteDraw) {
            AffineTransform t = canvas.getTransform();

            canvas.translate(Math.round(x + difx), Math.round(y + dify));
            canvas.scale(scale, scale);
            canvas.rotate(angle);

            canvas.drawImage(spr.img, Math.round(-spr.width / 2), Math.round(-spr.height / 2), null);

            canvas.setTransform(t);
        drawCalls++;}
    }
/**
     * draws an image centered on x,y with an angle, scaled on the x and y axis.
     * @param spr   {@link game.drawing.Sprites#get(String) Sprites.get(spritename)}
     * @param x
     * @param y
     * @param angle radians
     * @param scale pixels per pixel
     */
draws an image centered on x,y with an angle, scaled on the x and y axis.
draws an image centered on x y with an angle scaled on the x and y axis .
public static void image(String imageName, int x, int y, double angle, double scale) {
    	Sprite spr = Sprites.get(imageName);
        int half = (int) (spr.drawLimit * scale);
        if ((x + half > drawLimitLeft && x - half < drawLimitRight && y + half > drawLimitTop && y - half < drawLimitBottom) || absoluteDraw) {
            AffineTransform t = canvas.getTransform();
            canvas.translate(Math.round(x + difx), Math.round(y + dify));
            canvas.scale(scale, scale);
            canvas.rotate(angle);
            canvas.drawImage(spr.img, Math.round(-spr.width / 2), Math.round(-spr.height / 2), null);
            canvas.setTransform(t);
        drawCalls++;}
    }
public static void image ( String imageName , int x , int y , double angle , double scale ) { Sprite spr = Sprites . get ( imageName ) ; int half = ( int ) ( spr . drawLimit * scale ) ; if ( ( x + half > drawLimitLeft && x - half < drawLimitRight && y + half > drawLimitTop && y - half < drawLimitBottom ) || absoluteDraw ) { AffineTransform t = canvas . getTransform ( ) ; canvas . translate ( Math . round ( x + difx ) , Math . round ( y + dify ) ) ; canvas . scale ( scale , scale ) ; canvas . rotate ( angle ) ; canvas . drawImage ( spr . img , Math . round ( - spr . width / 2 ) , Math . round ( - spr . height / 2 ) , null ) ; canvas . setTransform ( t ) ; drawCalls ++ ; } }
draws an image centered on x,y with an angle, scaled on the x and y axis.
draws an image centered on x y with an angle scaled on the x and y axis .