[editor] fix
This commit is contained in:
@@ -36,7 +36,7 @@ class SpawnPointItem extends BitmapItem<SpawnPointEntity> {
|
|||||||
|
|
||||||
public function new(value:SpawnPoint, config:Config) {
|
public function new(value:SpawnPoint, config:Config) {
|
||||||
src = getSrc(value, config);
|
src = getSrc(value, config);
|
||||||
super(new SpawnPointEntity(value, new Rectangle(
|
super(new SpawnPointEntity(0, value, new Rectangle(
|
||||||
value.x * config.map.cellWidth,
|
value.x * config.map.cellWidth,
|
||||||
value.y * config.map.cellHeight,
|
value.y * config.map.cellHeight,
|
||||||
config.map.cellWidth * 2,
|
config.map.cellWidth * 2,
|
||||||
@@ -196,12 +196,13 @@ class MapEditView extends SpriteView {
|
|||||||
|
|
||||||
private function drawMap() {
|
private function drawMap() {
|
||||||
for (brick in map.bricks) if (brick.config.index > 0) {
|
for (brick in map.bricks) if (brick.config.index > 0) {
|
||||||
if (!items.exists(brick.key)) {
|
var key = Std.string(brick.id);
|
||||||
items[brick.key] = new BrickItem(brick);
|
if (!items.exists(key)) {
|
||||||
|
items[key] = new BrickItem(brick);
|
||||||
if (brick.config.layer > 2) {
|
if (brick.config.layer > 2) {
|
||||||
upLayer.addChild(items[brick.key].view);
|
upLayer.addChild(items[key].view);
|
||||||
} else {
|
} else {
|
||||||
groundLayer.addChild(items[brick.key].view);
|
groundLayer.addChild(items[key].view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user