set(child, key, value, checkAlive, checkVisible, operation, force) → {boolean}
Quickly set a property on a single child of this group to a new value.
The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
child | Phaser.Sprite | The child to set the property on. | ||
key | string | The property, as a string, to be set. For example: 'body.velocity.x' | ||
value | any | The value that will be set. | ||
checkAlive | boolean | <optional> | false | If set then the child will only be updated if alive=true. |
checkVisible | boolean | <optional> | false | If set then the child will only be updated if visible=true. |
operation | integer | <optional> | 0 | Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it. |
force | boolean | <optional> | false | If |
Returns
True if the property was set, false if not.
- Source code: core/Group.js (Line 1246)
Please login to continue.