⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tiledcanvas.java

📁 javaME useful code with the J2ME helpful learning cla
💻 JAVA
字号:
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
public class TiledCanvas extends GameCanvas {
private Image titledImage;
	private Graphics g;
	private TiledLayer background;
	private byte[][] titledMap = { {1,2,3}, 
			{4,5,6},
			{7,8,9}, 
			{7,7,7}, 
			{7,7,7},
			{7,7,7}};
	protected TiledCanvas() {
		super(true);
		try {
			
			titledImage = Image.createImage("/title1.png");
		} catch (Exception e) {
		}
		g = this.getGraphics();	
		background = new TiledLayer(3,6,titledImage,64,32);
		for(int i=0;i<6;i++)			
			for(int j=0;j<3;j++){
				background.setCell(j,i,titledMap[i][j]);
			}
		background.paint(g);
		flushGraphics();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -