mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
v3.60 Beta 12
This commit is contained in:
parent
07e0753e74
commit
5fdb91217e
7 changed files with 14666 additions and 14214 deletions
442
dist/phaser-arcade-physics.js
vendored
442
dist/phaser-arcade-physics.js
vendored
|
@ -15404,7 +15404,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.11',
|
||||
VERSION: '3.60.0-beta.12',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -32467,7 +32467,7 @@ var GameObject = new Class({
|
|||
{
|
||||
var displayList = this.displayList || this.scene.sys.displayList;
|
||||
|
||||
if (displayList.exists(this))
|
||||
if (displayList && displayList.exists(this))
|
||||
{
|
||||
displayList.remove(this, true);
|
||||
|
||||
|
@ -33862,6 +33862,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
|
||||
characters.push({
|
||||
i: charIndex,
|
||||
idx: i,
|
||||
char: text[i],
|
||||
code: charCode,
|
||||
x: (glyph.xOffset + x) * scale,
|
||||
|
@ -37560,15 +37561,9 @@ var tempMatrix = new TransformMatrix();
|
|||
var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
||||
{
|
||||
var list = src.getRenderList();
|
||||
|
||||
if (list.length === 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alpha = camera.alpha * src.alpha;
|
||||
|
||||
if (alpha === 0)
|
||||
if (list.length === 0 || alpha === 0)
|
||||
{
|
||||
// Nothing to see, so abort early
|
||||
return;
|
||||
|
@ -37599,9 +37594,9 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
renderer.pipelines.preBatch(src);
|
||||
|
||||
for (var index = 0; index < list.length; index++)
|
||||
for (var i = 0; i < list.length; i++)
|
||||
{
|
||||
var bob = list[index];
|
||||
var bob = list[i];
|
||||
var frame = bob.frame;
|
||||
var bobAlpha = bob.alpha * alpha;
|
||||
|
||||
|
@ -37628,14 +37623,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
y += frame.height;
|
||||
}
|
||||
|
||||
var xw = x + width;
|
||||
var yh = y + height;
|
||||
|
||||
var tx0 = calcMatrix.getX(x, y);
|
||||
var ty0 = calcMatrix.getY(x, y);
|
||||
|
||||
var tx1 = calcMatrix.getX(xw, yh);
|
||||
var ty1 = calcMatrix.getY(xw, yh);
|
||||
var quad = calcMatrix.setQuad(x, y, x + width, y + height, roundPixels);
|
||||
|
||||
var tint = Utils.getTintAppendFloatAlpha(bob.tint, bobAlpha);
|
||||
|
||||
|
@ -37647,17 +37635,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
prevTextureSourceIndex = frame.sourceIndex;
|
||||
}
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
tx0 = Math.round(tx0);
|
||||
ty0 = Math.round(ty0);
|
||||
|
||||
tx1 = Math.round(tx1);
|
||||
ty1 = Math.round(ty1);
|
||||
}
|
||||
|
||||
// TL x/y, BL x/y, BR x/y, TR x/y
|
||||
if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
if (pipeline.batchQuad(src, quad[0], quad[1], quad[2], quad[3], quad[4], quad[5], quad[6], quad[7], frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
{
|
||||
prevTextureSourceIndex = -1;
|
||||
}
|
||||
|
@ -49654,6 +49632,7 @@ var EventEmitter = __webpack_require__(6659);
|
|||
var GetAll = __webpack_require__(71608);
|
||||
var GetFastValue = __webpack_require__(72632);
|
||||
var GetValue = __webpack_require__(10850);
|
||||
var HasValue = __webpack_require__(19256);
|
||||
var IsPlainObject = __webpack_require__(42911);
|
||||
var Range = __webpack_require__(75757);
|
||||
var Set = __webpack_require__(58403);
|
||||
|
@ -50086,48 +50065,69 @@ var Group = new Class({
|
|||
|
||||
// Post-creation options (applied only to those items created in this call):
|
||||
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
if (HasValue(options, 'setXY'))
|
||||
{
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
}
|
||||
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
if (HasValue(options, 'setRotation'))
|
||||
{
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
}
|
||||
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
if (HasValue(options, 'setScale'))
|
||||
{
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
}
|
||||
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
if (HasValue(options, 'setOrigin'))
|
||||
{
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
}
|
||||
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
if (HasValue(options, 'setAlpha'))
|
||||
{
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
}
|
||||
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
if (HasValue(options, 'setDepth'))
|
||||
{
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
}
|
||||
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
if (HasValue(options, 'setScrollFactor'))
|
||||
{
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
}
|
||||
|
||||
var hitArea = GetFastValue(options, 'hitArea', null);
|
||||
var hitAreaCallback = GetFastValue(options, 'hitAreaCallback', null);
|
||||
|
@ -64749,6 +64749,7 @@ var Line = __webpack_require__(88829);
|
|||
* @extends Phaser.GameObjects.Components.AlphaSingle
|
||||
* @extends Phaser.GameObjects.Components.BlendMode
|
||||
* @extends Phaser.GameObjects.Components.Depth
|
||||
* @extends Phaser.GameObjects.Components.FX
|
||||
* @extends Phaser.GameObjects.Components.GetBounds
|
||||
* @extends Phaser.GameObjects.Components.Mask
|
||||
* @extends Phaser.GameObjects.Components.Origin
|
||||
|
@ -64770,6 +64771,7 @@ var Shape = new Class({
|
|||
Components.BlendMode,
|
||||
Components.Depth,
|
||||
Components.GetBounds,
|
||||
Components.FX,
|
||||
Components.Mask,
|
||||
Components.Origin,
|
||||
Components.Pipeline,
|
||||
|
@ -75745,6 +75747,7 @@ var Video = new Class({
|
|||
*/
|
||||
this._callbacks = {
|
||||
play: this.playHandler.bind(this),
|
||||
load: this.loadHandler.bind(this),
|
||||
error: this.loadErrorHandler.bind(this),
|
||||
end: this.completeHandler.bind(this),
|
||||
time: this.timeUpdateHandler.bind(this),
|
||||
|
@ -76305,6 +76308,7 @@ var Video = new Class({
|
|||
}
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
video.src = url;
|
||||
|
||||
|
@ -76362,6 +76366,7 @@ var Video = new Class({
|
|||
video.setAttribute('preload', 'auto');
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -76439,6 +76444,18 @@ var Video = new Class({
|
|||
this.video.removeEventListener('playing', this._callbacks.play, true);
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically when the video loads.
|
||||
*
|
||||
* @method Phaser.GameObjects.Video#loadHandler
|
||||
* @private
|
||||
* @since 3.60.0
|
||||
*/
|
||||
loadHandler: function ()
|
||||
{
|
||||
this.updateTexture();
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically if the video fails to load.
|
||||
*
|
||||
|
@ -130102,10 +130119,11 @@ var ArcadePhysics = new Class({
|
|||
* @method Phaser.Physics.Arcade.ArcadePhysics#closest
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[]|Phaser.GameObjects.GameObject[])} [targets] - The targets.
|
||||
* @generic {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject} Target
|
||||
* @param {Phaser.Types.Math.Vector2Like} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {Target[]} [targets] - The targets.
|
||||
*
|
||||
* @return {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject)} The target closest to the given source point.
|
||||
* @return {Target|null} The target closest to the given source point.
|
||||
*/
|
||||
closest: function (source, targets)
|
||||
{
|
||||
|
@ -154399,7 +154417,6 @@ var MultiPipeline = new Class({
|
|||
|
||||
var quad = calcMatrix.setQuad(x, y, x + frame.width, y + frame.height, false);
|
||||
|
||||
// var unit = this.renderer.setTextureSource(frame.source);
|
||||
var unit = this.setTexture2D(frame.source.glTexture);
|
||||
|
||||
tint = Utils.getTintAppendFloatAlpha(tint, alpha);
|
||||
|
@ -154758,6 +154775,30 @@ var MultiPipeline = new Class({
|
|||
prev[3] = trY;
|
||||
prev[4] = 1;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys all shader instances, removes all object references and nulls all external references.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#destroy
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#DESTROY
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
*/
|
||||
destroy: function ()
|
||||
{
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -155605,8 +155646,6 @@ var Rectangle = __webpack_require__(74118);
|
|||
var RenderTarget = __webpack_require__(37410);
|
||||
var SingleQuadFS = __webpack_require__(85060);
|
||||
var SingleQuadVS = __webpack_require__(18166);
|
||||
var TransformMatrix = __webpack_require__(69360);
|
||||
var WEBGL_CONST = __webpack_require__(71402);
|
||||
var WebGLPipeline = __webpack_require__(44775);
|
||||
|
||||
/**
|
||||
|
@ -155625,6 +155664,7 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
* Text
|
||||
* TileSprite
|
||||
* RenderTexture
|
||||
* Shape
|
||||
*
|
||||
* // TODO - Explain about the fbos and functions
|
||||
*
|
||||
|
@ -155638,35 +155678,12 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
*/
|
||||
var SpriteFXPipeline = new Class({
|
||||
|
||||
Extends: WebGLPipeline,
|
||||
Extends: MultiPipeline,
|
||||
|
||||
initialize:
|
||||
|
||||
function SpriteFXPipeline (config)
|
||||
{
|
||||
config.attributes = GetFastValue(config, 'attributes', [
|
||||
{
|
||||
name: 'inPosition',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexCoord',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexId'
|
||||
},
|
||||
{
|
||||
name: 'inTintEffect'
|
||||
},
|
||||
{
|
||||
name: 'inTint',
|
||||
size: 4,
|
||||
type: WEBGL_CONST.UNSIGNED_BYTE,
|
||||
normalized: true
|
||||
}
|
||||
]);
|
||||
|
||||
var fragShader = GetFastValue(config, 'fragShader', PostFXFS);
|
||||
var vertShader = GetFastValue(config, 'vertShader', SingleQuadVS);
|
||||
var drawShader = GetFastValue(config, 'drawShader', PostFXFS);
|
||||
|
@ -155700,39 +155717,11 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
config.batchSize = 1;
|
||||
|
||||
WebGLPipeline.call(this, config);
|
||||
MultiPipeline.call(this, config);
|
||||
|
||||
this.isSpriteFX = true;
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix1
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix1 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix2
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix2 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix3
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix3 = new TransformMatrix();
|
||||
this.customMainSampler = null;
|
||||
|
||||
/**
|
||||
* A reference to the Draw Sprite Shader belonging to this Pipeline.
|
||||
|
@ -155917,93 +155906,6 @@ var SpriteFXPipeline = new Class({
|
|||
vertexViewF32[36] = height; // y3
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a Sprite Game Object, or any object that extends it, and renders it via this pipeline.
|
||||
*
|
||||
* this method is a proxy for the MultiPipeline method of the same name. The actual rendering
|
||||
* is redirected through to the `batchQuad` method in this pipeline.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchSprite
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.
|
||||
*/
|
||||
batchSprite: function (gameObject, camera, parentTransformMatrix)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
MultiPipeline.prototype.batchSprite.call(this, gameObject, camera, parentTransformMatrix);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generic function for batching a textured quad using argument values instead of a Game Object.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchTexture
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject.
|
||||
* @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad.
|
||||
* @param {number} textureWidth - Real texture width.
|
||||
* @param {number} textureHeight - Real texture height.
|
||||
* @param {number} srcX - X coordinate of the quad.
|
||||
* @param {number} srcY - Y coordinate of the quad.
|
||||
* @param {number} srcWidth - Width of the quad.
|
||||
* @param {number} srcHeight - Height of the quad.
|
||||
* @param {number} scaleX - X component of scale.
|
||||
* @param {number} scaleY - Y component of scale.
|
||||
* @param {number} rotation - Rotation of the quad.
|
||||
* @param {boolean} flipX - Indicates if the quad is horizontally flipped.
|
||||
* @param {boolean} flipY - Indicates if the quad is vertically flipped.
|
||||
* @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll.
|
||||
* @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll.
|
||||
* @param {number} displayOriginX - Horizontal origin in pixels.
|
||||
* @param {number} displayOriginY - Vertical origin in pixels.
|
||||
* @param {number} frameX - X coordinate of the texture frame.
|
||||
* @param {number} frameY - Y coordinate of the texture frame.
|
||||
* @param {number} frameWidth - Width of the texture frame.
|
||||
* @param {number} frameHeight - Height of the texture frame.
|
||||
* @param {number} tintTL - Tint for top left.
|
||||
* @param {number} tintTR - Tint for top right.
|
||||
* @param {number} tintBL - Tint for bottom left.
|
||||
* @param {number} tintBR - Tint for bottom right.
|
||||
* @param {number} tintEffect - The tint effect.
|
||||
* @param {number} uOffset - Horizontal offset on texture coordinate.
|
||||
* @param {number} vOffset - Vertical offset on texture coordinate.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container.
|
||||
* @param {boolean} [skipFlip=false] - Skip the renderTexture check.
|
||||
* @param {number} [textureUnit] - Use the currently bound texture unit?
|
||||
*/
|
||||
batchTexture: function (
|
||||
gameObject,
|
||||
texture,
|
||||
textureWidth, textureHeight,
|
||||
srcX, srcY,
|
||||
srcWidth, srcHeight,
|
||||
scaleX, scaleY,
|
||||
rotation,
|
||||
flipX, flipY,
|
||||
scrollFactorX, scrollFactorY,
|
||||
displayOriginX, displayOriginY,
|
||||
frameX, frameY, frameWidth, frameHeight,
|
||||
tintTL, tintTR, tintBL, tintBR, tintEffect,
|
||||
uOffset, vOffset,
|
||||
camera,
|
||||
parentTransformMatrix,
|
||||
skipFlip,
|
||||
textureUnit)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
|
||||
// Needed for Text & TileSprite - how about others?
|
||||
// flipY = true;
|
||||
|
||||
MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit);
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds the vertices data into the batch and flushes if full.
|
||||
*
|
||||
|
@ -156057,7 +155959,7 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
var bounds = this.spriteBounds.setTo(bx, by, bw, bh);
|
||||
|
||||
var padding = gameObject.fxPadding;
|
||||
var padding = (gameObject) ? gameObject.fxPadding : 0;
|
||||
var width = bw + (padding * 2);
|
||||
var height = bh + (padding * 2);
|
||||
var maxDimension = Math.abs(Math.max(width, height));
|
||||
|
@ -156082,9 +155984,12 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
this.flipProjectionMatrix(true);
|
||||
|
||||
this.onDrawSprite(gameObject, target);
|
||||
if (gameObject)
|
||||
{
|
||||
this.onDrawSprite(gameObject, target);
|
||||
|
||||
gameObject.onFX(this);
|
||||
gameObject.onFX(this);
|
||||
}
|
||||
|
||||
var fsTarget = this.fsTarget;
|
||||
|
||||
|
@ -156374,8 +156279,14 @@ var SpriteFXPipeline = new Class({
|
|||
gl.viewport(0, 0, renderer.width, renderer.height);
|
||||
}
|
||||
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, source.texture);
|
||||
if (this.customMainSampler)
|
||||
{
|
||||
this.setTexture2D(this.customMainSampler);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setTexture2D(source.texture);
|
||||
}
|
||||
|
||||
var matrix = this._tempMatrix1.loadIdentity();
|
||||
|
||||
|
@ -156415,6 +156326,79 @@ var SpriteFXPipeline = new Class({
|
|||
this.tempSprite = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Uploads the vertex data and emits a draw call for the current batch of vertices.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLPipeline#flush
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not?
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
flush: function (isPostFlush)
|
||||
{
|
||||
if (isPostFlush === undefined) { isPostFlush = false; }
|
||||
|
||||
if (this.vertexCount > 0)
|
||||
{
|
||||
// this.emit(Events.BEFORE_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onBeforeFlush(isPostFlush);
|
||||
|
||||
var gl = this.gl;
|
||||
var vertexCount = this.vertexCount;
|
||||
var vertexSize = this.currentShader.vertexSize;
|
||||
var topology = this.topology;
|
||||
|
||||
if (this.active)
|
||||
{
|
||||
this.setVertexBuffer();
|
||||
|
||||
if (vertexCount === this.vertexCapacity)
|
||||
{
|
||||
gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));
|
||||
}
|
||||
|
||||
var i;
|
||||
var entry;
|
||||
var batch = this.batch;
|
||||
|
||||
for (i = 0; i < batch.length; i++)
|
||||
{
|
||||
entry = batch[i];
|
||||
|
||||
for (var t = 0; t <= entry.maxUnit; t++)
|
||||
{
|
||||
gl.activeTexture(gl.TEXTURE0 + t);
|
||||
gl.bindTexture(gl.TEXTURE_2D, entry.texture[t]);
|
||||
}
|
||||
|
||||
gl.drawArrays(topology, entry.start, entry.count);
|
||||
}
|
||||
}
|
||||
|
||||
this.vertexCount = 0;
|
||||
|
||||
this.batch.length = 0;
|
||||
this.currentBatch = null;
|
||||
this.currentTexture = null;
|
||||
this.currentUnit = 0;
|
||||
|
||||
// this.emit(Events.AFTER_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onAfterFlush(isPostFlush);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method is called every time the `batchSprite` method is called and is passed a
|
||||
* reference to the current render target.
|
||||
|
@ -156529,14 +156513,6 @@ var SpriteFXPipeline = new Class({
|
|||
{
|
||||
this.gl.deleteBuffer(this.quadVertexBuffer);
|
||||
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
this.drawSpriteShader = null;
|
||||
this.copyShader = null;
|
||||
this.gameShader = null;
|
||||
|
@ -156548,7 +156524,9 @@ var SpriteFXPipeline = new Class({
|
|||
this.fsTarget = null;
|
||||
this.tempSprite = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
MultiPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -163126,6 +163104,15 @@ var ScenePlugin = new Class({
|
|||
this.manager.start(key, GetFastValue(config, 'data'));
|
||||
}
|
||||
|
||||
var onStartCallback = GetFastValue(config, 'onStart', null);
|
||||
|
||||
var onStartScope = GetFastValue(config, 'onStartScope', this.scene);
|
||||
|
||||
if (onStartCallback)
|
||||
{
|
||||
onStartCallback.call(onStartScope, this.scene, target, duration);
|
||||
}
|
||||
|
||||
this.systems.events.emit(Events.TRANSITION_OUT, target, duration);
|
||||
|
||||
this.systems.events.on(Events.UPDATE, this.step, this);
|
||||
|
@ -176148,6 +176135,7 @@ var DynamicTexture = new Class({
|
|||
|
||||
renderer.setContext(ctx);
|
||||
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
|
||||
ctx.fillRect(x, y, width, height);
|
||||
|
||||
|
@ -176844,8 +176832,6 @@ var DynamicTexture = new Class({
|
|||
{
|
||||
if (this.renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -177144,8 +177130,6 @@ var DynamicTexture = new Class({
|
|||
|
||||
if (renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -197197,7 +197181,7 @@ var TweenManager = new Class({
|
|||
|
||||
for (var t = 0; t < targetLen; t++)
|
||||
{
|
||||
if (tween.hasTarget(target[t]))
|
||||
if (!tween.isDestroyed() && tween.hasTarget(target[t]))
|
||||
{
|
||||
output.push(tween);
|
||||
}
|
||||
|
@ -199881,7 +199865,7 @@ var BaseTween = new Class({
|
|||
*/
|
||||
stop: function ()
|
||||
{
|
||||
if (!this.isRemoved() && !this.isPendingRemove())
|
||||
if (!this.isRemoved() && !this.isPendingRemove() && !this.isDestroyed())
|
||||
{
|
||||
this.dispatchEvent(Events.TWEEN_STOP, 'onStop');
|
||||
|
||||
|
@ -201072,7 +201056,7 @@ var Tween = new Class({
|
|||
*/
|
||||
hasTarget: function (target)
|
||||
{
|
||||
return (this.targets.indexOf(target) !== -1);
|
||||
return (this.targets && this.targets.indexOf(target) !== -1);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -201429,10 +201413,14 @@ var Tween = new Class({
|
|||
if (this.isLoopDelayed())
|
||||
{
|
||||
this.updateLoopCountdown(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (this.isCompleteDelayed())
|
||||
{
|
||||
this.updateCompleteDelay(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (!this.hasStarted && !this.isSeeking)
|
||||
{
|
||||
|
|
2
dist/phaser-arcade-physics.min.js
vendored
2
dist/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
442
dist/phaser-ie9.js
vendored
442
dist/phaser-ie9.js
vendored
|
@ -15404,7 +15404,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.11',
|
||||
VERSION: '3.60.0-beta.12',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -32467,7 +32467,7 @@ var GameObject = new Class({
|
|||
{
|
||||
var displayList = this.displayList || this.scene.sys.displayList;
|
||||
|
||||
if (displayList.exists(this))
|
||||
if (displayList && displayList.exists(this))
|
||||
{
|
||||
displayList.remove(this, true);
|
||||
|
||||
|
@ -33862,6 +33862,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
|
||||
characters.push({
|
||||
i: charIndex,
|
||||
idx: i,
|
||||
char: text[i],
|
||||
code: charCode,
|
||||
x: (glyph.xOffset + x) * scale,
|
||||
|
@ -37560,15 +37561,9 @@ var tempMatrix = new TransformMatrix();
|
|||
var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
||||
{
|
||||
var list = src.getRenderList();
|
||||
|
||||
if (list.length === 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alpha = camera.alpha * src.alpha;
|
||||
|
||||
if (alpha === 0)
|
||||
if (list.length === 0 || alpha === 0)
|
||||
{
|
||||
// Nothing to see, so abort early
|
||||
return;
|
||||
|
@ -37599,9 +37594,9 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
renderer.pipelines.preBatch(src);
|
||||
|
||||
for (var index = 0; index < list.length; index++)
|
||||
for (var i = 0; i < list.length; i++)
|
||||
{
|
||||
var bob = list[index];
|
||||
var bob = list[i];
|
||||
var frame = bob.frame;
|
||||
var bobAlpha = bob.alpha * alpha;
|
||||
|
||||
|
@ -37628,14 +37623,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
y += frame.height;
|
||||
}
|
||||
|
||||
var xw = x + width;
|
||||
var yh = y + height;
|
||||
|
||||
var tx0 = calcMatrix.getX(x, y);
|
||||
var ty0 = calcMatrix.getY(x, y);
|
||||
|
||||
var tx1 = calcMatrix.getX(xw, yh);
|
||||
var ty1 = calcMatrix.getY(xw, yh);
|
||||
var quad = calcMatrix.setQuad(x, y, x + width, y + height, roundPixels);
|
||||
|
||||
var tint = Utils.getTintAppendFloatAlpha(bob.tint, bobAlpha);
|
||||
|
||||
|
@ -37647,17 +37635,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
prevTextureSourceIndex = frame.sourceIndex;
|
||||
}
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
tx0 = Math.round(tx0);
|
||||
ty0 = Math.round(ty0);
|
||||
|
||||
tx1 = Math.round(tx1);
|
||||
ty1 = Math.round(ty1);
|
||||
}
|
||||
|
||||
// TL x/y, BL x/y, BR x/y, TR x/y
|
||||
if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
if (pipeline.batchQuad(src, quad[0], quad[1], quad[2], quad[3], quad[4], quad[5], quad[6], quad[7], frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
{
|
||||
prevTextureSourceIndex = -1;
|
||||
}
|
||||
|
@ -49654,6 +49632,7 @@ var EventEmitter = __webpack_require__(6659);
|
|||
var GetAll = __webpack_require__(71608);
|
||||
var GetFastValue = __webpack_require__(72632);
|
||||
var GetValue = __webpack_require__(10850);
|
||||
var HasValue = __webpack_require__(19256);
|
||||
var IsPlainObject = __webpack_require__(42911);
|
||||
var Range = __webpack_require__(75757);
|
||||
var Set = __webpack_require__(58403);
|
||||
|
@ -50086,48 +50065,69 @@ var Group = new Class({
|
|||
|
||||
// Post-creation options (applied only to those items created in this call):
|
||||
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
if (HasValue(options, 'setXY'))
|
||||
{
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
}
|
||||
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
if (HasValue(options, 'setRotation'))
|
||||
{
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
}
|
||||
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
if (HasValue(options, 'setScale'))
|
||||
{
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
}
|
||||
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
if (HasValue(options, 'setOrigin'))
|
||||
{
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
}
|
||||
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
if (HasValue(options, 'setAlpha'))
|
||||
{
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
}
|
||||
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
if (HasValue(options, 'setDepth'))
|
||||
{
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
}
|
||||
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
if (HasValue(options, 'setScrollFactor'))
|
||||
{
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
}
|
||||
|
||||
var hitArea = GetFastValue(options, 'hitArea', null);
|
||||
var hitAreaCallback = GetFastValue(options, 'hitAreaCallback', null);
|
||||
|
@ -64749,6 +64749,7 @@ var Line = __webpack_require__(88829);
|
|||
* @extends Phaser.GameObjects.Components.AlphaSingle
|
||||
* @extends Phaser.GameObjects.Components.BlendMode
|
||||
* @extends Phaser.GameObjects.Components.Depth
|
||||
* @extends Phaser.GameObjects.Components.FX
|
||||
* @extends Phaser.GameObjects.Components.GetBounds
|
||||
* @extends Phaser.GameObjects.Components.Mask
|
||||
* @extends Phaser.GameObjects.Components.Origin
|
||||
|
@ -64770,6 +64771,7 @@ var Shape = new Class({
|
|||
Components.BlendMode,
|
||||
Components.Depth,
|
||||
Components.GetBounds,
|
||||
Components.FX,
|
||||
Components.Mask,
|
||||
Components.Origin,
|
||||
Components.Pipeline,
|
||||
|
@ -75745,6 +75747,7 @@ var Video = new Class({
|
|||
*/
|
||||
this._callbacks = {
|
||||
play: this.playHandler.bind(this),
|
||||
load: this.loadHandler.bind(this),
|
||||
error: this.loadErrorHandler.bind(this),
|
||||
end: this.completeHandler.bind(this),
|
||||
time: this.timeUpdateHandler.bind(this),
|
||||
|
@ -76305,6 +76308,7 @@ var Video = new Class({
|
|||
}
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
video.src = url;
|
||||
|
||||
|
@ -76362,6 +76366,7 @@ var Video = new Class({
|
|||
video.setAttribute('preload', 'auto');
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -76439,6 +76444,18 @@ var Video = new Class({
|
|||
this.video.removeEventListener('playing', this._callbacks.play, true);
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically when the video loads.
|
||||
*
|
||||
* @method Phaser.GameObjects.Video#loadHandler
|
||||
* @private
|
||||
* @since 3.60.0
|
||||
*/
|
||||
loadHandler: function ()
|
||||
{
|
||||
this.updateTexture();
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically if the video fails to load.
|
||||
*
|
||||
|
@ -130102,10 +130119,11 @@ var ArcadePhysics = new Class({
|
|||
* @method Phaser.Physics.Arcade.ArcadePhysics#closest
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[]|Phaser.GameObjects.GameObject[])} [targets] - The targets.
|
||||
* @generic {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject} Target
|
||||
* @param {Phaser.Types.Math.Vector2Like} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {Target[]} [targets] - The targets.
|
||||
*
|
||||
* @return {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject)} The target closest to the given source point.
|
||||
* @return {Target|null} The target closest to the given source point.
|
||||
*/
|
||||
closest: function (source, targets)
|
||||
{
|
||||
|
@ -172617,7 +172635,6 @@ var MultiPipeline = new Class({
|
|||
|
||||
var quad = calcMatrix.setQuad(x, y, x + frame.width, y + frame.height, false);
|
||||
|
||||
// var unit = this.renderer.setTextureSource(frame.source);
|
||||
var unit = this.setTexture2D(frame.source.glTexture);
|
||||
|
||||
tint = Utils.getTintAppendFloatAlpha(tint, alpha);
|
||||
|
@ -172976,6 +172993,30 @@ var MultiPipeline = new Class({
|
|||
prev[3] = trY;
|
||||
prev[4] = 1;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys all shader instances, removes all object references and nulls all external references.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#destroy
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#DESTROY
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
*/
|
||||
destroy: function ()
|
||||
{
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -173823,8 +173864,6 @@ var Rectangle = __webpack_require__(74118);
|
|||
var RenderTarget = __webpack_require__(37410);
|
||||
var SingleQuadFS = __webpack_require__(85060);
|
||||
var SingleQuadVS = __webpack_require__(18166);
|
||||
var TransformMatrix = __webpack_require__(69360);
|
||||
var WEBGL_CONST = __webpack_require__(71402);
|
||||
var WebGLPipeline = __webpack_require__(44775);
|
||||
|
||||
/**
|
||||
|
@ -173843,6 +173882,7 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
* Text
|
||||
* TileSprite
|
||||
* RenderTexture
|
||||
* Shape
|
||||
*
|
||||
* // TODO - Explain about the fbos and functions
|
||||
*
|
||||
|
@ -173856,35 +173896,12 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
*/
|
||||
var SpriteFXPipeline = new Class({
|
||||
|
||||
Extends: WebGLPipeline,
|
||||
Extends: MultiPipeline,
|
||||
|
||||
initialize:
|
||||
|
||||
function SpriteFXPipeline (config)
|
||||
{
|
||||
config.attributes = GetFastValue(config, 'attributes', [
|
||||
{
|
||||
name: 'inPosition',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexCoord',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexId'
|
||||
},
|
||||
{
|
||||
name: 'inTintEffect'
|
||||
},
|
||||
{
|
||||
name: 'inTint',
|
||||
size: 4,
|
||||
type: WEBGL_CONST.UNSIGNED_BYTE,
|
||||
normalized: true
|
||||
}
|
||||
]);
|
||||
|
||||
var fragShader = GetFastValue(config, 'fragShader', PostFXFS);
|
||||
var vertShader = GetFastValue(config, 'vertShader', SingleQuadVS);
|
||||
var drawShader = GetFastValue(config, 'drawShader', PostFXFS);
|
||||
|
@ -173918,39 +173935,11 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
config.batchSize = 1;
|
||||
|
||||
WebGLPipeline.call(this, config);
|
||||
MultiPipeline.call(this, config);
|
||||
|
||||
this.isSpriteFX = true;
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix1
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix1 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix2
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix2 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix3
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix3 = new TransformMatrix();
|
||||
this.customMainSampler = null;
|
||||
|
||||
/**
|
||||
* A reference to the Draw Sprite Shader belonging to this Pipeline.
|
||||
|
@ -174135,93 +174124,6 @@ var SpriteFXPipeline = new Class({
|
|||
vertexViewF32[36] = height; // y3
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a Sprite Game Object, or any object that extends it, and renders it via this pipeline.
|
||||
*
|
||||
* this method is a proxy for the MultiPipeline method of the same name. The actual rendering
|
||||
* is redirected through to the `batchQuad` method in this pipeline.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchSprite
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.
|
||||
*/
|
||||
batchSprite: function (gameObject, camera, parentTransformMatrix)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
MultiPipeline.prototype.batchSprite.call(this, gameObject, camera, parentTransformMatrix);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generic function for batching a textured quad using argument values instead of a Game Object.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchTexture
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject.
|
||||
* @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad.
|
||||
* @param {number} textureWidth - Real texture width.
|
||||
* @param {number} textureHeight - Real texture height.
|
||||
* @param {number} srcX - X coordinate of the quad.
|
||||
* @param {number} srcY - Y coordinate of the quad.
|
||||
* @param {number} srcWidth - Width of the quad.
|
||||
* @param {number} srcHeight - Height of the quad.
|
||||
* @param {number} scaleX - X component of scale.
|
||||
* @param {number} scaleY - Y component of scale.
|
||||
* @param {number} rotation - Rotation of the quad.
|
||||
* @param {boolean} flipX - Indicates if the quad is horizontally flipped.
|
||||
* @param {boolean} flipY - Indicates if the quad is vertically flipped.
|
||||
* @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll.
|
||||
* @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll.
|
||||
* @param {number} displayOriginX - Horizontal origin in pixels.
|
||||
* @param {number} displayOriginY - Vertical origin in pixels.
|
||||
* @param {number} frameX - X coordinate of the texture frame.
|
||||
* @param {number} frameY - Y coordinate of the texture frame.
|
||||
* @param {number} frameWidth - Width of the texture frame.
|
||||
* @param {number} frameHeight - Height of the texture frame.
|
||||
* @param {number} tintTL - Tint for top left.
|
||||
* @param {number} tintTR - Tint for top right.
|
||||
* @param {number} tintBL - Tint for bottom left.
|
||||
* @param {number} tintBR - Tint for bottom right.
|
||||
* @param {number} tintEffect - The tint effect.
|
||||
* @param {number} uOffset - Horizontal offset on texture coordinate.
|
||||
* @param {number} vOffset - Vertical offset on texture coordinate.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container.
|
||||
* @param {boolean} [skipFlip=false] - Skip the renderTexture check.
|
||||
* @param {number} [textureUnit] - Use the currently bound texture unit?
|
||||
*/
|
||||
batchTexture: function (
|
||||
gameObject,
|
||||
texture,
|
||||
textureWidth, textureHeight,
|
||||
srcX, srcY,
|
||||
srcWidth, srcHeight,
|
||||
scaleX, scaleY,
|
||||
rotation,
|
||||
flipX, flipY,
|
||||
scrollFactorX, scrollFactorY,
|
||||
displayOriginX, displayOriginY,
|
||||
frameX, frameY, frameWidth, frameHeight,
|
||||
tintTL, tintTR, tintBL, tintBR, tintEffect,
|
||||
uOffset, vOffset,
|
||||
camera,
|
||||
parentTransformMatrix,
|
||||
skipFlip,
|
||||
textureUnit)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
|
||||
// Needed for Text & TileSprite - how about others?
|
||||
// flipY = true;
|
||||
|
||||
MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit);
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds the vertices data into the batch and flushes if full.
|
||||
*
|
||||
|
@ -174275,7 +174177,7 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
var bounds = this.spriteBounds.setTo(bx, by, bw, bh);
|
||||
|
||||
var padding = gameObject.fxPadding;
|
||||
var padding = (gameObject) ? gameObject.fxPadding : 0;
|
||||
var width = bw + (padding * 2);
|
||||
var height = bh + (padding * 2);
|
||||
var maxDimension = Math.abs(Math.max(width, height));
|
||||
|
@ -174300,9 +174202,12 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
this.flipProjectionMatrix(true);
|
||||
|
||||
this.onDrawSprite(gameObject, target);
|
||||
if (gameObject)
|
||||
{
|
||||
this.onDrawSprite(gameObject, target);
|
||||
|
||||
gameObject.onFX(this);
|
||||
gameObject.onFX(this);
|
||||
}
|
||||
|
||||
var fsTarget = this.fsTarget;
|
||||
|
||||
|
@ -174592,8 +174497,14 @@ var SpriteFXPipeline = new Class({
|
|||
gl.viewport(0, 0, renderer.width, renderer.height);
|
||||
}
|
||||
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, source.texture);
|
||||
if (this.customMainSampler)
|
||||
{
|
||||
this.setTexture2D(this.customMainSampler);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setTexture2D(source.texture);
|
||||
}
|
||||
|
||||
var matrix = this._tempMatrix1.loadIdentity();
|
||||
|
||||
|
@ -174633,6 +174544,79 @@ var SpriteFXPipeline = new Class({
|
|||
this.tempSprite = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Uploads the vertex data and emits a draw call for the current batch of vertices.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLPipeline#flush
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not?
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
flush: function (isPostFlush)
|
||||
{
|
||||
if (isPostFlush === undefined) { isPostFlush = false; }
|
||||
|
||||
if (this.vertexCount > 0)
|
||||
{
|
||||
// this.emit(Events.BEFORE_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onBeforeFlush(isPostFlush);
|
||||
|
||||
var gl = this.gl;
|
||||
var vertexCount = this.vertexCount;
|
||||
var vertexSize = this.currentShader.vertexSize;
|
||||
var topology = this.topology;
|
||||
|
||||
if (this.active)
|
||||
{
|
||||
this.setVertexBuffer();
|
||||
|
||||
if (vertexCount === this.vertexCapacity)
|
||||
{
|
||||
gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));
|
||||
}
|
||||
|
||||
var i;
|
||||
var entry;
|
||||
var batch = this.batch;
|
||||
|
||||
for (i = 0; i < batch.length; i++)
|
||||
{
|
||||
entry = batch[i];
|
||||
|
||||
for (var t = 0; t <= entry.maxUnit; t++)
|
||||
{
|
||||
gl.activeTexture(gl.TEXTURE0 + t);
|
||||
gl.bindTexture(gl.TEXTURE_2D, entry.texture[t]);
|
||||
}
|
||||
|
||||
gl.drawArrays(topology, entry.start, entry.count);
|
||||
}
|
||||
}
|
||||
|
||||
this.vertexCount = 0;
|
||||
|
||||
this.batch.length = 0;
|
||||
this.currentBatch = null;
|
||||
this.currentTexture = null;
|
||||
this.currentUnit = 0;
|
||||
|
||||
// this.emit(Events.AFTER_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onAfterFlush(isPostFlush);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method is called every time the `batchSprite` method is called and is passed a
|
||||
* reference to the current render target.
|
||||
|
@ -174747,14 +174731,6 @@ var SpriteFXPipeline = new Class({
|
|||
{
|
||||
this.gl.deleteBuffer(this.quadVertexBuffer);
|
||||
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
this.drawSpriteShader = null;
|
||||
this.copyShader = null;
|
||||
this.gameShader = null;
|
||||
|
@ -174766,7 +174742,9 @@ var SpriteFXPipeline = new Class({
|
|||
this.fsTarget = null;
|
||||
this.tempSprite = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
MultiPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -181344,6 +181322,15 @@ var ScenePlugin = new Class({
|
|||
this.manager.start(key, GetFastValue(config, 'data'));
|
||||
}
|
||||
|
||||
var onStartCallback = GetFastValue(config, 'onStart', null);
|
||||
|
||||
var onStartScope = GetFastValue(config, 'onStartScope', this.scene);
|
||||
|
||||
if (onStartCallback)
|
||||
{
|
||||
onStartCallback.call(onStartScope, this.scene, target, duration);
|
||||
}
|
||||
|
||||
this.systems.events.emit(Events.TRANSITION_OUT, target, duration);
|
||||
|
||||
this.systems.events.on(Events.UPDATE, this.step, this);
|
||||
|
@ -194366,6 +194353,7 @@ var DynamicTexture = new Class({
|
|||
|
||||
renderer.setContext(ctx);
|
||||
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
|
||||
ctx.fillRect(x, y, width, height);
|
||||
|
||||
|
@ -195062,8 +195050,6 @@ var DynamicTexture = new Class({
|
|||
{
|
||||
if (this.renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -195362,8 +195348,6 @@ var DynamicTexture = new Class({
|
|||
|
||||
if (renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -215415,7 +215399,7 @@ var TweenManager = new Class({
|
|||
|
||||
for (var t = 0; t < targetLen; t++)
|
||||
{
|
||||
if (tween.hasTarget(target[t]))
|
||||
if (!tween.isDestroyed() && tween.hasTarget(target[t]))
|
||||
{
|
||||
output.push(tween);
|
||||
}
|
||||
|
@ -218099,7 +218083,7 @@ var BaseTween = new Class({
|
|||
*/
|
||||
stop: function ()
|
||||
{
|
||||
if (!this.isRemoved() && !this.isPendingRemove())
|
||||
if (!this.isRemoved() && !this.isPendingRemove() && !this.isDestroyed())
|
||||
{
|
||||
this.dispatchEvent(Events.TWEEN_STOP, 'onStop');
|
||||
|
||||
|
@ -219290,7 +219274,7 @@ var Tween = new Class({
|
|||
*/
|
||||
hasTarget: function (target)
|
||||
{
|
||||
return (this.targets.indexOf(target) !== -1);
|
||||
return (this.targets && this.targets.indexOf(target) !== -1);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -219647,10 +219631,14 @@ var Tween = new Class({
|
|||
if (this.isLoopDelayed())
|
||||
{
|
||||
this.updateLoopCountdown(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (this.isCompleteDelayed())
|
||||
{
|
||||
this.updateCompleteDelay(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (!this.hasStarted && !this.isSeeking)
|
||||
{
|
||||
|
|
2
dist/phaser-ie9.min.js
vendored
2
dist/phaser-ie9.min.js
vendored
File diff suppressed because one or more lines are too long
442
dist/phaser.js
vendored
442
dist/phaser.js
vendored
|
@ -15404,7 +15404,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.11',
|
||||
VERSION: '3.60.0-beta.12',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -32467,7 +32467,7 @@ var GameObject = new Class({
|
|||
{
|
||||
var displayList = this.displayList || this.scene.sys.displayList;
|
||||
|
||||
if (displayList.exists(this))
|
||||
if (displayList && displayList.exists(this))
|
||||
{
|
||||
displayList.remove(this, true);
|
||||
|
||||
|
@ -33862,6 +33862,7 @@ var GetBitmapTextSize = function (src, round, updateOrigin, out)
|
|||
|
||||
characters.push({
|
||||
i: charIndex,
|
||||
idx: i,
|
||||
char: text[i],
|
||||
code: charCode,
|
||||
x: (glyph.xOffset + x) * scale,
|
||||
|
@ -37560,15 +37561,9 @@ var tempMatrix = new TransformMatrix();
|
|||
var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
||||
{
|
||||
var list = src.getRenderList();
|
||||
|
||||
if (list.length === 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alpha = camera.alpha * src.alpha;
|
||||
|
||||
if (alpha === 0)
|
||||
if (list.length === 0 || alpha === 0)
|
||||
{
|
||||
// Nothing to see, so abort early
|
||||
return;
|
||||
|
@ -37599,9 +37594,9 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
renderer.pipelines.preBatch(src);
|
||||
|
||||
for (var index = 0; index < list.length; index++)
|
||||
for (var i = 0; i < list.length; i++)
|
||||
{
|
||||
var bob = list[index];
|
||||
var bob = list[i];
|
||||
var frame = bob.frame;
|
||||
var bobAlpha = bob.alpha * alpha;
|
||||
|
||||
|
@ -37628,14 +37623,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
y += frame.height;
|
||||
}
|
||||
|
||||
var xw = x + width;
|
||||
var yh = y + height;
|
||||
|
||||
var tx0 = calcMatrix.getX(x, y);
|
||||
var ty0 = calcMatrix.getY(x, y);
|
||||
|
||||
var tx1 = calcMatrix.getX(xw, yh);
|
||||
var ty1 = calcMatrix.getY(xw, yh);
|
||||
var quad = calcMatrix.setQuad(x, y, x + width, y + height, roundPixels);
|
||||
|
||||
var tint = Utils.getTintAppendFloatAlpha(bob.tint, bobAlpha);
|
||||
|
||||
|
@ -37647,17 +37635,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
prevTextureSourceIndex = frame.sourceIndex;
|
||||
}
|
||||
|
||||
if (roundPixels)
|
||||
{
|
||||
tx0 = Math.round(tx0);
|
||||
ty0 = Math.round(ty0);
|
||||
|
||||
tx1 = Math.round(tx1);
|
||||
ty1 = Math.round(ty1);
|
||||
}
|
||||
|
||||
// TL x/y, BL x/y, BR x/y, TR x/y
|
||||
if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
if (pipeline.batchQuad(src, quad[0], quad[1], quad[2], quad[3], quad[4], quad[5], quad[6], quad[7], frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit))
|
||||
{
|
||||
prevTextureSourceIndex = -1;
|
||||
}
|
||||
|
@ -49654,6 +49632,7 @@ var EventEmitter = __webpack_require__(6659);
|
|||
var GetAll = __webpack_require__(71608);
|
||||
var GetFastValue = __webpack_require__(72632);
|
||||
var GetValue = __webpack_require__(10850);
|
||||
var HasValue = __webpack_require__(19256);
|
||||
var IsPlainObject = __webpack_require__(42911);
|
||||
var Range = __webpack_require__(75757);
|
||||
var Set = __webpack_require__(58403);
|
||||
|
@ -50086,48 +50065,69 @@ var Group = new Class({
|
|||
|
||||
// Post-creation options (applied only to those items created in this call):
|
||||
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
if (HasValue(options, 'setXY'))
|
||||
{
|
||||
var x = GetValue(options, 'setXY.x', 0);
|
||||
var y = GetValue(options, 'setXY.y', 0);
|
||||
var stepX = GetValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetValue(options, 'setXY.stepY', 0);
|
||||
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
}
|
||||
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
if (HasValue(options, 'setRotation'))
|
||||
{
|
||||
var rotation = GetValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetValue(options, 'setRotation.step', 0);
|
||||
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
}
|
||||
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
if (HasValue(options, 'setScale'))
|
||||
{
|
||||
var scaleX = GetValue(options, 'setScale.x', 1);
|
||||
var scaleY = GetValue(options, 'setScale.y', scaleX);
|
||||
var stepScaleX = GetValue(options, 'setScale.stepX', 0);
|
||||
var stepScaleY = GetValue(options, 'setScale.stepY', 0);
|
||||
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY);
|
||||
}
|
||||
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
if (HasValue(options, 'setOrigin'))
|
||||
{
|
||||
var originX = GetValue(options, 'setOrigin.x', 0.5);
|
||||
var originY = GetValue(options, 'setOrigin.y', originX);
|
||||
var stepOriginX = GetValue(options, 'setOrigin.stepX', 0);
|
||||
var stepOriginY = GetValue(options, 'setOrigin.stepY', 0);
|
||||
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
Actions.SetOrigin(entries, originX, originY, stepOriginX, stepOriginY);
|
||||
}
|
||||
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
if (HasValue(options, 'setAlpha'))
|
||||
{
|
||||
var alpha = GetValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetValue(options, 'setAlpha.step', 0);
|
||||
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
}
|
||||
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
if (HasValue(options, 'setDepth'))
|
||||
{
|
||||
var depth = GetValue(options, 'setDepth.value', 0);
|
||||
var stepDepth = GetValue(options, 'setDepth.step', 0);
|
||||
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
Actions.SetDepth(entries, depth, stepDepth);
|
||||
}
|
||||
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
if (HasValue(options, 'setScrollFactor'))
|
||||
{
|
||||
var scrollFactorX = GetValue(options, 'setScrollFactor.x', 1);
|
||||
var scrollFactorY = GetValue(options, 'setScrollFactor.y', scrollFactorX);
|
||||
var stepScrollFactorX = GetValue(options, 'setScrollFactor.stepX', 0);
|
||||
var stepScrollFactorY = GetValue(options, 'setScrollFactor.stepY', 0);
|
||||
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
Actions.SetScrollFactor(entries, scrollFactorX, scrollFactorY, stepScrollFactorX, stepScrollFactorY);
|
||||
}
|
||||
|
||||
var hitArea = GetFastValue(options, 'hitArea', null);
|
||||
var hitAreaCallback = GetFastValue(options, 'hitAreaCallback', null);
|
||||
|
@ -64749,6 +64749,7 @@ var Line = __webpack_require__(88829);
|
|||
* @extends Phaser.GameObjects.Components.AlphaSingle
|
||||
* @extends Phaser.GameObjects.Components.BlendMode
|
||||
* @extends Phaser.GameObjects.Components.Depth
|
||||
* @extends Phaser.GameObjects.Components.FX
|
||||
* @extends Phaser.GameObjects.Components.GetBounds
|
||||
* @extends Phaser.GameObjects.Components.Mask
|
||||
* @extends Phaser.GameObjects.Components.Origin
|
||||
|
@ -64770,6 +64771,7 @@ var Shape = new Class({
|
|||
Components.BlendMode,
|
||||
Components.Depth,
|
||||
Components.GetBounds,
|
||||
Components.FX,
|
||||
Components.Mask,
|
||||
Components.Origin,
|
||||
Components.Pipeline,
|
||||
|
@ -75745,6 +75747,7 @@ var Video = new Class({
|
|||
*/
|
||||
this._callbacks = {
|
||||
play: this.playHandler.bind(this),
|
||||
load: this.loadHandler.bind(this),
|
||||
error: this.loadErrorHandler.bind(this),
|
||||
end: this.completeHandler.bind(this),
|
||||
time: this.timeUpdateHandler.bind(this),
|
||||
|
@ -76305,6 +76308,7 @@ var Video = new Class({
|
|||
}
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
video.src = url;
|
||||
|
||||
|
@ -76362,6 +76366,7 @@ var Video = new Class({
|
|||
video.setAttribute('preload', 'auto');
|
||||
|
||||
video.addEventListener('error', this._callbacks.error, true);
|
||||
video.addEventListener(loadEvent, this._callbacks.load, true);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -76439,6 +76444,18 @@ var Video = new Class({
|
|||
this.video.removeEventListener('playing', this._callbacks.play, true);
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically when the video loads.
|
||||
*
|
||||
* @method Phaser.GameObjects.Video#loadHandler
|
||||
* @private
|
||||
* @since 3.60.0
|
||||
*/
|
||||
loadHandler: function ()
|
||||
{
|
||||
this.updateTexture();
|
||||
},
|
||||
|
||||
/**
|
||||
* This internal method is called automatically if the video fails to load.
|
||||
*
|
||||
|
@ -130100,10 +130117,11 @@ var ArcadePhysics = new Class({
|
|||
* @method Phaser.Physics.Arcade.ArcadePhysics#closest
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[]|Phaser.GameObjects.GameObject[])} [targets] - The targets.
|
||||
* @generic {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject} Target
|
||||
* @param {Phaser.Types.Math.Vector2Like} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
|
||||
* @param {Target[]} [targets] - The targets.
|
||||
*
|
||||
* @return {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject)} The target closest to the given source point.
|
||||
* @return {Target|null} The target closest to the given source point.
|
||||
*/
|
||||
closest: function (source, targets)
|
||||
{
|
||||
|
@ -172173,7 +172191,6 @@ var MultiPipeline = new Class({
|
|||
|
||||
var quad = calcMatrix.setQuad(x, y, x + frame.width, y + frame.height, false);
|
||||
|
||||
// var unit = this.renderer.setTextureSource(frame.source);
|
||||
var unit = this.setTexture2D(frame.source.glTexture);
|
||||
|
||||
tint = Utils.getTintAppendFloatAlpha(tint, alpha);
|
||||
|
@ -172532,6 +172549,30 @@ var MultiPipeline = new Class({
|
|||
prev[3] = trY;
|
||||
prev[4] = 1;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys all shader instances, removes all object references and nulls all external references.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#destroy
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#DESTROY
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
*/
|
||||
destroy: function ()
|
||||
{
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -173379,8 +173420,6 @@ var Rectangle = __webpack_require__(74118);
|
|||
var RenderTarget = __webpack_require__(37410);
|
||||
var SingleQuadFS = __webpack_require__(85060);
|
||||
var SingleQuadVS = __webpack_require__(18166);
|
||||
var TransformMatrix = __webpack_require__(69360);
|
||||
var WEBGL_CONST = __webpack_require__(71402);
|
||||
var WebGLPipeline = __webpack_require__(44775);
|
||||
|
||||
/**
|
||||
|
@ -173399,6 +173438,7 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
* Text
|
||||
* TileSprite
|
||||
* RenderTexture
|
||||
* Shape
|
||||
*
|
||||
* // TODO - Explain about the fbos and functions
|
||||
*
|
||||
|
@ -173412,35 +173452,12 @@ var WebGLPipeline = __webpack_require__(44775);
|
|||
*/
|
||||
var SpriteFXPipeline = new Class({
|
||||
|
||||
Extends: WebGLPipeline,
|
||||
Extends: MultiPipeline,
|
||||
|
||||
initialize:
|
||||
|
||||
function SpriteFXPipeline (config)
|
||||
{
|
||||
config.attributes = GetFastValue(config, 'attributes', [
|
||||
{
|
||||
name: 'inPosition',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexCoord',
|
||||
size: 2
|
||||
},
|
||||
{
|
||||
name: 'inTexId'
|
||||
},
|
||||
{
|
||||
name: 'inTintEffect'
|
||||
},
|
||||
{
|
||||
name: 'inTint',
|
||||
size: 4,
|
||||
type: WEBGL_CONST.UNSIGNED_BYTE,
|
||||
normalized: true
|
||||
}
|
||||
]);
|
||||
|
||||
var fragShader = GetFastValue(config, 'fragShader', PostFXFS);
|
||||
var vertShader = GetFastValue(config, 'vertShader', SingleQuadVS);
|
||||
var drawShader = GetFastValue(config, 'drawShader', PostFXFS);
|
||||
|
@ -173474,39 +173491,11 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
config.batchSize = 1;
|
||||
|
||||
WebGLPipeline.call(this, config);
|
||||
MultiPipeline.call(this, config);
|
||||
|
||||
this.isSpriteFX = true;
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix1
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix1 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix2
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix2 = new TransformMatrix();
|
||||
|
||||
/**
|
||||
* A temporary Transform Matrix, re-used internally during batching.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#_tempMatrix3
|
||||
* @private
|
||||
* @type {Phaser.GameObjects.Components.TransformMatrix}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this._tempMatrix3 = new TransformMatrix();
|
||||
this.customMainSampler = null;
|
||||
|
||||
/**
|
||||
* A reference to the Draw Sprite Shader belonging to this Pipeline.
|
||||
|
@ -173691,93 +173680,6 @@ var SpriteFXPipeline = new Class({
|
|||
vertexViewF32[36] = height; // y3
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a Sprite Game Object, or any object that extends it, and renders it via this pipeline.
|
||||
*
|
||||
* this method is a proxy for the MultiPipeline method of the same name. The actual rendering
|
||||
* is redirected through to the `batchQuad` method in this pipeline.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchSprite
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set.
|
||||
*/
|
||||
batchSprite: function (gameObject, camera, parentTransformMatrix)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
MultiPipeline.prototype.batchSprite.call(this, gameObject, camera, parentTransformMatrix);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generic function for batching a textured quad using argument values instead of a Game Object.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.SpriteFXPipeline#batchTexture
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject.
|
||||
* @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad.
|
||||
* @param {number} textureWidth - Real texture width.
|
||||
* @param {number} textureHeight - Real texture height.
|
||||
* @param {number} srcX - X coordinate of the quad.
|
||||
* @param {number} srcY - Y coordinate of the quad.
|
||||
* @param {number} srcWidth - Width of the quad.
|
||||
* @param {number} srcHeight - Height of the quad.
|
||||
* @param {number} scaleX - X component of scale.
|
||||
* @param {number} scaleY - Y component of scale.
|
||||
* @param {number} rotation - Rotation of the quad.
|
||||
* @param {boolean} flipX - Indicates if the quad is horizontally flipped.
|
||||
* @param {boolean} flipY - Indicates if the quad is vertically flipped.
|
||||
* @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll.
|
||||
* @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll.
|
||||
* @param {number} displayOriginX - Horizontal origin in pixels.
|
||||
* @param {number} displayOriginY - Vertical origin in pixels.
|
||||
* @param {number} frameX - X coordinate of the texture frame.
|
||||
* @param {number} frameY - Y coordinate of the texture frame.
|
||||
* @param {number} frameWidth - Width of the texture frame.
|
||||
* @param {number} frameHeight - Height of the texture frame.
|
||||
* @param {number} tintTL - Tint for top left.
|
||||
* @param {number} tintTR - Tint for top right.
|
||||
* @param {number} tintBL - Tint for bottom left.
|
||||
* @param {number} tintBR - Tint for bottom right.
|
||||
* @param {number} tintEffect - The tint effect.
|
||||
* @param {number} uOffset - Horizontal offset on texture coordinate.
|
||||
* @param {number} vOffset - Vertical offset on texture coordinate.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera.
|
||||
* @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container.
|
||||
* @param {boolean} [skipFlip=false] - Skip the renderTexture check.
|
||||
* @param {number} [textureUnit] - Use the currently bound texture unit?
|
||||
*/
|
||||
batchTexture: function (
|
||||
gameObject,
|
||||
texture,
|
||||
textureWidth, textureHeight,
|
||||
srcX, srcY,
|
||||
srcWidth, srcHeight,
|
||||
scaleX, scaleY,
|
||||
rotation,
|
||||
flipX, flipY,
|
||||
scrollFactorX, scrollFactorY,
|
||||
displayOriginX, displayOriginY,
|
||||
frameX, frameY, frameWidth, frameHeight,
|
||||
tintTL, tintTR, tintBL, tintBR, tintEffect,
|
||||
uOffset, vOffset,
|
||||
camera,
|
||||
parentTransformMatrix,
|
||||
skipFlip,
|
||||
textureUnit)
|
||||
{
|
||||
// Proxy this call to the MultiPipeline
|
||||
// batchQuad will intercept the rendering
|
||||
|
||||
// Needed for Text & TileSprite - how about others?
|
||||
// flipY = true;
|
||||
|
||||
MultiPipeline.prototype.batchTexture.call(this, gameObject, texture, textureWidth, textureHeight, srcX, srcY, srcWidth, srcHeight, scaleX, scaleY, rotation, flipX, flipY, scrollFactorX, scrollFactorY, displayOriginX, displayOriginY, frameX, frameY, frameWidth, frameHeight, tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, parentTransformMatrix, skipFlip, textureUnit);
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds the vertices data into the batch and flushes if full.
|
||||
*
|
||||
|
@ -173831,7 +173733,7 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
var bounds = this.spriteBounds.setTo(bx, by, bw, bh);
|
||||
|
||||
var padding = gameObject.fxPadding;
|
||||
var padding = (gameObject) ? gameObject.fxPadding : 0;
|
||||
var width = bw + (padding * 2);
|
||||
var height = bh + (padding * 2);
|
||||
var maxDimension = Math.abs(Math.max(width, height));
|
||||
|
@ -173856,9 +173758,12 @@ var SpriteFXPipeline = new Class({
|
|||
|
||||
this.flipProjectionMatrix(true);
|
||||
|
||||
this.onDrawSprite(gameObject, target);
|
||||
if (gameObject)
|
||||
{
|
||||
this.onDrawSprite(gameObject, target);
|
||||
|
||||
gameObject.onFX(this);
|
||||
gameObject.onFX(this);
|
||||
}
|
||||
|
||||
var fsTarget = this.fsTarget;
|
||||
|
||||
|
@ -174148,8 +174053,14 @@ var SpriteFXPipeline = new Class({
|
|||
gl.viewport(0, 0, renderer.width, renderer.height);
|
||||
}
|
||||
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, source.texture);
|
||||
if (this.customMainSampler)
|
||||
{
|
||||
this.setTexture2D(this.customMainSampler);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setTexture2D(source.texture);
|
||||
}
|
||||
|
||||
var matrix = this._tempMatrix1.loadIdentity();
|
||||
|
||||
|
@ -174189,6 +174100,79 @@ var SpriteFXPipeline = new Class({
|
|||
this.tempSprite = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Uploads the vertex data and emits a draw call for the current batch of vertices.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLPipeline#flush
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH
|
||||
* @fires Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not?
|
||||
*
|
||||
* @return {this} This WebGLPipeline instance.
|
||||
flush: function (isPostFlush)
|
||||
{
|
||||
if (isPostFlush === undefined) { isPostFlush = false; }
|
||||
|
||||
if (this.vertexCount > 0)
|
||||
{
|
||||
// this.emit(Events.BEFORE_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onBeforeFlush(isPostFlush);
|
||||
|
||||
var gl = this.gl;
|
||||
var vertexCount = this.vertexCount;
|
||||
var vertexSize = this.currentShader.vertexSize;
|
||||
var topology = this.topology;
|
||||
|
||||
if (this.active)
|
||||
{
|
||||
this.setVertexBuffer();
|
||||
|
||||
if (vertexCount === this.vertexCapacity)
|
||||
{
|
||||
gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize));
|
||||
}
|
||||
|
||||
var i;
|
||||
var entry;
|
||||
var batch = this.batch;
|
||||
|
||||
for (i = 0; i < batch.length; i++)
|
||||
{
|
||||
entry = batch[i];
|
||||
|
||||
for (var t = 0; t <= entry.maxUnit; t++)
|
||||
{
|
||||
gl.activeTexture(gl.TEXTURE0 + t);
|
||||
gl.bindTexture(gl.TEXTURE_2D, entry.texture[t]);
|
||||
}
|
||||
|
||||
gl.drawArrays(topology, entry.start, entry.count);
|
||||
}
|
||||
}
|
||||
|
||||
this.vertexCount = 0;
|
||||
|
||||
this.batch.length = 0;
|
||||
this.currentBatch = null;
|
||||
this.currentTexture = null;
|
||||
this.currentUnit = 0;
|
||||
|
||||
// this.emit(Events.AFTER_FLUSH, this, isPostFlush);
|
||||
|
||||
this.onAfterFlush(isPostFlush);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
*/
|
||||
|
||||
/**
|
||||
* This method is called every time the `batchSprite` method is called and is passed a
|
||||
* reference to the current render target.
|
||||
|
@ -174303,14 +174287,6 @@ var SpriteFXPipeline = new Class({
|
|||
{
|
||||
this.gl.deleteBuffer(this.quadVertexBuffer);
|
||||
|
||||
this._tempMatrix1.destroy();
|
||||
this._tempMatrix2.destroy();
|
||||
this._tempMatrix3.destroy();
|
||||
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
this._tempMatrix1 = null;
|
||||
|
||||
this.drawSpriteShader = null;
|
||||
this.copyShader = null;
|
||||
this.gameShader = null;
|
||||
|
@ -174322,7 +174298,9 @@ var SpriteFXPipeline = new Class({
|
|||
this.fsTarget = null;
|
||||
this.tempSprite = null;
|
||||
|
||||
WebGLPipeline.prototype.destroy.call(this);
|
||||
MultiPipeline.prototype.destroy.call(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -180900,6 +180878,15 @@ var ScenePlugin = new Class({
|
|||
this.manager.start(key, GetFastValue(config, 'data'));
|
||||
}
|
||||
|
||||
var onStartCallback = GetFastValue(config, 'onStart', null);
|
||||
|
||||
var onStartScope = GetFastValue(config, 'onStartScope', this.scene);
|
||||
|
||||
if (onStartCallback)
|
||||
{
|
||||
onStartCallback.call(onStartScope, this.scene, target, duration);
|
||||
}
|
||||
|
||||
this.systems.events.emit(Events.TRANSITION_OUT, target, duration);
|
||||
|
||||
this.systems.events.on(Events.UPDATE, this.step, this);
|
||||
|
@ -193922,6 +193909,7 @@ var DynamicTexture = new Class({
|
|||
|
||||
renderer.setContext(ctx);
|
||||
|
||||
ctx.globalCompositeOperation = 'source-over';
|
||||
ctx.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
|
||||
ctx.fillRect(x, y, width, height);
|
||||
|
||||
|
@ -194618,8 +194606,6 @@ var DynamicTexture = new Class({
|
|||
{
|
||||
if (this.renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -194918,8 +194904,6 @@ var DynamicTexture = new Class({
|
|||
|
||||
if (renderTarget)
|
||||
{
|
||||
tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16);
|
||||
|
||||
this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, matrix, null);
|
||||
}
|
||||
else
|
||||
|
@ -214971,7 +214955,7 @@ var TweenManager = new Class({
|
|||
|
||||
for (var t = 0; t < targetLen; t++)
|
||||
{
|
||||
if (tween.hasTarget(target[t]))
|
||||
if (!tween.isDestroyed() && tween.hasTarget(target[t]))
|
||||
{
|
||||
output.push(tween);
|
||||
}
|
||||
|
@ -217655,7 +217639,7 @@ var BaseTween = new Class({
|
|||
*/
|
||||
stop: function ()
|
||||
{
|
||||
if (!this.isRemoved() && !this.isPendingRemove())
|
||||
if (!this.isRemoved() && !this.isPendingRemove() && !this.isDestroyed())
|
||||
{
|
||||
this.dispatchEvent(Events.TWEEN_STOP, 'onStop');
|
||||
|
||||
|
@ -218846,7 +218830,7 @@ var Tween = new Class({
|
|||
*/
|
||||
hasTarget: function (target)
|
||||
{
|
||||
return (this.targets.indexOf(target) !== -1);
|
||||
return (this.targets && this.targets.indexOf(target) !== -1);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -219203,10 +219187,14 @@ var Tween = new Class({
|
|||
if (this.isLoopDelayed())
|
||||
{
|
||||
this.updateLoopCountdown(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (this.isCompleteDelayed())
|
||||
{
|
||||
this.updateCompleteDelay(delta);
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (!this.hasStarted && !this.isSeeking)
|
||||
{
|
||||
|
|
2
dist/phaser.min.js
vendored
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
27548
types/phaser.d.ts
vendored
27548
types/phaser.d.ts
vendored
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue