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

Method setChildsProperty

packages/melonjs/src/renderable/container.js:875–882  ·  view source on GitHub ↗

* Automatically set the specified property of all childs to the given value * @param {string} prop - property name * @param {object} value - property value * @param {boolean} [recursive=false] - recursively apply the value to child containers if true

(prop, value, recursive)

Source from the content-addressed store, hash-verified

873 * @param {boolean} [recursive=false] - recursively apply the value to child containers if true
874 */
875 setChildsProperty(prop, value, recursive) {
876 this.forEach((child) => {
877 if (recursive === true && child instanceof Container) {
878 child.setChildsProperty(prop, value, recursive);
879 }
880 child[prop] = value;
881 });
882 }
883
884 /**
885 * Move the child in the group one step forward (z depth).

Callers 1

container.spec.jsFile · 0.80

Calls 1

forEachMethod · 0.95

Tested by

no test coverage detected