feat: LayerProxy::tile
This commit is contained in:
parent
ae9370c6d7
commit
fbbd74f778
|
@ -66,6 +66,12 @@ export default function(Component) {
|
|||
}
|
||||
Component.markChange(instance.entity, 'layerChange', {[index]: changes});
|
||||
}
|
||||
tile({x, y}) {
|
||||
if (x < 0 || y < 0 || x >= this.layer.area.x || y >= this.layer.area.y) {
|
||||
return undefined;
|
||||
}
|
||||
return this.layer.data[y * this.layer.area.x + x];
|
||||
}
|
||||
}
|
||||
return new LayerProxy(layers[index]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user