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
* Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
49
-
* It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.
49
+
* Create a new `Image` object.
50
+
*
51
+
* An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
52
+
*
53
+
* It can still rotate, scale, crop and receive input events.
54
+
* This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.
50
55
*
51
56
* @method Phaser.GameObjectFactory#image
52
-
* @param {number} x - X position of the image.
53
-
* @param {number} y - Y position of the image.
54
-
* @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.
55
-
* @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.
57
+
* @param {number} [x=0] - The x coordinate of the Image. The coordinate is relative to any parent container this Image may be in.
58
+
* @param {number} [y=0] - The y coordinate of the Image. The coordinate is relative to any parent container this Image may be in.
59
+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} [key] - The image used as a texture by this display object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.
60
+
* @param {string|number} [frame] - If a Texture Atlas or Sprite Sheet is used this allows you to specify the frame to be used. Use either an integer for a Frame ID or a string for a frame name.
56
61
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
57
-
* @returns {Phaser.Sprite} the newly created sprite object.
62
+
* @returns {Phaser.Image} The newly created Image object.
* Create a new Sprite with specific position and sprite sheet key.
69
74
*
75
+
* At its most basic a Sprite consists of a set of coordinates and a texture that is used when rendered.
76
+
* They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),
77
+
* events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases.
78
+
*
70
79
* @method Phaser.GameObjectFactory#sprite
71
-
* @param {number} x - X position of the new sprite.
72
-
* @param {number} y - Y position of the new sprite.
73
-
* @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.
74
-
* @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.
80
+
* @param {number} [x=0] - The x coordinate of the sprite. The coordinate is relative to any parent container this sprite may be in.
81
+
* @param {number} [y=0] - The y coordinate of the sprite. The coordinate is relative to any parent container this sprite may be in.
82
+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} [key] - The image used as a texture by this display object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.
83
+
* @param {string|number} [frame] - If a Texture Atlas or Sprite Sheet is used this allows you to specify the frame to be used. Use either an integer for a Frame ID or a string for a frame name.
75
84
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
76
-
* @returns {Phaser.Sprite} the newly created sprite object.
85
+
* @returns {Phaser.Sprite} The newly created Sprite object.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
106
117
* @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.
107
118
* @param {number} [physicsBodyType=0] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @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.
124
136
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
125
137
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @param {number} [volume=1] - The volume at which the sound will be played.
161
173
* @param {boolean} [loop=false] - Whether or not the sound will loop.
162
174
* @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
163
-
* @return {Phaser.Sound} The newly created text object.
175
+
* @return {Phaser.Sound} The newly created sound object.
* @param {number} [volume=1] - The volume at which the sound will be played.
177
189
* @param {boolean} [loop=false] - Whether or not the sound will loop.
178
190
* @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
179
-
* @return {Phaser.Sound} The newly created text object.
191
+
* @return {Phaser.Sound} The newly created sound object.
* @param {number} x - The x coordinate (in world space) to position the TileSprite at.
205
-
* @param {number} y - The y coordinate (in world space) to position the TileSprite at.
216
+
* @param {number} x - The x coordinate of the TileSprite. The coordinate is relative to any parent container this TileSprite may be in.
217
+
* @param {number} y - The y coordinate of the TileSprite. The coordinate is relative to any parent container this TileSprite may be in.
206
218
* @param {number} width - The width of the TileSprite.
207
219
* @param {number} height - The height of the TileSprite.
208
-
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
209
-
* @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
220
+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} key - The image used as a texture by this display object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.
221
+
* @param {string|number} [frame] - If a Texture Atlas or Sprite Sheet is used this allows you to specify the frame to be used. Use either an integer for a Frame ID or a string for a frame name.
210
222
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
211
-
* @return {Phaser.TileSprite} The newly created tileSprite object.
223
+
* @return {Phaser.TileSprite} The newly created TileSprite object.
* Example usage: https://github.com/codevinsky/phaser-rope-demo/blob/master/dist/demo.js
237
+
*
224
238
* @method Phaser.GameObjectFactory#rope
225
-
* @param {number} x - The x coordinate (in world space) to position the TileSprite at.
226
-
* @param {number} y - The y coordinate (in world space) to position the TileSprite at.
227
-
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
228
-
* @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
239
+
* @param {number} [x=0] - The x coordinate of the Rope. The coordinate is relative to any parent container this rope may be in.
240
+
* @param {number} [y=0] - The y coordinate of the Rope. The coordinate is relative to any parent container this rope may be in.
241
+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} [key] - The image used as a texture by this display object during rendering. If a string Phaser will get for an entry in the Image Cache. Or it can be an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.
242
+
* @param {string|number} [frame] - If a Texture Atlas or Sprite Sheet is used this allows you to specify the frame to be used. Use either an integer for a Frame ID or a string for a frame name.
229
243
* @param {Array} points - An array of {Phaser.Point}.
230
244
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
231
-
* @return {Phaser.TileSprite} The newly created tileSprite object.
232
-
* Example usage: https://github.com/codevinsky/phaser-rope-demo/blob/master/dist/demo.js
245
+
* @return {Phaser.Rope} The newly created Rope object.
* @param {string|number} [downFrame] - This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
273
286
* @param {string|number} [upFrame] - This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name.
274
287
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
275
-
* @return {Phaser.Button} The newly created button object.
288
+
* @return {Phaser.Button} The newly created Button object.
0 commit comments