Skip to content

Commit 83e2de2

Browse files
committed
Docs for Group
Add GroupClassTypeConstructor type
1 parent 0e10d50 commit 83e2de2

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Sprite = require('../sprite/Sprite');
2828
/**
2929
* @typedef {object} GroupConfig
3030
*
31-
* @property {?object} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
31+
* @property {?GroupClassTypeConstructor} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
3232
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
3333
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
3434
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.
@@ -52,7 +52,7 @@ var Sprite = require('../sprite/Sprite');
5252
*
5353
* `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used.
5454
*
55-
* @property {?object} [classType] - The class of each new Game Object.
55+
* @property {?GroupClassTypeConstructor} [classType] - The class of each new Game Object.
5656
* @property {string} [key] - The texture key of each new Game Object.
5757
* @property {?(string|integer)} [frame=null] - The texture frame of each new Game Object.
5858
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
@@ -93,6 +93,18 @@ var Sprite = require('../sprite/Sprite');
9393
* @see Phaser.Utils.Array.Range
9494
*/
9595

96+
/**
97+
* A constructor function (class) that can be assigned to `classType`.
98+
* @callback GroupClassTypeConstructor
99+
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
100+
* @param {number} x - The horizontal position of this Game Object in the world.
101+
* @param {number} y - The vertical position of this Game Object in the world.
102+
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
103+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
104+
*
105+
* @see Phaser.GameObjects.Group#classType
106+
*/
107+
96108
/**
97109
* @classdesc A Group is a way for you to create, manipulate, or recycle similar Game Objects.
98110
*
@@ -185,7 +197,7 @@ var Group = new Class({
185197
* The class to create new group members from.
186198
*
187199
* @name Phaser.GameObjects.Group#classType
188-
* @type {object}
200+
* @type {GroupClassTypeConstructor}
189201
* @since 3.0.0
190202
* @default Phaser.GameObjects.Sprite
191203
*/

0 commit comments

Comments
 (0)