get Clickable Img - Java 2D Graphics

Java examples for 2D Graphics:Image

Description

get Clickable Img

Demo Code


//package com.java2s;

import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage getClickableImg(BufferedImage spriteSheet,
            int state) {
        if (state < 3)
            return spriteSheet.getSubimage(spriteSheet.getWidth() * state
                    / 3, 0, spriteSheet.getWidth() / 3,
                    spriteSheet.getHeight());
        else/*from  w  w w .ja v  a  2  s.com*/
            return null;
    }
}

Related Tutorials