📄 gamelayermger.java
字号:
/* This file was created by Carbide.j */
package gamenokia;
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.Image;
public class gameLayerMger extends LayerManager
{
javax.microedition.lcdui.game.TiledLayer layer1;
javax.microedition.lcdui.Image layer1_tiles;
public gameLayerMger()
{
super();
try
{
ndsInit();
}
catch (Exception e)
{
}
}
void ndsInit() throws Exception
{
layer2_tiles = Image.createImage("/images/example_tile_palette.png");
layer2 = new TiledLayer(10, 10, layer2_tiles, 24, 35);
layer2.setPosition(0, 0);
layer1_tiles = Image.createImage("/images/example_tile_palette.png");
layer1 = new TiledLayer(10, 10, layer1_tiles, 24, 35);
layer1.setPosition(0, 0);
fillLayer(layer2, layer2_cells);
fillLayer(layer1, layer1_cells);
append(layer1);
append(layer2);
}
javax.microedition.lcdui.game.TiledLayer layer2;
javax.microedition.lcdui.Image layer2_tiles;
int[] layer2_cells = new int[] { 118, 118, 117, 31, 31, 31, 85, 46, 46, 46, 31, 31, 103, 31, 31, 134, 28, 46, 46,
46, 31, 31, 103, 31, 31, 31, 31, 28, 46, 46, 31, 31, 103, 31, 31, 31, 31, 134, 28, 30, 31, 31, 103, 31, 31,
31, 31, 31, 134, 31, 31, 31, 103, 31, 31, 31, 31, 31, 31, 31, 96, 96, 101, 96, 96, 96, 96, 96, 96, 96, 31, 31
, 103, 31, 31, 133, 31, 134, 31, 31, 31, 31, 104, 118, 118, 118, 118, 115, 130, 31, 31, 31, 31, 31, 31, 31,
31, 133, 31, 31 };
int[] layer1_cells = new int[] { 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0,
0, 127, 0, 0, 0, 0, 131, 0, 0, 131, 0, 127, 0, 0, 0, 0, 0, 0, 127, 0, 127, 0, 0, 0, 0, 0, 0, 0, 132, 127, 132
, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 124, 0, 112, 0, 0, 0, 0, 0, 0, 124, 124, 0, 0, 0, 0, 0, 0, 0
, 0, 0, 124, 112, 0, 0, 124, 0, 0, 0, 0 };
void fillLayer(TiledLayer layer, int[] cells)
{
for ( int row = 0; row < layer.getRows(); row++)
{
for ( int col = 0; col < layer.getColumns(); col++)
{
layer.setCell(col, row, cells[row * layer.getColumns() + col]);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -