mirror of
https://github.com/wassname/phaser.git
synced 2026-08-06 13:31:05 +08:00
* Fixed issue in Sound.play where if you gave a missing marker it would play the whole sound sprite instead.
* Button.setFrames will set the current frame based on the button state immediately. * InputHandler now creates the _pointerData array on creation and populates with one empty set of values, so pointerOver etc all work before a start call. * Added Canvas.setUserSelect() to disable touchCallouts and user selections within the canvas. * When the game boots it will now by default disable user-select and touch action events on the game canvas. * Loaded.setPreloadSprite now rounds the width/height values and starts from 1. This fixes canvas draw errors in IE9/10 and Firefox.
This commit is contained in:
@@ -105,12 +105,12 @@ Phaser.Loader.prototype = {
|
||||
if (direction == 0)
|
||||
{
|
||||
// Horizontal crop
|
||||
this.preloadSprite.crop = new Phaser.Rectangle(0, 0, 0, sprite.height);
|
||||
this.preloadSprite.crop = new Phaser.Rectangle(0, 0, 1, sprite.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Vertical crop
|
||||
this.preloadSprite.crop = new Phaser.Rectangle(0, 0, sprite.width, 0);
|
||||
this.preloadSprite.crop = new Phaser.Rectangle(0, 0, sprite.width, 1);
|
||||
}
|
||||
|
||||
sprite.crop = this.preloadSprite.crop;
|
||||
@@ -904,11 +904,11 @@ Phaser.Loader.prototype = {
|
||||
{
|
||||
if (this.preloadSprite.direction == 0)
|
||||
{
|
||||
this.preloadSprite.crop.width = (this.preloadSprite.width / 100) * this.progress;
|
||||
this.preloadSprite.crop.width = Math.floor((this.preloadSprite.width / 100) * this.progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.preloadSprite.crop.height = (this.preloadSprite.height / 100) * this.progress;
|
||||
this.preloadSprite.crop.height = Math.floor((this.preloadSprite.height / 100) * this.progress);
|
||||
}
|
||||
|
||||
this.preloadSprite.sprite.crop = this.preloadSprite.crop;
|
||||
|
||||
Reference in New Issue
Block a user