You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
82
82
*
83
-
* @method Phaser.GameObjectFactory#group
83
+
* @method Phaser.GameObjects.Factory#group
84
84
* @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
85
85
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
86
86
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* A Physics Group is the same as an ordinary Group except that is has enableBody turned on by default, so any Sprites it creates
101
101
* are automatically given a physics body.
102
102
*
103
-
* @method Phaser.GameObjectFactory#physicsGroup
103
+
* @method Phaser.GameObjects.Factory#physicsGroup
104
104
* @param {number} [physicsBodyType=Phaser.Physics.ARCADE] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2JS, Phaser.Physics.NINJA, etc.
105
105
* @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
106
106
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* The map can either be populated with data from a Tiled JSON file or from a CSV file.
184
+
* To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.
185
+
* When using CSV data you must provide the key and the tileWidth and tileHeight parameters.
186
+
* If creating a blank tilemap to be populated later, you can either specify no parameters at all and then use `Tilemap.create` or pass the map and tile dimensions here.
187
+
* Note that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it.
188
+
*
189
+
* @method Phaser.GameObjects.Factory#tilemap
190
+
* @param {string} [key] - The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass `null`.
191
+
* @param {number} [tileWidth=32] - The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
192
+
* @param {number} [tileHeight=32] - The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
193
+
* @param {number} [width=10] - The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
194
+
* @param {number} [height=10] - The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
195
+
* @return {Phaser.Tilemap} The newly created tilemap object.
* A WebGL shader/filter that can be applied to Sprites.
258
+
*
259
+
* @method Phaser.GameObjects.Factory#filter
260
+
* @param {string} filter - The name of the filter you wish to create, for example HueRotate or SineWave.
261
+
* @param {any} - Whatever parameters are needed to be passed to the filter init function.
262
+
* @return {Phaser.Filter} The newly created Phaser.Filter object.
263
+
*/
264
+
filter: function(filter){
265
+
266
+
varargs=Array.prototype.slice.call(arguments,1);
267
+
268
+
varfilter=newPhaser.Filter[filter](this.game);
269
+
270
+
filter.init.apply(filter,args);
271
+
272
+
returnfilter;
273
+
274
+
},
275
+
276
+
/**
277
+
* Add a new Plugin into the PluginManager.
278
+
*
279
+
* The Plugin must have 2 properties: `game` and `parent`. Plugin.game is set to the game reference the PluginManager uses, and parent is set to the PluginManager.
280
+
*
281
+
* @method Phaser.GameObjects.Factory#plugin
282
+
* @param {object|Phaser.Plugin} plugin - The Plugin to add into the PluginManager. This can be a function or an existing object.
283
+
* @param {...*} parameter - Additional parameters that will be passed to the Plugin.init method.
284
+
* @return {Phaser.Plugin} The Plugin that was added to the manager.
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
43
43
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
44
-
* @returns {Phaser.Image} the newly created sprite object.
44
+
* @return {Phaser.Image} the newly created sprite object.
* @param {number} y - Y position of the new sprite.
58
58
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
59
59
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
60
-
* @returns {Phaser.Sprite} the newly created sprite object.
60
+
* @return {Phaser.Sprite} the newly created sprite object.
0 commit comments