mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Phaser 3.60 Beta 13
This commit is contained in:
parent
e868c5b284
commit
23315044f7
7 changed files with 503 additions and 212 deletions
223
dist/phaser-arcade-physics.js
vendored
223
dist/phaser-arcade-physics.js
vendored
|
@ -619,7 +619,7 @@ var GetFastValue = __webpack_require__(72632);
|
|||
var NOOP = __webpack_require__(72283);
|
||||
var Zone = __webpack_require__(71030);
|
||||
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1).setOrigin(0, 0);
|
||||
|
||||
/**
|
||||
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
|
||||
|
@ -909,7 +909,7 @@ module.exports = IncY;
|
|||
|
||||
/**
|
||||
* Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle.
|
||||
*
|
||||
*
|
||||
* If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property.
|
||||
*
|
||||
* @function Phaser.Actions.PlaceOnCircle
|
||||
|
@ -932,10 +932,14 @@ var PlaceOnCircle = function (items, circle, startAngle, endAngle)
|
|||
var angle = startAngle;
|
||||
var angleStep = (endAngle - startAngle) / items.length;
|
||||
|
||||
var cx = circle.x;
|
||||
var cy = circle.y;
|
||||
var radius = circle.radius;
|
||||
|
||||
for (var i = 0; i < items.length; i++)
|
||||
{
|
||||
items[i].x = circle.x + (circle.radius * Math.cos(angle));
|
||||
items[i].y = circle.y + (circle.radius * Math.sin(angle));
|
||||
items[i].x = cx + (radius * Math.cos(angle));
|
||||
items[i].y = cy + (radius * Math.sin(angle));
|
||||
|
||||
angle += angleStep;
|
||||
}
|
||||
|
@ -15404,7 +15408,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.12',
|
||||
VERSION: '3.60.0-beta.13',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -40203,7 +40207,7 @@ var PathFollower = {
|
|||
tweenData.elapsed = tweenData.duration * seek;
|
||||
var v = tweenData.ease(tweenData.progress);
|
||||
tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);
|
||||
tweenData.target[tweenData.key] = tweenData.current;
|
||||
tweenData.setTargetValue();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60895,7 +60899,6 @@ var RenderTexture = new Class({
|
|||
|
||||
this.type = 'RenderTexture';
|
||||
|
||||
|
||||
/**
|
||||
* An internal Camera that can be used to move around this Render Texture.
|
||||
*
|
||||
|
@ -60949,6 +60952,41 @@ var RenderTexture = new Class({
|
|||
|
||||
this.texture.setSize(width, height);
|
||||
|
||||
this.updateDisplayOrigin();
|
||||
|
||||
var input = this.input;
|
||||
|
||||
if (input && !input.customHitArea)
|
||||
{
|
||||
input.hitArea.width = width;
|
||||
input.hitArea.height = height;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Resizes the Render Texture to the new dimensions given.
|
||||
*
|
||||
* In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture.
|
||||
* In Canvas it will resize the underlying canvas element.
|
||||
*
|
||||
* Both approaches will erase everything currently drawn to the Render Texture.
|
||||
*
|
||||
* If the dimensions given are the same as those already being used, calling this method will do nothing.
|
||||
*
|
||||
* @method Phaser.GameObjects.RenderTexture#resize
|
||||
* @since 3.10.0
|
||||
*
|
||||
* @param {number} width - The new width of the Render Texture.
|
||||
* @param {number} [height=width] - The new height of the Render Texture. If not specified, will be set the same as the `width`.
|
||||
*
|
||||
* @return {this} This Render Texture.
|
||||
*/
|
||||
resize: function (width, height)
|
||||
{
|
||||
this.setSize(width, height);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -60993,7 +61031,7 @@ var RenderTexture = new Class({
|
|||
|
||||
texture.key = key;
|
||||
|
||||
if (this.textureManager.addDynamicTexture(texture))
|
||||
if (texture.manager.addDynamicTexture(texture))
|
||||
{
|
||||
this._saved = true;
|
||||
}
|
||||
|
@ -63119,6 +63157,8 @@ var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
pipeline.vertexCount += vertexCount;
|
||||
|
||||
pipeline.currentBatch.count = (pipeline.vertexCount - pipeline.currentBatch.start);
|
||||
|
||||
renderer.pipelines.postBatch(src);
|
||||
};
|
||||
|
||||
|
@ -81146,7 +81186,7 @@ module.exports = LineToCircle;
|
|||
/***/ }),
|
||||
|
||||
/***/ 25227:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module) => {
|
||||
|
||||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
|
@ -81154,8 +81194,6 @@ module.exports = LineToCircle;
|
|||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||
*/
|
||||
|
||||
var Point = __webpack_require__(79967);
|
||||
|
||||
// This is based off an explanation and expanded math presented by Paul Bourke:
|
||||
// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
|
||||
|
||||
|
@ -81167,13 +81205,12 @@ var Point = __webpack_require__(79967);
|
|||
*
|
||||
* @param {Phaser.Geom.Line} line1 - The first Line to check.
|
||||
* @param {Phaser.Geom.Line} line2 - The second Line to check.
|
||||
* @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.
|
||||
* @param {Phaser.Types.Math.Vector2Like} [out] - An optional point-like object in which to store the coordinates of intersection, if needed.
|
||||
*
|
||||
* @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.
|
||||
*/
|
||||
var LineToLine = function (line1, line2, out)
|
||||
{
|
||||
if (out === undefined) { out = new Point(); }
|
||||
|
||||
var x1 = line1.x1;
|
||||
var y1 = line1.y1;
|
||||
|
@ -81208,8 +81245,11 @@ var LineToLine = function (line1, line2, out)
|
|||
|
||||
if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
if (out)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -93949,6 +93989,8 @@ var InputPlugin = new Class({
|
|||
// If GameObject.input already cleared from higher class
|
||||
if (input)
|
||||
{
|
||||
this.removeDebug(gameObject);
|
||||
|
||||
input.gameObject = undefined;
|
||||
input.target = undefined;
|
||||
input.hitArea = undefined;
|
||||
|
@ -132028,7 +132070,12 @@ var Body = new Class({
|
|||
}
|
||||
|
||||
this.updateCenter();
|
||||
this.checkWorldBounds();
|
||||
|
||||
if (this.collideWorldBounds)
|
||||
{
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
this.resetFlags(true);
|
||||
},
|
||||
|
||||
|
@ -132392,16 +132439,6 @@ var Body = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
setValue: function (vec2, x, y)
|
||||
{
|
||||
if (x === undefined) { x = vec2.x; }
|
||||
if (y === undefined) { y = vec2.y; }
|
||||
|
||||
vec2.set(x, y);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the Body's velocity.
|
||||
*
|
||||
|
@ -153157,6 +153194,9 @@ var BitmapMaskPipeline = new Class({
|
|||
{
|
||||
this.set2f('uResolution', this.width, this.height);
|
||||
}
|
||||
|
||||
// Clear gl.TEXTURE1
|
||||
gl.bindTexture(gl.TEXTURE_2D, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158636,12 +158676,12 @@ var ScaleManager = new Class({
|
|||
/**
|
||||
* Internal object containing our defined event listeners.
|
||||
*
|
||||
* @name Phaser.Scale.ScaleManager#listeners
|
||||
* @name Phaser.Scale.ScaleManager#domlisteners
|
||||
* @type {object}
|
||||
* @private
|
||||
* @since 3.16.0
|
||||
*/
|
||||
this.listeners = {
|
||||
this.domlisteners = {
|
||||
|
||||
orientationChange: NOOP,
|
||||
windowResize: NOOP,
|
||||
|
@ -159657,7 +159697,7 @@ var ScaleManager = new Class({
|
|||
startListeners: function ()
|
||||
{
|
||||
var _this = this;
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
listeners.orientationChange = function ()
|
||||
{
|
||||
|
@ -159842,7 +159882,7 @@ var ScaleManager = new Class({
|
|||
*/
|
||||
stopListeners: function ()
|
||||
{
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
window.removeEventListener('orientationchange', listeners.orientationChange, false);
|
||||
window.removeEventListener('resize', listeners.windowResize, false);
|
||||
|
@ -174009,8 +174049,13 @@ var Set = new Class({
|
|||
|
||||
/**
|
||||
* Passes each value in this Set to the given callback.
|
||||
*
|
||||
* For when you absolutely know this Set won't be modified during the iteration.
|
||||
*
|
||||
* The callback must return a boolean. If it returns `false` then it will abort
|
||||
* the Set iteration immediately. If it returns `true`, it will carry on
|
||||
* iterating the next child in the Set.
|
||||
*
|
||||
* @method Phaser.Structs.Set#iterate
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -175216,7 +175261,7 @@ var CanvasTexture = new Class({
|
|||
* @type {CanvasRenderingContext2D}
|
||||
* @since 3.7.0
|
||||
*/
|
||||
this.context = this.canvas.getContext('2d');
|
||||
this.context = this.canvas.getContext('2d', { willReadFrequently: true });
|
||||
|
||||
/**
|
||||
* The width of the Canvas.
|
||||
|
@ -180493,38 +180538,44 @@ var TextureSource = new Class({
|
|||
|
||||
if (renderer)
|
||||
{
|
||||
var source = this.source;
|
||||
|
||||
if (renderer.gl)
|
||||
{
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var width = this.width;
|
||||
var height = this.height;
|
||||
var scaleMode = this.scaleMode;
|
||||
|
||||
if (this.isCanvas)
|
||||
{
|
||||
this.glTexture = renderer.createCanvasTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createCanvasTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isVideo)
|
||||
{
|
||||
this.glTexture = renderer.createVideoTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createVideoTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
// this.image = this.source.canvas;
|
||||
|
||||
this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(null, width, height, scaleMode);
|
||||
}
|
||||
else if (this.isGLTexture)
|
||||
{
|
||||
this.glTexture = this.source;
|
||||
this.glTexture = source;
|
||||
}
|
||||
else if (this.compressionAlgorithm)
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.source);
|
||||
this.glTexture = renderer.createTextureFromSource(source);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(image, width, height, scaleMode);
|
||||
}
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
this.image = this.source.canvas;
|
||||
this.image = source.canvas;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180582,15 +180633,18 @@ var TextureSource = new Class({
|
|||
*/
|
||||
update: function ()
|
||||
{
|
||||
var gl = this.renderer.gl;
|
||||
var renderer = this.renderer;
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var gl = renderer.gl;
|
||||
|
||||
if (gl && this.isCanvas)
|
||||
{
|
||||
this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateCanvasTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
else if (gl && this.isVideo)
|
||||
{
|
||||
this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateVideoTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -196357,13 +196411,13 @@ var TweenManager = new Class({
|
|||
this.scene = scene;
|
||||
|
||||
/**
|
||||
* The Systems object of the Scene which owns this Tween Manager.
|
||||
* The Scene Systems Event Emitter.
|
||||
*
|
||||
* @name Phaser.Tweens.TweenManager#systems
|
||||
* @type {Phaser.Scenes.Systems}
|
||||
* @since 3.0.0
|
||||
* @name Phaser.Tweens.TweenManager#events
|
||||
* @type {Phaser.Events.EventEmitter}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this.systems = scene.sys;
|
||||
this.events = scene.sys.events;
|
||||
|
||||
/**
|
||||
* The time scale of the Tween Manager.
|
||||
|
@ -196484,8 +196538,8 @@ var TweenManager = new Class({
|
|||
*/
|
||||
this.gap = 1000 / 240;
|
||||
|
||||
scene.sys.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
scene.sys.events.on(SceneEvents.START, this.start, this);
|
||||
this.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
this.events.on(SceneEvents.START, this.start, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -196498,7 +196552,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
boot: function ()
|
||||
{
|
||||
this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
this.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -196512,17 +196566,15 @@ var TweenManager = new Class({
|
|||
*/
|
||||
start: function ()
|
||||
{
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.on(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
|
||||
this.timeScale = 1;
|
||||
this.paused = false;
|
||||
|
||||
this.startTime = Date.now();
|
||||
this.prevTime = this.startTime;
|
||||
this.nextTime = this.gap;
|
||||
|
||||
this.events.on(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -196973,8 +197025,9 @@ var TweenManager = new Class({
|
|||
|
||||
var delta = this.getDelta(tick);
|
||||
|
||||
if (delta === 0)
|
||||
if (delta <= 0)
|
||||
{
|
||||
// If we've got a negative delta, skip this step
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197171,7 +197224,14 @@ var TweenManager = new Class({
|
|||
var output = [];
|
||||
var list = this.tweens;
|
||||
|
||||
target = Flatten(target);
|
||||
if (!Array.isArray(target))
|
||||
{
|
||||
target = [ target ];
|
||||
}
|
||||
else
|
||||
{
|
||||
target = Flatten(target);
|
||||
}
|
||||
|
||||
var targetLen = target.length;
|
||||
|
||||
|
@ -197270,7 +197330,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
killAll: function ()
|
||||
{
|
||||
var tweens = (this.processing) ? this.getAllTweens() : this.tweens;
|
||||
var tweens = (this.processing) ? this.getTweens() : this.tweens;
|
||||
|
||||
for (var i = 0; i < tweens.length; i++)
|
||||
{
|
||||
|
@ -197372,10 +197432,8 @@ var TweenManager = new Class({
|
|||
|
||||
this.tweens = [];
|
||||
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.off(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
this.events.off(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -197389,10 +197447,10 @@ var TweenManager = new Class({
|
|||
{
|
||||
this.shutdown();
|
||||
|
||||
this.scene.sys.events.off(SceneEvents.START, this.start, this);
|
||||
this.events.off(SceneEvents.START, this.start, this);
|
||||
|
||||
this.scene = null;
|
||||
this.systems = null;
|
||||
this.events = null;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -199323,6 +199381,7 @@ var Tweens = {
|
|||
TweenManager: __webpack_require__(64532),
|
||||
Tween: __webpack_require__(39366),
|
||||
TweenData: __webpack_require__(15718),
|
||||
TweenFrameData: __webpack_require__(96490),
|
||||
|
||||
BaseTween: __webpack_require__(502),
|
||||
TweenChain: __webpack_require__(45641)
|
||||
|
@ -200472,6 +200531,34 @@ var BaseTweenData = new Class({
|
|||
this.isCountdown = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the target object belonging to this TweenData.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#getTarget
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {object} The target object. Can be any JavaScript object, but is typically a Game Object.
|
||||
*/
|
||||
getTarget: function ()
|
||||
{
|
||||
return this.tween.targets[this.targetIndex];
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData's target object property to be the given value.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#setTargetValue
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {number} [value] - The value to set on the target. If not given, sets it to the last `current` value.
|
||||
*/
|
||||
setTargetValue: function (value)
|
||||
{
|
||||
if (value === undefined) { value = this.current; }
|
||||
|
||||
this.tween.targets[this.targetIndex][this.key] = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData state to CREATED.
|
||||
*
|
||||
|
@ -202066,7 +202153,7 @@ var TweenChain = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ this ].concat(handler.params));
|
||||
handler.func.apply(this.callbackScope, [ this ].concat(handler.params));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -202609,7 +202696,7 @@ var TweenData = new Class({
|
|||
var key = this.key;
|
||||
|
||||
var current = this.current;
|
||||
var previous = this.previoius;
|
||||
var previous = this.previous;
|
||||
|
||||
tween.emit(event, tween, key, target, current, previous);
|
||||
|
||||
|
@ -203138,7 +203225,7 @@ var TweenFrameData = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
handler.func.apply(tween.callbackScope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
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
223
dist/phaser-ie9.js
vendored
223
dist/phaser-ie9.js
vendored
|
@ -619,7 +619,7 @@ var GetFastValue = __webpack_require__(72632);
|
|||
var NOOP = __webpack_require__(72283);
|
||||
var Zone = __webpack_require__(71030);
|
||||
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1).setOrigin(0, 0);
|
||||
|
||||
/**
|
||||
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
|
||||
|
@ -909,7 +909,7 @@ module.exports = IncY;
|
|||
|
||||
/**
|
||||
* Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle.
|
||||
*
|
||||
*
|
||||
* If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property.
|
||||
*
|
||||
* @function Phaser.Actions.PlaceOnCircle
|
||||
|
@ -932,10 +932,14 @@ var PlaceOnCircle = function (items, circle, startAngle, endAngle)
|
|||
var angle = startAngle;
|
||||
var angleStep = (endAngle - startAngle) / items.length;
|
||||
|
||||
var cx = circle.x;
|
||||
var cy = circle.y;
|
||||
var radius = circle.radius;
|
||||
|
||||
for (var i = 0; i < items.length; i++)
|
||||
{
|
||||
items[i].x = circle.x + (circle.radius * Math.cos(angle));
|
||||
items[i].y = circle.y + (circle.radius * Math.sin(angle));
|
||||
items[i].x = cx + (radius * Math.cos(angle));
|
||||
items[i].y = cy + (radius * Math.sin(angle));
|
||||
|
||||
angle += angleStep;
|
||||
}
|
||||
|
@ -15404,7 +15408,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.12',
|
||||
VERSION: '3.60.0-beta.13',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -40203,7 +40207,7 @@ var PathFollower = {
|
|||
tweenData.elapsed = tweenData.duration * seek;
|
||||
var v = tweenData.ease(tweenData.progress);
|
||||
tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);
|
||||
tweenData.target[tweenData.key] = tweenData.current;
|
||||
tweenData.setTargetValue();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60895,7 +60899,6 @@ var RenderTexture = new Class({
|
|||
|
||||
this.type = 'RenderTexture';
|
||||
|
||||
|
||||
/**
|
||||
* An internal Camera that can be used to move around this Render Texture.
|
||||
*
|
||||
|
@ -60949,6 +60952,41 @@ var RenderTexture = new Class({
|
|||
|
||||
this.texture.setSize(width, height);
|
||||
|
||||
this.updateDisplayOrigin();
|
||||
|
||||
var input = this.input;
|
||||
|
||||
if (input && !input.customHitArea)
|
||||
{
|
||||
input.hitArea.width = width;
|
||||
input.hitArea.height = height;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Resizes the Render Texture to the new dimensions given.
|
||||
*
|
||||
* In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture.
|
||||
* In Canvas it will resize the underlying canvas element.
|
||||
*
|
||||
* Both approaches will erase everything currently drawn to the Render Texture.
|
||||
*
|
||||
* If the dimensions given are the same as those already being used, calling this method will do nothing.
|
||||
*
|
||||
* @method Phaser.GameObjects.RenderTexture#resize
|
||||
* @since 3.10.0
|
||||
*
|
||||
* @param {number} width - The new width of the Render Texture.
|
||||
* @param {number} [height=width] - The new height of the Render Texture. If not specified, will be set the same as the `width`.
|
||||
*
|
||||
* @return {this} This Render Texture.
|
||||
*/
|
||||
resize: function (width, height)
|
||||
{
|
||||
this.setSize(width, height);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -60993,7 +61031,7 @@ var RenderTexture = new Class({
|
|||
|
||||
texture.key = key;
|
||||
|
||||
if (this.textureManager.addDynamicTexture(texture))
|
||||
if (texture.manager.addDynamicTexture(texture))
|
||||
{
|
||||
this._saved = true;
|
||||
}
|
||||
|
@ -63119,6 +63157,8 @@ var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
pipeline.vertexCount += vertexCount;
|
||||
|
||||
pipeline.currentBatch.count = (pipeline.vertexCount - pipeline.currentBatch.start);
|
||||
|
||||
renderer.pipelines.postBatch(src);
|
||||
};
|
||||
|
||||
|
@ -81146,7 +81186,7 @@ module.exports = LineToCircle;
|
|||
/***/ }),
|
||||
|
||||
/***/ 25227:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module) => {
|
||||
|
||||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
|
@ -81154,8 +81194,6 @@ module.exports = LineToCircle;
|
|||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||
*/
|
||||
|
||||
var Point = __webpack_require__(79967);
|
||||
|
||||
// This is based off an explanation and expanded math presented by Paul Bourke:
|
||||
// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
|
||||
|
||||
|
@ -81167,13 +81205,12 @@ var Point = __webpack_require__(79967);
|
|||
*
|
||||
* @param {Phaser.Geom.Line} line1 - The first Line to check.
|
||||
* @param {Phaser.Geom.Line} line2 - The second Line to check.
|
||||
* @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.
|
||||
* @param {Phaser.Types.Math.Vector2Like} [out] - An optional point-like object in which to store the coordinates of intersection, if needed.
|
||||
*
|
||||
* @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.
|
||||
*/
|
||||
var LineToLine = function (line1, line2, out)
|
||||
{
|
||||
if (out === undefined) { out = new Point(); }
|
||||
|
||||
var x1 = line1.x1;
|
||||
var y1 = line1.y1;
|
||||
|
@ -81208,8 +81245,11 @@ var LineToLine = function (line1, line2, out)
|
|||
|
||||
if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
if (out)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -93949,6 +93989,8 @@ var InputPlugin = new Class({
|
|||
// If GameObject.input already cleared from higher class
|
||||
if (input)
|
||||
{
|
||||
this.removeDebug(gameObject);
|
||||
|
||||
input.gameObject = undefined;
|
||||
input.target = undefined;
|
||||
input.hitArea = undefined;
|
||||
|
@ -132028,7 +132070,12 @@ var Body = new Class({
|
|||
}
|
||||
|
||||
this.updateCenter();
|
||||
this.checkWorldBounds();
|
||||
|
||||
if (this.collideWorldBounds)
|
||||
{
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
this.resetFlags(true);
|
||||
},
|
||||
|
||||
|
@ -132392,16 +132439,6 @@ var Body = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
setValue: function (vec2, x, y)
|
||||
{
|
||||
if (x === undefined) { x = vec2.x; }
|
||||
if (y === undefined) { y = vec2.y; }
|
||||
|
||||
vec2.set(x, y);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the Body's velocity.
|
||||
*
|
||||
|
@ -171375,6 +171412,9 @@ var BitmapMaskPipeline = new Class({
|
|||
{
|
||||
this.set2f('uResolution', this.width, this.height);
|
||||
}
|
||||
|
||||
// Clear gl.TEXTURE1
|
||||
gl.bindTexture(gl.TEXTURE_2D, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176854,12 +176894,12 @@ var ScaleManager = new Class({
|
|||
/**
|
||||
* Internal object containing our defined event listeners.
|
||||
*
|
||||
* @name Phaser.Scale.ScaleManager#listeners
|
||||
* @name Phaser.Scale.ScaleManager#domlisteners
|
||||
* @type {object}
|
||||
* @private
|
||||
* @since 3.16.0
|
||||
*/
|
||||
this.listeners = {
|
||||
this.domlisteners = {
|
||||
|
||||
orientationChange: NOOP,
|
||||
windowResize: NOOP,
|
||||
|
@ -177875,7 +177915,7 @@ var ScaleManager = new Class({
|
|||
startListeners: function ()
|
||||
{
|
||||
var _this = this;
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
listeners.orientationChange = function ()
|
||||
{
|
||||
|
@ -178060,7 +178100,7 @@ var ScaleManager = new Class({
|
|||
*/
|
||||
stopListeners: function ()
|
||||
{
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
window.removeEventListener('orientationchange', listeners.orientationChange, false);
|
||||
window.removeEventListener('resize', listeners.windowResize, false);
|
||||
|
@ -192227,8 +192267,13 @@ var Set = new Class({
|
|||
|
||||
/**
|
||||
* Passes each value in this Set to the given callback.
|
||||
*
|
||||
* For when you absolutely know this Set won't be modified during the iteration.
|
||||
*
|
||||
* The callback must return a boolean. If it returns `false` then it will abort
|
||||
* the Set iteration immediately. If it returns `true`, it will carry on
|
||||
* iterating the next child in the Set.
|
||||
*
|
||||
* @method Phaser.Structs.Set#iterate
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -193434,7 +193479,7 @@ var CanvasTexture = new Class({
|
|||
* @type {CanvasRenderingContext2D}
|
||||
* @since 3.7.0
|
||||
*/
|
||||
this.context = this.canvas.getContext('2d');
|
||||
this.context = this.canvas.getContext('2d', { willReadFrequently: true });
|
||||
|
||||
/**
|
||||
* The width of the Canvas.
|
||||
|
@ -198711,38 +198756,44 @@ var TextureSource = new Class({
|
|||
|
||||
if (renderer)
|
||||
{
|
||||
var source = this.source;
|
||||
|
||||
if (renderer.gl)
|
||||
{
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var width = this.width;
|
||||
var height = this.height;
|
||||
var scaleMode = this.scaleMode;
|
||||
|
||||
if (this.isCanvas)
|
||||
{
|
||||
this.glTexture = renderer.createCanvasTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createCanvasTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isVideo)
|
||||
{
|
||||
this.glTexture = renderer.createVideoTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createVideoTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
// this.image = this.source.canvas;
|
||||
|
||||
this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(null, width, height, scaleMode);
|
||||
}
|
||||
else if (this.isGLTexture)
|
||||
{
|
||||
this.glTexture = this.source;
|
||||
this.glTexture = source;
|
||||
}
|
||||
else if (this.compressionAlgorithm)
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.source);
|
||||
this.glTexture = renderer.createTextureFromSource(source);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(image, width, height, scaleMode);
|
||||
}
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
this.image = this.source.canvas;
|
||||
this.image = source.canvas;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198800,15 +198851,18 @@ var TextureSource = new Class({
|
|||
*/
|
||||
update: function ()
|
||||
{
|
||||
var gl = this.renderer.gl;
|
||||
var renderer = this.renderer;
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var gl = renderer.gl;
|
||||
|
||||
if (gl && this.isCanvas)
|
||||
{
|
||||
this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateCanvasTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
else if (gl && this.isVideo)
|
||||
{
|
||||
this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateVideoTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -214575,13 +214629,13 @@ var TweenManager = new Class({
|
|||
this.scene = scene;
|
||||
|
||||
/**
|
||||
* The Systems object of the Scene which owns this Tween Manager.
|
||||
* The Scene Systems Event Emitter.
|
||||
*
|
||||
* @name Phaser.Tweens.TweenManager#systems
|
||||
* @type {Phaser.Scenes.Systems}
|
||||
* @since 3.0.0
|
||||
* @name Phaser.Tweens.TweenManager#events
|
||||
* @type {Phaser.Events.EventEmitter}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this.systems = scene.sys;
|
||||
this.events = scene.sys.events;
|
||||
|
||||
/**
|
||||
* The time scale of the Tween Manager.
|
||||
|
@ -214702,8 +214756,8 @@ var TweenManager = new Class({
|
|||
*/
|
||||
this.gap = 1000 / 240;
|
||||
|
||||
scene.sys.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
scene.sys.events.on(SceneEvents.START, this.start, this);
|
||||
this.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
this.events.on(SceneEvents.START, this.start, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -214716,7 +214770,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
boot: function ()
|
||||
{
|
||||
this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
this.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -214730,17 +214784,15 @@ var TweenManager = new Class({
|
|||
*/
|
||||
start: function ()
|
||||
{
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.on(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
|
||||
this.timeScale = 1;
|
||||
this.paused = false;
|
||||
|
||||
this.startTime = Date.now();
|
||||
this.prevTime = this.startTime;
|
||||
this.nextTime = this.gap;
|
||||
|
||||
this.events.on(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -215191,8 +215243,9 @@ var TweenManager = new Class({
|
|||
|
||||
var delta = this.getDelta(tick);
|
||||
|
||||
if (delta === 0)
|
||||
if (delta <= 0)
|
||||
{
|
||||
// If we've got a negative delta, skip this step
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -215389,7 +215442,14 @@ var TweenManager = new Class({
|
|||
var output = [];
|
||||
var list = this.tweens;
|
||||
|
||||
target = Flatten(target);
|
||||
if (!Array.isArray(target))
|
||||
{
|
||||
target = [ target ];
|
||||
}
|
||||
else
|
||||
{
|
||||
target = Flatten(target);
|
||||
}
|
||||
|
||||
var targetLen = target.length;
|
||||
|
||||
|
@ -215488,7 +215548,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
killAll: function ()
|
||||
{
|
||||
var tweens = (this.processing) ? this.getAllTweens() : this.tweens;
|
||||
var tweens = (this.processing) ? this.getTweens() : this.tweens;
|
||||
|
||||
for (var i = 0; i < tweens.length; i++)
|
||||
{
|
||||
|
@ -215590,10 +215650,8 @@ var TweenManager = new Class({
|
|||
|
||||
this.tweens = [];
|
||||
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.off(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
this.events.off(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -215607,10 +215665,10 @@ var TweenManager = new Class({
|
|||
{
|
||||
this.shutdown();
|
||||
|
||||
this.scene.sys.events.off(SceneEvents.START, this.start, this);
|
||||
this.events.off(SceneEvents.START, this.start, this);
|
||||
|
||||
this.scene = null;
|
||||
this.systems = null;
|
||||
this.events = null;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -217541,6 +217599,7 @@ var Tweens = {
|
|||
TweenManager: __webpack_require__(64532),
|
||||
Tween: __webpack_require__(39366),
|
||||
TweenData: __webpack_require__(15718),
|
||||
TweenFrameData: __webpack_require__(96490),
|
||||
|
||||
BaseTween: __webpack_require__(502),
|
||||
TweenChain: __webpack_require__(45641)
|
||||
|
@ -218690,6 +218749,34 @@ var BaseTweenData = new Class({
|
|||
this.isCountdown = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the target object belonging to this TweenData.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#getTarget
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {object} The target object. Can be any JavaScript object, but is typically a Game Object.
|
||||
*/
|
||||
getTarget: function ()
|
||||
{
|
||||
return this.tween.targets[this.targetIndex];
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData's target object property to be the given value.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#setTargetValue
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {number} [value] - The value to set on the target. If not given, sets it to the last `current` value.
|
||||
*/
|
||||
setTargetValue: function (value)
|
||||
{
|
||||
if (value === undefined) { value = this.current; }
|
||||
|
||||
this.tween.targets[this.targetIndex][this.key] = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData state to CREATED.
|
||||
*
|
||||
|
@ -220284,7 +220371,7 @@ var TweenChain = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ this ].concat(handler.params));
|
||||
handler.func.apply(this.callbackScope, [ this ].concat(handler.params));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -220827,7 +220914,7 @@ var TweenData = new Class({
|
|||
var key = this.key;
|
||||
|
||||
var current = this.current;
|
||||
var previous = this.previoius;
|
||||
var previous = this.previous;
|
||||
|
||||
tween.emit(event, tween, key, target, current, previous);
|
||||
|
||||
|
@ -221356,7 +221443,7 @@ var TweenFrameData = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
handler.func.apply(tween.callbackScope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
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
223
dist/phaser.js
vendored
223
dist/phaser.js
vendored
|
@ -619,7 +619,7 @@ var GetFastValue = __webpack_require__(72632);
|
|||
var NOOP = __webpack_require__(72283);
|
||||
var Zone = __webpack_require__(71030);
|
||||
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1).setOrigin(0, 0);
|
||||
|
||||
/**
|
||||
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
|
||||
|
@ -909,7 +909,7 @@ module.exports = IncY;
|
|||
|
||||
/**
|
||||
* Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle.
|
||||
*
|
||||
*
|
||||
* If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property.
|
||||
*
|
||||
* @function Phaser.Actions.PlaceOnCircle
|
||||
|
@ -932,10 +932,14 @@ var PlaceOnCircle = function (items, circle, startAngle, endAngle)
|
|||
var angle = startAngle;
|
||||
var angleStep = (endAngle - startAngle) / items.length;
|
||||
|
||||
var cx = circle.x;
|
||||
var cy = circle.y;
|
||||
var radius = circle.radius;
|
||||
|
||||
for (var i = 0; i < items.length; i++)
|
||||
{
|
||||
items[i].x = circle.x + (circle.radius * Math.cos(angle));
|
||||
items[i].y = circle.y + (circle.radius * Math.sin(angle));
|
||||
items[i].x = cx + (radius * Math.cos(angle));
|
||||
items[i].y = cy + (radius * Math.sin(angle));
|
||||
|
||||
angle += angleStep;
|
||||
}
|
||||
|
@ -15404,7 +15408,7 @@ var CONST = {
|
|||
* @type {string}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
VERSION: '3.60.0-beta.12',
|
||||
VERSION: '3.60.0-beta.13',
|
||||
|
||||
BlendModes: __webpack_require__(95723),
|
||||
|
||||
|
@ -40203,7 +40207,7 @@ var PathFollower = {
|
|||
tweenData.elapsed = tweenData.duration * seek;
|
||||
var v = tweenData.ease(tweenData.progress);
|
||||
tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);
|
||||
tweenData.target[tweenData.key] = tweenData.current;
|
||||
tweenData.setTargetValue();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -60895,7 +60899,6 @@ var RenderTexture = new Class({
|
|||
|
||||
this.type = 'RenderTexture';
|
||||
|
||||
|
||||
/**
|
||||
* An internal Camera that can be used to move around this Render Texture.
|
||||
*
|
||||
|
@ -60949,6 +60952,41 @@ var RenderTexture = new Class({
|
|||
|
||||
this.texture.setSize(width, height);
|
||||
|
||||
this.updateDisplayOrigin();
|
||||
|
||||
var input = this.input;
|
||||
|
||||
if (input && !input.customHitArea)
|
||||
{
|
||||
input.hitArea.width = width;
|
||||
input.hitArea.height = height;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Resizes the Render Texture to the new dimensions given.
|
||||
*
|
||||
* In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture.
|
||||
* In Canvas it will resize the underlying canvas element.
|
||||
*
|
||||
* Both approaches will erase everything currently drawn to the Render Texture.
|
||||
*
|
||||
* If the dimensions given are the same as those already being used, calling this method will do nothing.
|
||||
*
|
||||
* @method Phaser.GameObjects.RenderTexture#resize
|
||||
* @since 3.10.0
|
||||
*
|
||||
* @param {number} width - The new width of the Render Texture.
|
||||
* @param {number} [height=width] - The new height of the Render Texture. If not specified, will be set the same as the `width`.
|
||||
*
|
||||
* @return {this} This Render Texture.
|
||||
*/
|
||||
resize: function (width, height)
|
||||
{
|
||||
this.setSize(width, height);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -60993,7 +61031,7 @@ var RenderTexture = new Class({
|
|||
|
||||
texture.key = key;
|
||||
|
||||
if (this.textureManager.addDynamicTexture(texture))
|
||||
if (texture.manager.addDynamicTexture(texture))
|
||||
{
|
||||
this._saved = true;
|
||||
}
|
||||
|
@ -63119,6 +63157,8 @@ var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix)
|
|||
|
||||
pipeline.vertexCount += vertexCount;
|
||||
|
||||
pipeline.currentBatch.count = (pipeline.vertexCount - pipeline.currentBatch.start);
|
||||
|
||||
renderer.pipelines.postBatch(src);
|
||||
};
|
||||
|
||||
|
@ -81146,7 +81186,7 @@ module.exports = LineToCircle;
|
|||
/***/ }),
|
||||
|
||||
/***/ 25227:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module) => {
|
||||
|
||||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
|
@ -81154,8 +81194,6 @@ module.exports = LineToCircle;
|
|||
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
||||
*/
|
||||
|
||||
var Point = __webpack_require__(79967);
|
||||
|
||||
// This is based off an explanation and expanded math presented by Paul Bourke:
|
||||
// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
|
||||
|
||||
|
@ -81167,13 +81205,12 @@ var Point = __webpack_require__(79967);
|
|||
*
|
||||
* @param {Phaser.Geom.Line} line1 - The first Line to check.
|
||||
* @param {Phaser.Geom.Line} line2 - The second Line to check.
|
||||
* @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.
|
||||
* @param {Phaser.Types.Math.Vector2Like} [out] - An optional point-like object in which to store the coordinates of intersection, if needed.
|
||||
*
|
||||
* @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.
|
||||
*/
|
||||
var LineToLine = function (line1, line2, out)
|
||||
{
|
||||
if (out === undefined) { out = new Point(); }
|
||||
|
||||
var x1 = line1.x1;
|
||||
var y1 = line1.y1;
|
||||
|
@ -81208,8 +81245,11 @@ var LineToLine = function (line1, line2, out)
|
|||
|
||||
if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
if (out)
|
||||
{
|
||||
out.x = x1 + (uA * (x2 - x1));
|
||||
out.y = y1 + (uA * (y2 - y1));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -93949,6 +93989,8 @@ var InputPlugin = new Class({
|
|||
// If GameObject.input already cleared from higher class
|
||||
if (input)
|
||||
{
|
||||
this.removeDebug(gameObject);
|
||||
|
||||
input.gameObject = undefined;
|
||||
input.target = undefined;
|
||||
input.hitArea = undefined;
|
||||
|
@ -132026,7 +132068,12 @@ var Body = new Class({
|
|||
}
|
||||
|
||||
this.updateCenter();
|
||||
this.checkWorldBounds();
|
||||
|
||||
if (this.collideWorldBounds)
|
||||
{
|
||||
this.checkWorldBounds();
|
||||
}
|
||||
|
||||
this.resetFlags(true);
|
||||
},
|
||||
|
||||
|
@ -132390,16 +132437,6 @@ var Body = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
setValue: function (vec2, x, y)
|
||||
{
|
||||
if (x === undefined) { x = vec2.x; }
|
||||
if (y === undefined) { y = vec2.y; }
|
||||
|
||||
vec2.set(x, y);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the Body's velocity.
|
||||
*
|
||||
|
@ -170931,6 +170968,9 @@ var BitmapMaskPipeline = new Class({
|
|||
{
|
||||
this.set2f('uResolution', this.width, this.height);
|
||||
}
|
||||
|
||||
// Clear gl.TEXTURE1
|
||||
gl.bindTexture(gl.TEXTURE_2D, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176410,12 +176450,12 @@ var ScaleManager = new Class({
|
|||
/**
|
||||
* Internal object containing our defined event listeners.
|
||||
*
|
||||
* @name Phaser.Scale.ScaleManager#listeners
|
||||
* @name Phaser.Scale.ScaleManager#domlisteners
|
||||
* @type {object}
|
||||
* @private
|
||||
* @since 3.16.0
|
||||
*/
|
||||
this.listeners = {
|
||||
this.domlisteners = {
|
||||
|
||||
orientationChange: NOOP,
|
||||
windowResize: NOOP,
|
||||
|
@ -177431,7 +177471,7 @@ var ScaleManager = new Class({
|
|||
startListeners: function ()
|
||||
{
|
||||
var _this = this;
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
listeners.orientationChange = function ()
|
||||
{
|
||||
|
@ -177616,7 +177656,7 @@ var ScaleManager = new Class({
|
|||
*/
|
||||
stopListeners: function ()
|
||||
{
|
||||
var listeners = this.listeners;
|
||||
var listeners = this.domlisteners;
|
||||
|
||||
window.removeEventListener('orientationchange', listeners.orientationChange, false);
|
||||
window.removeEventListener('resize', listeners.windowResize, false);
|
||||
|
@ -191783,8 +191823,13 @@ var Set = new Class({
|
|||
|
||||
/**
|
||||
* Passes each value in this Set to the given callback.
|
||||
*
|
||||
* For when you absolutely know this Set won't be modified during the iteration.
|
||||
*
|
||||
* The callback must return a boolean. If it returns `false` then it will abort
|
||||
* the Set iteration immediately. If it returns `true`, it will carry on
|
||||
* iterating the next child in the Set.
|
||||
*
|
||||
* @method Phaser.Structs.Set#iterate
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -192990,7 +193035,7 @@ var CanvasTexture = new Class({
|
|||
* @type {CanvasRenderingContext2D}
|
||||
* @since 3.7.0
|
||||
*/
|
||||
this.context = this.canvas.getContext('2d');
|
||||
this.context = this.canvas.getContext('2d', { willReadFrequently: true });
|
||||
|
||||
/**
|
||||
* The width of the Canvas.
|
||||
|
@ -198267,38 +198312,44 @@ var TextureSource = new Class({
|
|||
|
||||
if (renderer)
|
||||
{
|
||||
var source = this.source;
|
||||
|
||||
if (renderer.gl)
|
||||
{
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var width = this.width;
|
||||
var height = this.height;
|
||||
var scaleMode = this.scaleMode;
|
||||
|
||||
if (this.isCanvas)
|
||||
{
|
||||
this.glTexture = renderer.createCanvasTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createCanvasTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isVideo)
|
||||
{
|
||||
this.glTexture = renderer.createVideoTexture(this.image, false, this.flipY);
|
||||
this.glTexture = renderer.createVideoTexture(image, false, flipY);
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
// this.image = this.source.canvas;
|
||||
|
||||
this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(null, width, height, scaleMode);
|
||||
}
|
||||
else if (this.isGLTexture)
|
||||
{
|
||||
this.glTexture = this.source;
|
||||
this.glTexture = source;
|
||||
}
|
||||
else if (this.compressionAlgorithm)
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.source);
|
||||
this.glTexture = renderer.createTextureFromSource(source);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.glTexture = renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||
this.glTexture = renderer.createTextureFromSource(image, width, height, scaleMode);
|
||||
}
|
||||
}
|
||||
else if (this.isRenderTexture)
|
||||
{
|
||||
this.image = this.source.canvas;
|
||||
this.image = source.canvas;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198356,15 +198407,18 @@ var TextureSource = new Class({
|
|||
*/
|
||||
update: function ()
|
||||
{
|
||||
var gl = this.renderer.gl;
|
||||
var renderer = this.renderer;
|
||||
var image = this.image;
|
||||
var flipY = this.flipY;
|
||||
var gl = renderer.gl;
|
||||
|
||||
if (gl && this.isCanvas)
|
||||
{
|
||||
this.glTexture = this.renderer.updateCanvasTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateCanvasTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
else if (gl && this.isVideo)
|
||||
{
|
||||
this.glTexture = this.renderer.updateVideoTexture(this.image, this.glTexture, this.flipY);
|
||||
this.glTexture = renderer.updateVideoTexture(image, this.glTexture, flipY);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -214131,13 +214185,13 @@ var TweenManager = new Class({
|
|||
this.scene = scene;
|
||||
|
||||
/**
|
||||
* The Systems object of the Scene which owns this Tween Manager.
|
||||
* The Scene Systems Event Emitter.
|
||||
*
|
||||
* @name Phaser.Tweens.TweenManager#systems
|
||||
* @type {Phaser.Scenes.Systems}
|
||||
* @since 3.0.0
|
||||
* @name Phaser.Tweens.TweenManager#events
|
||||
* @type {Phaser.Events.EventEmitter}
|
||||
* @since 3.60.0
|
||||
*/
|
||||
this.systems = scene.sys;
|
||||
this.events = scene.sys.events;
|
||||
|
||||
/**
|
||||
* The time scale of the Tween Manager.
|
||||
|
@ -214258,8 +214312,8 @@ var TweenManager = new Class({
|
|||
*/
|
||||
this.gap = 1000 / 240;
|
||||
|
||||
scene.sys.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
scene.sys.events.on(SceneEvents.START, this.start, this);
|
||||
this.events.once(SceneEvents.BOOT, this.boot, this);
|
||||
this.events.on(SceneEvents.START, this.start, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -214272,7 +214326,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
boot: function ()
|
||||
{
|
||||
this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
this.events.once(SceneEvents.DESTROY, this.destroy, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -214286,17 +214340,15 @@ var TweenManager = new Class({
|
|||
*/
|
||||
start: function ()
|
||||
{
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.on(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
|
||||
this.timeScale = 1;
|
||||
this.paused = false;
|
||||
|
||||
this.startTime = Date.now();
|
||||
this.prevTime = this.startTime;
|
||||
this.nextTime = this.gap;
|
||||
|
||||
this.events.on(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -214747,8 +214799,9 @@ var TweenManager = new Class({
|
|||
|
||||
var delta = this.getDelta(tick);
|
||||
|
||||
if (delta === 0)
|
||||
if (delta <= 0)
|
||||
{
|
||||
// If we've got a negative delta, skip this step
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -214945,7 +214998,14 @@ var TweenManager = new Class({
|
|||
var output = [];
|
||||
var list = this.tweens;
|
||||
|
||||
target = Flatten(target);
|
||||
if (!Array.isArray(target))
|
||||
{
|
||||
target = [ target ];
|
||||
}
|
||||
else
|
||||
{
|
||||
target = Flatten(target);
|
||||
}
|
||||
|
||||
var targetLen = target.length;
|
||||
|
||||
|
@ -215044,7 +215104,7 @@ var TweenManager = new Class({
|
|||
*/
|
||||
killAll: function ()
|
||||
{
|
||||
var tweens = (this.processing) ? this.getAllTweens() : this.tweens;
|
||||
var tweens = (this.processing) ? this.getTweens() : this.tweens;
|
||||
|
||||
for (var i = 0; i < tweens.length; i++)
|
||||
{
|
||||
|
@ -215146,10 +215206,8 @@ var TweenManager = new Class({
|
|||
|
||||
this.tweens = [];
|
||||
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.off(SceneEvents.UPDATE, this.update, this);
|
||||
eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
this.events.off(SceneEvents.UPDATE, this.update, this);
|
||||
this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -215163,10 +215221,10 @@ var TweenManager = new Class({
|
|||
{
|
||||
this.shutdown();
|
||||
|
||||
this.scene.sys.events.off(SceneEvents.START, this.start, this);
|
||||
this.events.off(SceneEvents.START, this.start, this);
|
||||
|
||||
this.scene = null;
|
||||
this.systems = null;
|
||||
this.events = null;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -217097,6 +217155,7 @@ var Tweens = {
|
|||
TweenManager: __webpack_require__(64532),
|
||||
Tween: __webpack_require__(39366),
|
||||
TweenData: __webpack_require__(15718),
|
||||
TweenFrameData: __webpack_require__(96490),
|
||||
|
||||
BaseTween: __webpack_require__(502),
|
||||
TweenChain: __webpack_require__(45641)
|
||||
|
@ -218246,6 +218305,34 @@ var BaseTweenData = new Class({
|
|||
this.isCountdown = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the target object belonging to this TweenData.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#getTarget
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @return {object} The target object. Can be any JavaScript object, but is typically a Game Object.
|
||||
*/
|
||||
getTarget: function ()
|
||||
{
|
||||
return this.tween.targets[this.targetIndex];
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData's target object property to be the given value.
|
||||
*
|
||||
* @method Phaser.Tweens.BaseTweenData#setTargetValue
|
||||
* @since 3.60.0
|
||||
*
|
||||
* @param {number} [value] - The value to set on the target. If not given, sets it to the last `current` value.
|
||||
*/
|
||||
setTargetValue: function (value)
|
||||
{
|
||||
if (value === undefined) { value = this.current; }
|
||||
|
||||
this.tween.targets[this.targetIndex][this.key] = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this TweenData state to CREATED.
|
||||
*
|
||||
|
@ -219840,7 +219927,7 @@ var TweenChain = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ this ].concat(handler.params));
|
||||
handler.func.apply(this.callbackScope, [ this ].concat(handler.params));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -220383,7 +220470,7 @@ var TweenData = new Class({
|
|||
var key = this.key;
|
||||
|
||||
var current = this.current;
|
||||
var previous = this.previoius;
|
||||
var previous = this.previous;
|
||||
|
||||
tween.emit(event, tween, key, target, current, previous);
|
||||
|
||||
|
@ -220912,7 +220999,7 @@ var TweenFrameData = new Class({
|
|||
|
||||
if (handler)
|
||||
{
|
||||
handler.func.apply(handler.scope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
handler.func.apply(tween.callbackScope, [ tween, target, 'texture' ].concat(handler.params));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
2
dist/phaser.min.js
vendored
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
40
types/phaser.d.ts
vendored
40
types/phaser.d.ts
vendored
|
@ -28829,6 +28829,20 @@ declare namespace Phaser {
|
|||
*/
|
||||
setSize(width: number, height: number): this;
|
||||
|
||||
/**
|
||||
* Resizes the Render Texture to the new dimensions given.
|
||||
*
|
||||
* In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture.
|
||||
* In Canvas it will resize the underlying canvas element.
|
||||
*
|
||||
* Both approaches will erase everything currently drawn to the Render Texture.
|
||||
*
|
||||
* If the dimensions given are the same as those already being used, calling this method will do nothing.
|
||||
* @param width The new width of the Render Texture.
|
||||
* @param height The new height of the Render Texture. If not specified, will be set the same as the `width`. Default width.
|
||||
*/
|
||||
resize(width: number, height?: number): this;
|
||||
|
||||
/**
|
||||
* Stores a copy of this Render Texture in the Texture Manager using the given key.
|
||||
*
|
||||
|
@ -48842,9 +48856,9 @@ declare namespace Phaser {
|
|||
* Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting.
|
||||
* @param line1 The first Line to check.
|
||||
* @param line2 The second Line to check.
|
||||
* @param out A Point in which to optionally store the point of intersection.
|
||||
* @param out An optional point-like object in which to store the coordinates of intersection, if needed.
|
||||
*/
|
||||
function LineToLine(line1: Phaser.Geom.Line, line2: Phaser.Geom.Line, out?: Phaser.Geom.Point): boolean;
|
||||
function LineToLine(line1: Phaser.Geom.Line, line2: Phaser.Geom.Line, out?: Phaser.Types.Math.Vector2Like): boolean;
|
||||
|
||||
/**
|
||||
* Checks for intersection between the Line and a Rectangle shape, or a rectangle-like
|
||||
|
@ -64939,7 +64953,7 @@ declare namespace Phaser {
|
|||
getPoints: Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback;
|
||||
};
|
||||
|
||||
type EdgeZoneSourceCallback = (quantity: number, stepRate?: number)=>Phaser.Geom.Point[];
|
||||
type EdgeZoneSourceCallback = (quantity: number, stepRate?: number)=>Phaser.Types.Math.Vector2Like[];
|
||||
|
||||
type EmitterOpCustomEmitConfig = {
|
||||
/**
|
||||
|
@ -93322,7 +93336,12 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* Passes each value in this Set to the given callback.
|
||||
*
|
||||
* For when you absolutely know this Set won't be modified during the iteration.
|
||||
*
|
||||
* The callback must return a boolean. If it returns `false` then it will abort
|
||||
* the Set iteration immediately. If it returns `true`, it will carry on
|
||||
* iterating the next child in the Set.
|
||||
* @param callback The callback to be invoked and passed each value this Set contains.
|
||||
* @param callbackScope The scope of the callback.
|
||||
*/
|
||||
|
@ -101600,6 +101619,17 @@ declare namespace Phaser {
|
|||
*/
|
||||
isCountdown: boolean;
|
||||
|
||||
/**
|
||||
* Returns a reference to the target object belonging to this TweenData.
|
||||
*/
|
||||
getTarget(): object;
|
||||
|
||||
/**
|
||||
* Sets this TweenData's target object property to be the given value.
|
||||
* @param value The value to set on the target. If not given, sets it to the last `current` value.
|
||||
*/
|
||||
setTargetValue(value?: number): void;
|
||||
|
||||
/**
|
||||
* Sets this TweenData state to CREATED.
|
||||
*/
|
||||
|
@ -102408,9 +102438,9 @@ declare namespace Phaser {
|
|||
scene: Phaser.Scene;
|
||||
|
||||
/**
|
||||
* The Systems object of the Scene which owns this Tween Manager.
|
||||
* The Scene Systems Event Emitter.
|
||||
*/
|
||||
systems: Phaser.Scenes.Systems;
|
||||
events: Phaser.Events.EventEmitter;
|
||||
|
||||
/**
|
||||
* The time scale of the Tween Manager.
|
||||
|
|
Loading…
Reference in a new issue