//一个菱形地板
public DarwCell(tileWidth: number, tileHight: number, index: string): egret.Sprite {
var tile: egret.Sprite = new egret.Sprite();
tile.graphics.lineStyle(1, 0xffffff);//设置画笔线性和颜色
tile.graphics.beginFill(0x000000, 0.5);
//创建菱形方块
tile.graphics.moveTo(0, tileHight / 2);
tile.graphics.lineTo(tileWidth / 2, 0);
tile.graphics.lineTo(tileWidth, tileHight / 2);
tile.graphics.lineTo(tileWidth / 2, tileHight);
tile.graphics.lineTo(0, tileHight / 2);
tile.graphics.endFill();
var txt: egret.TextField = new egret.TextField();
tile.addChild(txt)
txt.text = index;
txt.size = 10;
txt.x = tile.width >> 1;
txt.y = tile.height >> 1;
return tile;
public DarwCell(tileWidth: number, tileHight: number, index: string): egret.Sprite {
var tile: egret.Sprite = new egret.Sprite();
tile.graphics.lineStyle(1, 0xffffff);//设置画笔线性和颜色
tile.graphics.beginFill(0x000000, 0.5);
//创建菱形方块
tile.graphics.moveTo(0, tileHight / 2);
tile.graphics.lineTo(tileWidth / 2, 0);
tile.graphics.lineTo(tileWidth, tileHight / 2);
tile.graphics.lineTo(tileWidth / 2, tileHight);
tile.graphics.lineTo(0, tileHight / 2);
tile.graphics.endFill();
var txt: egret.TextField = new egret.TextField();
tile.addChild(txt)
txt.text = index;
txt.size = 10;
txt.x = tile.width >> 1;
txt.y = tile.height >> 1;
return tile;
}
<