MCPcopy Create free account
hub / github.com/melonjs/melonJS / constructor

Method constructor

packages/melonjs/src/level/tiled/TMXObject.js:43–206  ·  view source on GitHub ↗
(map, settings, z)

Source from the content-addressed store, hash-verified

41 */
42export default class TMXObject {
43 constructor(map, settings, z) {
44 /**
45 * point list in JSON format
46 * @type {object[]}
47 */
48 this.points = undefined;
49
50 /**
51 * object name
52 * @type {string}
53 */
54 this.name = settings.name;
55
56 /**
57 * object x position
58 * @type {number}
59 */
60 this.x = +settings.x;
61
62 /**
63 * object y position
64 * @type {number}
65 */
66 this.y = +settings.y;
67
68 /**
69 * object z order
70 * @type {number}
71 */
72 this.z = +z;
73
74 /**
75 * object width
76 * @type {number}
77 */
78 this.width = +settings.width || 0;
79
80 /**
81 * object height
82 * @type {number}
83 */
84 this.height = +settings.height || 0;
85
86 /**
87 * object gid value
88 * when defined the object is a tiled object
89 * @type {number}
90 */
91 this.gid = +settings.gid || null;
92
93 /**
94 * tint color
95 * @type {string}
96 */
97 this.tintcolor = settings.tintcolor;
98
99 /**
100 * object type

Callers

nothing calls this directly

Calls 7

setTileMethod · 0.95
parseTMXShapesMethod · 0.95
degToRadFunction · 0.90
applyTMXPropertiesFunction · 0.90
detectShapeFunction · 0.85
adjustPositionMethod · 0.45
getRendererMethod · 0.45

Tested by

no test coverage detected