forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectLayer.js
More file actions
37 lines (30 loc) · 1.22 KB
/
Copy pathObjectLayer.js
File metadata and controls
37 lines (30 loc) · 1.22 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
34
35
36
37
var Class = require('../../../utils/Class');
var GetFastValue = require('../../../utils/object/GetFastValue');
var ObjectLayer = new Class({
initialize:
/**
* A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled
* object layer, except:
* - "x" & "y" properties are ignored since these cannot be changed in Tiled.
* - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they
* are ignored as well.
* - "draworder" is ignored.
*
* @class ObjectLayer
* @constructor
*
* @param {object} [config] - [description]
*/
function ObjectLayer (config)
{
if (config === undefined) { config = {}; }
this.name = GetFastValue(config, 'name', 'object layer');
this.opacity = GetFastValue(config, 'opacity', 1);
this.properties = GetFastValue(config, 'properties', {});
this.propertyTypes = GetFastValue(config, 'propertytypes', {});
this.type = GetFastValue(config, 'type', 'objectgroup');
this.visible = GetFastValue(config, 'visible', true);
this.objects = GetFastValue(config, 'objects', []);
}
});
module.exports = ObjectLayer;