forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayerData.js
More file actions
33 lines (27 loc) · 1.34 KB
/
Copy pathLayerData.js
File metadata and controls
33 lines (27 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var Class = require('../../../utils/Class');
var GetFastValue = require('../../../utils/object/GetFastValue');
var LayerData = new Class({
initialize:
function MapLayerData (config)
{
if (config === undefined) { config = {}; }
this.name = GetFastValue(config, 'name', 'layer');
this.x = GetFastValue(config, 'x', 0);
this.y = GetFastValue(config, 'y', 0);
this.width = GetFastValue(config, 'width', 0);
this.height = GetFastValue(config, 'height', 0);
this.tileWidth = GetFastValue(config, 'tileWidth', 0);
this.tileHeight = GetFastValue(config, 'tileHeight', 0);
this.widthInPixels = GetFastValue(config, 'widthInPixels', this.width * this.tileWidth);
this.heightInPixels = GetFastValue(config, 'heightInPixels', this.height * this.tileHeight);
this.alpha = GetFastValue(config, 'alpha', 1);
this.visible = GetFastValue(config, 'visible', true);
this.properties = GetFastValue(config, 'properties', {});
this.indexes = GetFastValue(config, 'indexes', []);
this.callbacks = GetFastValue(config, 'callbacks', []);
this.bodies = GetFastValue(config, 'bodies', []);
this.data = GetFastValue(config, 'data', []);
this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null);
}
});
module.exports = LayerData;