Added new quantity property to GroupCreateConfig

This commit is contained in:
Richard Davey 2019-06-28 11:14:59 +01:00
parent 422fbec238
commit f792f13d7a
2 changed files with 8 additions and 6 deletions

View file

@ -349,14 +349,15 @@ var Group = new Class({
var randomKey = GetFastValue(options, 'randomKey', false);
var randomFrame = GetFastValue(options, 'randomFrame', false);
var yoyo = GetFastValue(options, 'yoyo', false);
var quantity = GetFastValue(options, 'frameQuantity', 1);
var quantity = GetFastValue(options, 'quantity', false);
var frameQuantity = GetFastValue(options, 'frameQuantity', 1);
var max = GetFastValue(options, 'max', 0);
// If a grid is set we use that to override the quantity?
// If a quantity value is set we use that to override the frameQuantity
var range = Range(key, frame, {
max: max,
qty: quantity,
qty: (quantity) ? quantity : frameQuantity,
random: randomKey,
randomB: randomFrame,
repeat: repeat,

View file

@ -13,14 +13,15 @@
* @property {?Function} [classType] - The class of each new Game Object.
* @property {(string|string[])} [key] - The texture key of each new Game Object.
* @property {?(string|string[]|integer|integer[])} [frame=null] - The texture frame of each new Game Object.
* @property {?integer} [quantity=false] - The number of Game Objects to create. If set, this overrides the `frameQuantity` value. Use `frameQuantity` for more advanced control.
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
* @property {?boolean} [active=true] - The active state of each new Game Object.
* @property {?number} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination).
* @property {?integer} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination).
* @property {?boolean} [randomKey=false] - Select a `key` at random.
* @property {?boolean} [randomFrame=false] - Select a `frame` at random.
* @property {?boolean} [yoyo=false] - Select keys and frames by moving forward then backward through `key` and `frame`.
* @property {?number} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`.
* @property {?number} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum.
* @property {?integer} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`.
* @property {?integer} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum.
* @property {?object} [setXY]
* @property {?number} [setXY.x=0] - The horizontal position of each new Game Object.
* @property {?number} [setXY.y=0] - The vertical position of each new Game Object.