Fixed the world drag issue across Sprite and Button.

This commit is contained in:
Richard Davey
2013-08-06 04:34:52 +01:00
parent a7873a3b74
commit 77cc3858d9
12 changed files with 83 additions and 133 deletions
+5 -6
View File
@@ -87,11 +87,10 @@ module Phaser {
* @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.
* @param [bodyType] {number} The physics body type of the object (defaults to BODY_DISABLED)
* @returns {Sprite} The newly created sprite object.
*/
public sprite(x: number, y: number, key?: string = '', frame? = null, bodyType?: number = Phaser.Types.BODY_DISABLED): Sprite {
return <Sprite> this._world.group.add(new Sprite(this._game, x, y, key, frame, bodyType));
public sprite(x: number, y: number, key?: string = '', frame? = null): Sprite {
return <Sprite> this._world.group.add(new Sprite(this._game, x, y, key, frame));
}
public audio(key: string, volume?: number = 1, loop?: bool = false) {
@@ -109,9 +108,9 @@ module Phaser {
* @param [shapeType] The default body shape is either 0 for a Box or 1 for a Circle. See Sprite.body.addShape for custom shapes (polygons, etc)
* @returns {Sprite} The newly created sprite object.
*/
public physicsSprite(x: number, y: number, key?: string = '', frame? = null, bodyType?: number = Phaser.Types.BODY_DYNAMIC, shapeType?:number = 0): Sprite {
return <Sprite> this._world.group.add(new Sprite(this._game, x, y, key, frame, bodyType, shapeType));
}
//public physicsSprite(x: number, y: number, key?: string = '', frame? = null, bodyType?: number = Phaser.Types.BODY_DYNAMIC, shapeType?:number = 0): Sprite {
// return <Sprite> this._world.group.add(new Sprite(this._game, x, y, key, frame, bodyType, shapeType));
//}
/**
* Create a new DynamicTexture with specific size.