Skip to content

Commit

Permalink
v3.80 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Feb 21, 2024
1 parent 66ab05f commit a4aa78b
Show file tree
Hide file tree
Showing 12 changed files with 16,988 additions and 16,698 deletions.
84 changes: 70 additions & 14 deletions dist/phaser-arcade-physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -85023,6 +85024,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
Expand All @@ -85031,7 +85033,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
Expand Down Expand Up @@ -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;
},

/**
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion dist/phaser-arcade-physics.min.js

Large diffs are not rendered by default.

84 changes: 70 additions & 14 deletions dist/phaser-facebook-instant-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -87838,6 +87839,7 @@ var Video = new Class({
Mixins: [
Components.Alpha,
Components.BlendMode,
Components.ComputedSize,
Components.Depth,
Components.Flip,
Components.GetBounds,
Expand All @@ -87846,7 +87848,6 @@ var Video = new Class({
Components.Pipeline,
Components.PostPipeline,
Components.ScrollFactor,
Components.Size,
Components.TextureCrop,
Components.Tint,
Components.Transform,
Expand Down Expand Up @@ -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;
},

/**
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion dist/phaser-facebook-instant-games.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a4aa78b

Please sign in to comment.