v3.80 Release

This commit is contained in:
Richard Davey 2024-02-21 22:41:51 +00:00
parent 66ab05f89b
commit a4aa78bf80
12 changed files with 16988 additions and 16698 deletions

View file

@ -68780,7 +68780,8 @@ var UUID = __webpack_require__(45650);
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -84997,6 +84998,7 @@ var VideoRender = __webpack_require__(10247);
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.ComputedSize
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
@ -85005,7 +85007,6 @@ var VideoRender = __webpack_require__(10247);
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.PostPipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Size
* @extends Phaser.GameObjects.Components.TextureCrop
* @extends Phaser.GameObjects.Components.Tint
* @extends Phaser.GameObjects.Components.Transform
@ -85023,6 +85024,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
@ -85031,7 +85033,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
@ -86380,19 +86381,53 @@ var Video = new Class({
*/
metadataHandler: function (event)
{
var video = this.video;
this.emit(Events.VIDEO_METADATA, this, event);
},
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
*
* @method Phaser.GameObjects.Video#setSizeToFrame
* @since 3.0.0
*
* @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on.
*
* @return {this} This Game Object instance.
*/
setSizeToFrame: function (frame)
{
if (!frame) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
if (this.scaleX !== 1)
{
this.scaleX = this.displayWidth / video.videoWidth;
this.scaleX = this.displayWidth / this.width;
}
if (this.scaleY !== 1)
{
this.scaleY = this.displayHeight / video.videoHeight;
this.scaleY = this.displayHeight / this.height;
}
this.emit(Events.VIDEO_METADATA, this, event);
var input = this.input;
if (input && !input.customHitArea)
{
input.hitArea.width = this.width;
input.hitArea.height = this.height;
}
return this;
},
/**
@ -163439,17 +163474,38 @@ var WebGLRenderer = new Class({
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} dstTexture - The destination WebGLTextureWrapper to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
*
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The updated WebGLTextureWrapper. This is the same wrapper object as `dstTexture`.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
updateVideoTexture: function (srcVideo, dstTexture, flipY, noRepeat)
{
if (flipY === undefined) { flipY = false; }
if (noRepeat === undefined) { noRepeat = false; }
var gl = this.gl;
var minFilter = gl.NEAREST;
var magFilter = gl.NEAREST;
var width = srcVideo.videoWidth;
var height = srcVideo.videoHeight;
dstTexture.update(srcVideo, width, height, flipY);
var wrapping = gl.CLAMP_TO_EDGE;
var pow = IsSizePowerOfTwo(width, height);
if (!noRepeat && pow)
{
wrapping = gl.REPEAT;
}
if (this.config.antialias)
{
minFilter = (pow && this.mipmapFilter) ? this.mipmapFilter : gl.LINEAR;
magFilter = gl.LINEAR;
}
dstTexture.update(srcVideo, width, height, flipY, wrapping, wrapping, minFilter, magFilter);
return dstTexture;
},
@ -174541,11 +174597,11 @@ var WebGLTextureWrapper = new Class({
* @param {HTMLCanvasElement|HTMLVideoElement} source - The source to update the WebGLTexture with.
* @param {number} width - The new width of the WebGLTexture.
* @param {number} height - The new height of the WebGLTexture.
* @param {boolean} [flipY] - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} [wrapS] - The new wrapping mode for the WebGLTexture.
* @param {number} [wrapT] - The new wrapping mode for the WebGLTexture.
* @param {number} [minFilter] - The new minification filter for the WebGLTexture.
* @param {number} [magFilter] - The new magnification filter for the WebGLTexture.
* @param {boolean} flipY - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} wrapS - The new wrapping mode for the WebGLTexture.
* @param {number} wrapT - The new wrapping mode for the WebGLTexture.
* @param {number} minFilter - The new minification filter for the WebGLTexture.
* @param {number} magFilter - The new magnification filter for the WebGLTexture.
*/
update: function (source, width, height, flipY, wrapS, wrapT, minFilter, magFilter)
{

File diff suppressed because one or more lines are too long

View file

@ -71591,7 +71591,8 @@ var UUID = __webpack_require__(45650);
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -87812,6 +87813,7 @@ var VideoRender = __webpack_require__(10247);
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.ComputedSize
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
@ -87820,7 +87822,6 @@ var VideoRender = __webpack_require__(10247);
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.PostPipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Size
* @extends Phaser.GameObjects.Components.TextureCrop
* @extends Phaser.GameObjects.Components.Tint
* @extends Phaser.GameObjects.Components.Transform
@ -87838,6 +87839,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
@ -87846,7 +87848,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
@ -89195,19 +89196,53 @@ var Video = new Class({
*/
metadataHandler: function (event)
{
var video = this.video;
this.emit(Events.VIDEO_METADATA, this, event);
},
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
*
* @method Phaser.GameObjects.Video#setSizeToFrame
* @since 3.0.0
*
* @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on.
*
* @return {this} This Game Object instance.
*/
setSizeToFrame: function (frame)
{
if (!frame) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
if (this.scaleX !== 1)
{
this.scaleX = this.displayWidth / video.videoWidth;
this.scaleX = this.displayWidth / this.width;
}
if (this.scaleY !== 1)
{
this.scaleY = this.displayHeight / video.videoHeight;
this.scaleY = this.displayHeight / this.height;
}
this.emit(Events.VIDEO_METADATA, this, event);
var input = this.input;
if (input && !input.customHitArea)
{
input.hitArea.width = this.width;
input.hitArea.height = this.height;
}
return this;
},
/**
@ -184314,17 +184349,38 @@ var WebGLRenderer = new Class({
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} dstTexture - The destination WebGLTextureWrapper to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
*
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The updated WebGLTextureWrapper. This is the same wrapper object as `dstTexture`.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
updateVideoTexture: function (srcVideo, dstTexture, flipY, noRepeat)
{
if (flipY === undefined) { flipY = false; }
if (noRepeat === undefined) { noRepeat = false; }
var gl = this.gl;
var minFilter = gl.NEAREST;
var magFilter = gl.NEAREST;
var width = srcVideo.videoWidth;
var height = srcVideo.videoHeight;
dstTexture.update(srcVideo, width, height, flipY);
var wrapping = gl.CLAMP_TO_EDGE;
var pow = IsSizePowerOfTwo(width, height);
if (!noRepeat && pow)
{
wrapping = gl.REPEAT;
}
if (this.config.antialias)
{
minFilter = (pow && this.mipmapFilter) ? this.mipmapFilter : gl.LINEAR;
magFilter = gl.LINEAR;
}
dstTexture.update(srcVideo, width, height, flipY, wrapping, wrapping, minFilter, magFilter);
return dstTexture;
},
@ -195416,11 +195472,11 @@ var WebGLTextureWrapper = new Class({
* @param {HTMLCanvasElement|HTMLVideoElement} source - The source to update the WebGLTexture with.
* @param {number} width - The new width of the WebGLTexture.
* @param {number} height - The new height of the WebGLTexture.
* @param {boolean} [flipY] - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} [wrapS] - The new wrapping mode for the WebGLTexture.
* @param {number} [wrapT] - The new wrapping mode for the WebGLTexture.
* @param {number} [minFilter] - The new minification filter for the WebGLTexture.
* @param {number} [magFilter] - The new magnification filter for the WebGLTexture.
* @param {boolean} flipY - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} wrapS - The new wrapping mode for the WebGLTexture.
* @param {number} wrapT - The new wrapping mode for the WebGLTexture.
* @param {number} minFilter - The new minification filter for the WebGLTexture.
* @param {number} magFilter - The new magnification filter for the WebGLTexture.
*/
update: function (source, width, height, flipY, wrapS, wrapT, minFilter, magFilter)
{

File diff suppressed because one or more lines are too long

84
dist/phaser-ie9.js vendored
View file

@ -68780,7 +68780,8 @@ var UUID = __webpack_require__(45650);
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -84997,6 +84998,7 @@ var VideoRender = __webpack_require__(10247);
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.ComputedSize
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
@ -85005,7 +85007,6 @@ var VideoRender = __webpack_require__(10247);
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.PostPipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Size
* @extends Phaser.GameObjects.Components.TextureCrop
* @extends Phaser.GameObjects.Components.Tint
* @extends Phaser.GameObjects.Components.Transform
@ -85023,6 +85024,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
@ -85031,7 +85033,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
@ -86380,19 +86381,53 @@ var Video = new Class({
*/
metadataHandler: function (event)
{
var video = this.video;
this.emit(Events.VIDEO_METADATA, this, event);
},
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
*
* @method Phaser.GameObjects.Video#setSizeToFrame
* @since 3.0.0
*
* @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on.
*
* @return {this} This Game Object instance.
*/
setSizeToFrame: function (frame)
{
if (!frame) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
if (this.scaleX !== 1)
{
this.scaleX = this.displayWidth / video.videoWidth;
this.scaleX = this.displayWidth / this.width;
}
if (this.scaleY !== 1)
{
this.scaleY = this.displayHeight / video.videoHeight;
this.scaleY = this.displayHeight / this.height;
}
this.emit(Events.VIDEO_METADATA, this, event);
var input = this.input;
if (input && !input.customHitArea)
{
input.hitArea.width = this.width;
input.hitArea.height = this.height;
}
return this;
},
/**
@ -181934,17 +181969,38 @@ var WebGLRenderer = new Class({
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} dstTexture - The destination WebGLTextureWrapper to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
*
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The updated WebGLTextureWrapper. This is the same wrapper object as `dstTexture`.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
updateVideoTexture: function (srcVideo, dstTexture, flipY, noRepeat)
{
if (flipY === undefined) { flipY = false; }
if (noRepeat === undefined) { noRepeat = false; }
var gl = this.gl;
var minFilter = gl.NEAREST;
var magFilter = gl.NEAREST;
var width = srcVideo.videoWidth;
var height = srcVideo.videoHeight;
dstTexture.update(srcVideo, width, height, flipY);
var wrapping = gl.CLAMP_TO_EDGE;
var pow = IsSizePowerOfTwo(width, height);
if (!noRepeat && pow)
{
wrapping = gl.REPEAT;
}
if (this.config.antialias)
{
minFilter = (pow && this.mipmapFilter) ? this.mipmapFilter : gl.LINEAR;
magFilter = gl.LINEAR;
}
dstTexture.update(srcVideo, width, height, flipY, wrapping, wrapping, minFilter, magFilter);
return dstTexture;
},
@ -193036,11 +193092,11 @@ var WebGLTextureWrapper = new Class({
* @param {HTMLCanvasElement|HTMLVideoElement} source - The source to update the WebGLTexture with.
* @param {number} width - The new width of the WebGLTexture.
* @param {number} height - The new height of the WebGLTexture.
* @param {boolean} [flipY] - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} [wrapS] - The new wrapping mode for the WebGLTexture.
* @param {number} [wrapT] - The new wrapping mode for the WebGLTexture.
* @param {number} [minFilter] - The new minification filter for the WebGLTexture.
* @param {number} [magFilter] - The new magnification filter for the WebGLTexture.
* @param {boolean} flipY - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} wrapS - The new wrapping mode for the WebGLTexture.
* @param {number} wrapT - The new wrapping mode for the WebGLTexture.
* @param {number} minFilter - The new minification filter for the WebGLTexture.
* @param {number} magFilter - The new magnification filter for the WebGLTexture.
*/
update: function (source, width, height, flipY, wrapS, wrapT, minFilter, magFilter)
{

File diff suppressed because one or more lines are too long

84
dist/phaser.esm.js vendored
View file

@ -68768,7 +68768,8 @@ var UUID = __webpack_require__(45650);
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -84985,6 +84986,7 @@ var VideoRender = __webpack_require__(10247);
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.ComputedSize
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
@ -84993,7 +84995,6 @@ var VideoRender = __webpack_require__(10247);
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.PostPipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Size
* @extends Phaser.GameObjects.Components.TextureCrop
* @extends Phaser.GameObjects.Components.Tint
* @extends Phaser.GameObjects.Components.Transform
@ -85011,6 +85012,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
@ -85019,7 +85021,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
@ -86368,19 +86369,53 @@ var Video = new Class({
*/
metadataHandler: function (event)
{
var video = this.video;
this.emit(Events.VIDEO_METADATA, this, event);
},
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
*
* @method Phaser.GameObjects.Video#setSizeToFrame
* @since 3.0.0
*
* @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on.
*
* @return {this} This Game Object instance.
*/
setSizeToFrame: function (frame)
{
if (!frame) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
if (this.scaleX !== 1)
{
this.scaleX = this.displayWidth / video.videoWidth;
this.scaleX = this.displayWidth / this.width;
}
if (this.scaleY !== 1)
{
this.scaleY = this.displayHeight / video.videoHeight;
this.scaleY = this.displayHeight / this.height;
}
this.emit(Events.VIDEO_METADATA, this, event);
var input = this.input;
if (input && !input.customHitArea)
{
input.hitArea.width = this.width;
input.hitArea.height = this.height;
}
return this;
},
/**
@ -181384,17 +181419,38 @@ var WebGLRenderer = new Class({
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} dstTexture - The destination WebGLTextureWrapper to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
*
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The updated WebGLTextureWrapper. This is the same wrapper object as `dstTexture`.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
updateVideoTexture: function (srcVideo, dstTexture, flipY, noRepeat)
{
if (flipY === undefined) { flipY = false; }
if (noRepeat === undefined) { noRepeat = false; }
var gl = this.gl;
var minFilter = gl.NEAREST;
var magFilter = gl.NEAREST;
var width = srcVideo.videoWidth;
var height = srcVideo.videoHeight;
dstTexture.update(srcVideo, width, height, flipY);
var wrapping = gl.CLAMP_TO_EDGE;
var pow = IsSizePowerOfTwo(width, height);
if (!noRepeat && pow)
{
wrapping = gl.REPEAT;
}
if (this.config.antialias)
{
minFilter = (pow && this.mipmapFilter) ? this.mipmapFilter : gl.LINEAR;
magFilter = gl.LINEAR;
}
dstTexture.update(srcVideo, width, height, flipY, wrapping, wrapping, minFilter, magFilter);
return dstTexture;
},
@ -192486,11 +192542,11 @@ var WebGLTextureWrapper = new Class({
* @param {HTMLCanvasElement|HTMLVideoElement} source - The source to update the WebGLTexture with.
* @param {number} width - The new width of the WebGLTexture.
* @param {number} height - The new height of the WebGLTexture.
* @param {boolean} [flipY] - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} [wrapS] - The new wrapping mode for the WebGLTexture.
* @param {number} [wrapT] - The new wrapping mode for the WebGLTexture.
* @param {number} [minFilter] - The new minification filter for the WebGLTexture.
* @param {number} [magFilter] - The new magnification filter for the WebGLTexture.
* @param {boolean} flipY - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} wrapS - The new wrapping mode for the WebGLTexture.
* @param {number} wrapT - The new wrapping mode for the WebGLTexture.
* @param {number} minFilter - The new minification filter for the WebGLTexture.
* @param {number} magFilter - The new magnification filter for the WebGLTexture.
*/
update: function (source, width, height, flipY, wrapS, wrapT, minFilter, magFilter)
{

File diff suppressed because one or more lines are too long

84
dist/phaser.js vendored
View file

@ -68780,7 +68780,8 @@ var UUID = __webpack_require__(45650);
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -84997,6 +84998,7 @@ var VideoRender = __webpack_require__(10247);
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.ComputedSize
* @extends Phaser.GameObjects.Components.Depth
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.GetBounds
@ -85005,7 +85007,6 @@ var VideoRender = __webpack_require__(10247);
* @extends Phaser.GameObjects.Components.Pipeline
* @extends Phaser.GameObjects.Components.PostPipeline
* @extends Phaser.GameObjects.Components.ScrollFactor
* @extends Phaser.GameObjects.Components.Size
* @extends Phaser.GameObjects.Components.TextureCrop
* @extends Phaser.GameObjects.Components.Tint
* @extends Phaser.GameObjects.Components.Transform
@ -85023,6 +85024,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
@ -85031,7 +85033,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
@ -86380,19 +86381,53 @@ var Video = new Class({
*/
metadataHandler: function (event)
{
var video = this.video;
this.emit(Events.VIDEO_METADATA, this, event);
},
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
*
* @method Phaser.GameObjects.Video#setSizeToFrame
* @since 3.0.0
*
* @param {Phaser.Textures.Frame|boolean} [frame] - The frame to base the size of this Game Object on.
*
* @return {this} This Game Object instance.
*/
setSizeToFrame: function (frame)
{
if (!frame) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
if (this.scaleX !== 1)
{
this.scaleX = this.displayWidth / video.videoWidth;
this.scaleX = this.displayWidth / this.width;
}
if (this.scaleY !== 1)
{
this.scaleY = this.displayHeight / video.videoHeight;
this.scaleY = this.displayHeight / this.height;
}
this.emit(Events.VIDEO_METADATA, this, event);
var input = this.input;
if (input && !input.customHitArea)
{
input.hitArea.width = this.width;
input.hitArea.height = this.height;
}
return this;
},
/**
@ -181492,17 +181527,38 @@ var WebGLRenderer = new Class({
* @param {HTMLVideoElement} srcVideo - The Video to update the WebGL Texture with.
* @param {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} dstTexture - The destination WebGLTextureWrapper to update.
* @param {boolean} [flipY=false] - Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {boolean} [noRepeat=false] - Should this canvas be allowed to set `REPEAT`?
*
* @return {Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper} The updated WebGLTextureWrapper. This is the same wrapper object as `dstTexture`.
*/
updateVideoTexture: function (srcVideo, dstTexture, flipY)
updateVideoTexture: function (srcVideo, dstTexture, flipY, noRepeat)
{
if (flipY === undefined) { flipY = false; }
if (noRepeat === undefined) { noRepeat = false; }
var gl = this.gl;
var minFilter = gl.NEAREST;
var magFilter = gl.NEAREST;
var width = srcVideo.videoWidth;
var height = srcVideo.videoHeight;
dstTexture.update(srcVideo, width, height, flipY);
var wrapping = gl.CLAMP_TO_EDGE;
var pow = IsSizePowerOfTwo(width, height);
if (!noRepeat && pow)
{
wrapping = gl.REPEAT;
}
if (this.config.antialias)
{
minFilter = (pow && this.mipmapFilter) ? this.mipmapFilter : gl.LINEAR;
magFilter = gl.LINEAR;
}
dstTexture.update(srcVideo, width, height, flipY, wrapping, wrapping, minFilter, magFilter);
return dstTexture;
},
@ -192594,11 +192650,11 @@ var WebGLTextureWrapper = new Class({
* @param {HTMLCanvasElement|HTMLVideoElement} source - The source to update the WebGLTexture with.
* @param {number} width - The new width of the WebGLTexture.
* @param {number} height - The new height of the WebGLTexture.
* @param {boolean} [flipY] - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} [wrapS] - The new wrapping mode for the WebGLTexture.
* @param {number} [wrapT] - The new wrapping mode for the WebGLTexture.
* @param {number} [minFilter] - The new minification filter for the WebGLTexture.
* @param {number} [magFilter] - The new magnification filter for the WebGLTexture.
* @param {boolean} flipY - Should the WebGLTexture set `UNPACK_MULTIPLY_FLIP_Y`?
* @param {number} wrapS - The new wrapping mode for the WebGLTexture.
* @param {number} wrapT - The new wrapping mode for the WebGLTexture.
* @param {number} minFilter - The new minification filter for the WebGLTexture.
* @param {number} magFilter - The new magnification filter for the WebGLTexture.
*/
update: function (source, width, height, flipY, wrapS, wrapT, minFilter, magFilter)
{

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long

158
types/phaser.d.ts vendored
View file

@ -32472,7 +32472,8 @@ declare namespace Phaser {
* atlas or sprite sheet.
*
* The Plane Game Object also has the Animation component, allowing you to play animations
* across the Plane just as you would with a Sprite.
* across the Plane just as you would with a Sprite. The animation frame size must be fixed
* as the first frame will be the size of the entire animation, for example use a `SpriteSheet`.
*
* Note that the Plane object is WebGL only and does not have a Canvas counterpart.
*
@ -52711,7 +52712,7 @@ declare namespace Phaser {
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
* https://developer.mozilla.org/en-US/docs/Web/Media/Formats
*/
class Video extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.PostPipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible {
class Video extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.PostPipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible {
/**
*
* @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
@ -53134,6 +53135,20 @@ declare namespace Phaser {
*/
metadataHandler(event: Event): void;
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
* @param frame The frame to base the size of this Game Object on.
*/
setSizeToFrame(frame?: Phaser.Textures.Frame | boolean): this;
/**
* This internal method is called automatically if the video stalls, for whatever reason.
* @param event The error Event.
@ -53479,6 +53494,66 @@ declare namespace Phaser {
*/
setBlendMode(value: string | Phaser.BlendModes | number): this;
/**
* The native (un-scaled) width of this Game Object.
*
* Changing this value will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or use
* the `displayWidth` property.
*/
width: number;
/**
* The native (un-scaled) height of this Game Object.
*
* Changing this value will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or use
* the `displayHeight` property.
*/
height: number;
/**
* The displayed width of this Game Object.
*
* This value takes into account the scale factor.
*
* Setting this value will adjust the Game Object's scale property.
*/
displayWidth: number;
/**
* The displayed height of this Game Object.
*
* This value takes into account the scale factor.
*
* Setting this value will adjust the Game Object's scale property.
*/
displayHeight: number;
/**
* Sets the internal size of this Game Object, as used for frame or physics body creation.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
* @param width The width of this Game Object.
* @param height The height of this Game Object.
*/
setSize(width: number, height: number): this;
/**
* Sets the display size of this Game Object.
*
* Calling this will adjust the scale.
* @param width The width of this Game Object.
* @param height The height of this Game Object.
*/
setDisplaySize(width: number, height: number): this;
/**
* The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type.
*
@ -54038,80 +54113,6 @@ declare namespace Phaser {
*/
setScrollFactor(x: number, y?: number): this;
/**
* The native (un-scaled) width of this Game Object.
*
* Changing this value will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or use
* the `displayWidth` property.
*/
width: number;
/**
* The native (un-scaled) height of this Game Object.
*
* Changing this value will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or use
* the `displayHeight` property.
*/
height: number;
/**
* The displayed width of this Game Object.
*
* This value takes into account the scale factor.
*
* Setting this value will adjust the Game Object's scale property.
*/
displayWidth: number;
/**
* The displayed height of this Game Object.
*
* This value takes into account the scale factor.
*
* Setting this value will adjust the Game Object's scale property.
*/
displayHeight: number;
/**
* Sets the size of this Game Object to be that of the given Frame.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
* @param frame The frame to base the size of this Game Object on.
*/
setSizeToFrame(frame?: Phaser.Textures.Frame | boolean): this;
/**
* Sets the internal size of this Game Object, as used for frame or physics body creation.
*
* This will not change the size that the Game Object is rendered in-game.
* For that you need to either set the scale of the Game Object (`setScale`) or call the
* `setDisplaySize` method, which is the same thing as changing the scale but allows you
* to do so by giving pixel values.
*
* If you have enabled this Game Object for input, changing the size will _not_ change the
* size of the hit area. To do this you should adjust the `input.hitArea` object directly.
* @param width The width of this Game Object.
* @param height The height of this Game Object.
*/
setSize(width: number, height: number): this;
/**
* Sets the display size of this Game Object.
*
* Calling this will adjust the scale.
* @param width The width of this Game Object.
* @param height The height of this Game Object.
*/
setDisplaySize(width: number, height: number): this;
/**
* The Texture this Game Object is using to render with.
*/
@ -95495,8 +95496,9 @@ declare namespace Phaser {
* @param srcVideo The Video to update the WebGL Texture with.
* @param dstTexture The destination WebGLTextureWrapper to update.
* @param flipY Should the WebGL Texture set `UNPACK_MULTIPLY_FLIP_Y`? Default false.
* @param noRepeat Should this canvas be allowed to set `REPEAT`? Default false.
*/
updateVideoTexture(srcVideo: HTMLVideoElement, dstTexture: Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper, flipY?: boolean): Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper;
updateVideoTexture(srcVideo: HTMLVideoElement, dstTexture: Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper, flipY?: boolean, noRepeat?: boolean): Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper;
/**
* Create a WebGLTexture from a Uint8Array.
@ -99074,7 +99076,7 @@ declare namespace Phaser {
* @param minFilter The new minification filter for the WebGLTexture.
* @param magFilter The new magnification filter for the WebGLTexture.
*/
update(source: HTMLCanvasElement | HTMLVideoElement, width: number, height: number, flipY?: boolean, wrapS?: number, wrapT?: number, minFilter?: number, magFilter?: number): void;
update(source: HTMLCanvasElement | HTMLVideoElement, width: number, height: number, flipY: boolean, wrapS: number, wrapT: number, minFilter: number, magFilter: number): void;
/**
* The `__SPECTOR_Metadata` property of the `WebGLTexture`,

File diff suppressed because it is too large Load diff