mirror of
https://github.com/wassname/phaser.git
synced 2026-07-14 01:10:16 +08:00
Working on Linked List node swapping.
This commit is contained in:
@@ -25,6 +25,23 @@ Phaser.GameObjectFactory.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a new Sprite with specific position and sprite sheet key.
|
||||
*
|
||||
* @param x {number} X position of the new sprite.
|
||||
* @param y {number} Y position of the new sprite.
|
||||
* @param [key] {string} The image key as defined in the Game.Cache to use as the texture for this sprite
|
||||
* @param [frame] {string|number} 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.
|
||||
* @returns {Sprite} The newly created sprite object.
|
||||
*/
|
||||
child: function (parent, x, y, key, frame) {
|
||||
|
||||
var child = this.world.add(new Phaser.Sprite(this.game, x, y, key, frame));
|
||||
parent.addChild(child);
|
||||
return child;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user