mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
A Game Object with fixedToCamera = true
that was then set for Input, and enabled for dragging from its center (input.enableDrag(true)
) would throw an error upon being dragged (thanks @solusipse #2367)
This commit is contained in:
parent
fc7b5c79e3
commit
787111c12c
2 changed files with 7 additions and 6 deletions
|
@ -372,6 +372,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
|||
* When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakov #2325)
|
||||
* Sound.play when using an AudioTag would ignore the muted state of the SoundManager and play regardless. It now checks the SoundManager.mute state on play, and sets the volume accorindingly (thanks @brianbunch #2139)
|
||||
* Graphics objects can now have a Physics Body directly attached to them, where-as before it would throw an error due to a lack of anchor property (thanks @NLilley #2400)
|
||||
* A Game Object with `fixedToCamera = true` that was then set for Input, and enabled for dragging from its center (`input.enableDrag(true)`) would throw an error upon being dragged (thanks @solusipse #2367)
|
||||
|
||||
### Pixi Updates
|
||||
|
||||
|
|
|
@ -1324,13 +1324,13 @@ Phaser.InputHandler.prototype = {
|
|||
{
|
||||
if (this.dragFromCenter)
|
||||
{
|
||||
this.sprite.centerOn(pointer.x, pointer.y);
|
||||
this._dragPoint.setTo(this.sprite.cameraOffset.x - pointer.x, this.sprite.cameraOffset.y - pointer.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._dragPoint.setTo(this.sprite.cameraOffset.x - pointer.x, this.sprite.cameraOffset.y - pointer.y);
|
||||
var bounds = this.sprite.getBounds();
|
||||
|
||||
this.sprite.cameraOffset.x = this.globalToLocalX(pointer.x) + (this.sprite.cameraOffset.x - bounds.centerX);
|
||||
this.sprite.cameraOffset.y = this.globalToLocalY(pointer.y) + (this.sprite.cameraOffset.y - bounds.centerY);
|
||||
}
|
||||
|
||||
this._dragPoint.setTo(this.sprite.cameraOffset.x - pointer.x, this.sprite.cameraOffset.y - pointer.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue