If you think the Android project Hungry-Mouse listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
//Name: Graphics.java
//Purpose: contains many methods that will be used to draw
// text and images to the screen.
//fromwww.java2s.compackage com.hungry.mouse.framework;
//android libraries stored in SDK platform
import android.graphics.Paint;//hold style and color information to draw
publicinterface Graphics {
publicstaticenum ImageFormat {
ARGB8888, ARGB4444, RGB565
}
//used to load assets
public Image newImage(String fileName, ImageFormat format);
//clear complete framebuffer with given color
publicvoid clearScreen(int color);
//draw an a line from a start point to end point with given color
publicvoid drawLine(int x, int y, int x2, int y2, int color);
//draw an a rectangle from a start point to end point with given color
publicvoid drawRect(int x, int y, int width, int height, int color);
//load an image with jpeg/png format that is located to assets
//it used to draw a part of an image
publicvoid drawImage(Image image, int x, int y, int srcX, int srcY,
int srcWidth, int srcHeight);
//load an image with jpeg/png format that is located to assets
//it used to draw the whole image
publicvoid drawImage(Image Image, int x, int y);
//draw a string at given coordinates
void drawString(String text, int x, int y, Paint paint);
//getters//
//return image width
publicint getWidth();
//return image height
publicint getHeight();
//draw based on colors Red, Green & Blue.A for alpha
publicvoid drawARGB(int i, int j, int k, int l);
}