mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Update JSDocs for events
This commit is contained in:
parent
88b088b6a2
commit
43f26ad31f
35 changed files with 384 additions and 379 deletions
|
@ -16,24 +16,24 @@ var SpineGameObject = require('./gameobject/SpineGameObject');
|
|||
/**
|
||||
* @classdesc
|
||||
* The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects.
|
||||
*
|
||||
*
|
||||
* All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin
|
||||
* uses the Spine 3.8.72 runtimes. Please note that due to the way the Spine runtimes use semver, you will
|
||||
* get breaking changes in point-releases. Therefore, files created in a different version of Spine may not
|
||||
* work as a result, without you first updating the runtimes and rebuilding the plugin.
|
||||
*
|
||||
*
|
||||
* You can find more details about Spine at http://esotericsoftware.com/.
|
||||
*
|
||||
*
|
||||
* Please note that you require a Spine license in order to use Spine Runtimes in your games.
|
||||
*
|
||||
*
|
||||
* You can install this plugin into your Phaser game by either importing it, if you're using ES6:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* import * as SpinePlugin from './SpinePlugin.js';
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* and then adding it to your Phaser Game configuration:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* plugins: {
|
||||
* scene: [
|
||||
|
@ -41,10 +41,10 @@ var SpineGameObject = require('./gameobject/SpineGameObject');
|
|||
* ]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your
|
||||
* Game Configuration object, like this:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* scene: {
|
||||
* preload: preload,
|
||||
|
@ -56,42 +56,42 @@ var SpineGameObject = require('./gameobject/SpineGameObject');
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Loading it like this allows you to then use commands such as `this.load.spine` from within the
|
||||
* same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal
|
||||
* Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any
|
||||
* subsequent Scenes.
|
||||
*
|
||||
*
|
||||
* Assuming a default environment you access it from within a Scene by using the `this.spine` reference.
|
||||
*
|
||||
*
|
||||
* When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load
|
||||
* Spine files directly, i.e.:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* It also installs a Game Object Factory method, allowing you to create Spine Game Objects:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.add.spine(512, 650, 'stretchyman')
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* The first argument is the key which you used when importing the Spine data. There are lots of
|
||||
* things you can specify, such as the animation name, skeleton, slot attachments and more. Please
|
||||
* see the respective documentation and examples for further details.
|
||||
*
|
||||
*
|
||||
* Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.
|
||||
* The associated atlas files are scanned for any texture files present in them, which are then loaded.
|
||||
* If you have exported your Spine data with preMultipliedAlpha set, then you should enable this in the
|
||||
* load arguments, or you may see black outlines around skeleton textures.
|
||||
*
|
||||
*
|
||||
* The Spine plugin is local to the Scene in which it is installed. This means a change to something,
|
||||
* such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.
|
||||
* The only exception to this is with the caches this plugin creates. Spine atlas and texture data are
|
||||
* stored in their own caches, which are global, meaning they're accessible from any Scene in your
|
||||
* game, regardless if the Scene loaded the Spine data or not.
|
||||
*
|
||||
*
|
||||
* For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference
|
||||
*
|
||||
* @class SpinePlugin
|
||||
|
@ -126,7 +126,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* A custom cache that stores the Spine atlas data.
|
||||
*
|
||||
*
|
||||
* This cache is global across your game, allowing you to access Spine data loaded from other Scenes,
|
||||
* no matter which Scene you are in.
|
||||
*
|
||||
|
@ -138,7 +138,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* A custom cache that stores the Spine Textures.
|
||||
*
|
||||
*
|
||||
* This cache is global across your game, allowing you to access Spine data loaded from other Scenes,
|
||||
* no matter which Scene you are in.
|
||||
*
|
||||
|
@ -178,7 +178,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* The underlying WebGL context of the Phaser renderer.
|
||||
*
|
||||
*
|
||||
* Only set if running in WebGL mode.
|
||||
*
|
||||
* @name SpinePlugin#gl
|
||||
|
@ -198,7 +198,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* An instance of the Spine WebGL Scene Renderer.
|
||||
*
|
||||
*
|
||||
* Only set if running in WebGL mode.
|
||||
*
|
||||
* @name SpinePlugin#sceneRenderer
|
||||
|
@ -218,7 +218,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* An instance of the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only set if running in WebGL mode.
|
||||
*
|
||||
* @name SpinePlugin#skeletonDebugRenderer
|
||||
|
@ -280,46 +280,46 @@ var SpinePlugin = new Class({
|
|||
var add = function (x, y, key, animationName, loop)
|
||||
{
|
||||
var spineGO = new SpineGameObject(this.scene, _this, x, y, key, animationName, loop);
|
||||
|
||||
|
||||
this.displayList.add(spineGO);
|
||||
this.updateList.add(spineGO);
|
||||
|
||||
|
||||
return spineGO;
|
||||
};
|
||||
|
||||
var make = function (config, addToScene)
|
||||
{
|
||||
if (config === undefined) { config = {}; }
|
||||
|
||||
|
||||
var key = GetValue(config, 'key', null);
|
||||
var animationName = GetValue(config, 'animationName', null);
|
||||
var loop = GetValue(config, 'loop', false);
|
||||
|
||||
|
||||
var spineGO = new SpineGameObject(this.scene, _this, 0, 0, key, animationName, loop);
|
||||
|
||||
|
||||
if (addToScene !== undefined)
|
||||
{
|
||||
config.add = addToScene;
|
||||
}
|
||||
|
||||
|
||||
BuildGameObject(this.scene, spineGO, config);
|
||||
|
||||
|
||||
// Spine specific
|
||||
var skinName = GetValue(config, 'skinName', false);
|
||||
|
||||
|
||||
if (skinName)
|
||||
{
|
||||
spineGO.setSkinByName(skinName);
|
||||
}
|
||||
|
||||
|
||||
var slotName = GetValue(config, 'slotName', false);
|
||||
var attachmentName = GetValue(config, 'attachmentName', null);
|
||||
|
||||
|
||||
if (slotName)
|
||||
{
|
||||
spineGO.setAttachment(slotName, attachmentName);
|
||||
}
|
||||
|
||||
|
||||
return spineGO.refresh();
|
||||
};
|
||||
|
||||
|
@ -411,9 +411,9 @@ var SpinePlugin = new Class({
|
|||
*
|
||||
* @method SpinePlugin#getAtlasCanvas
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {string} key - The key of the Spine Atlas to create.
|
||||
*
|
||||
*
|
||||
* @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.
|
||||
*/
|
||||
getAtlasCanvas: function (key)
|
||||
|
@ -452,9 +452,9 @@ var SpinePlugin = new Class({
|
|||
*
|
||||
* @method SpinePlugin#getAtlasWebGL
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {string} key - The key of the Spine Atlas to create.
|
||||
*
|
||||
*
|
||||
* @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.
|
||||
*/
|
||||
getAtlasWebGL: function (key)
|
||||
|
@ -495,7 +495,7 @@ var SpinePlugin = new Class({
|
|||
* Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -510,21 +510,21 @@ var SpinePlugin = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
*
|
||||
* Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated
|
||||
* atlas files are scanned for any texture files present in them, which are then loaded. If you have exported
|
||||
* your Spine data with preMultipliedAlpha set, then you should enable this in the arguments, or you may see black
|
||||
* outlines around skeleton textures.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Spine cache.
|
||||
* Loading a file using a key that is already taken will result in a warning.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.spine({
|
||||
* key: 'mainmenu',
|
||||
|
@ -533,9 +533,9 @@ var SpinePlugin = new Class({
|
|||
* preMultipliedAlpha: true
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If you need to load multiple Spine atlas files, provide them as an array:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -558,7 +558,7 @@ var SpinePlugin = new Class({
|
|||
* Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#spine
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.19.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
@ -573,13 +573,13 @@ var SpinePlugin = new Class({
|
|||
spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)
|
||||
{
|
||||
var multifile;
|
||||
|
||||
|
||||
if (Array.isArray(key))
|
||||
{
|
||||
for (var i = 0; i < key.length; i++)
|
||||
{
|
||||
multifile = new SpineFile(this, key[i]);
|
||||
|
||||
|
||||
this.addFile(multifile.files);
|
||||
}
|
||||
}
|
||||
|
@ -589,23 +589,23 @@ var SpinePlugin = new Class({
|
|||
|
||||
this.addFile(multifile.files);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts the given x and y screen coordinates into the world space of the given Skeleton.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#worldToLocal
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {number} x - The screen space x coordinate to convert.
|
||||
* @param {number} y - The screen space y coordinate to convert.
|
||||
* @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.
|
||||
* @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.
|
||||
*
|
||||
*
|
||||
* @return {spine.Vector2} A Vector2 containing the translated point.
|
||||
*/
|
||||
worldToLocal: function (x, y, skeleton, bone)
|
||||
|
@ -642,10 +642,10 @@ var SpinePlugin = new Class({
|
|||
*
|
||||
* @method SpinePlugin#getVector2
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {number} x - The Vector x value.
|
||||
* @param {number} y - The Vector y value.
|
||||
*
|
||||
*
|
||||
* @return {spine.Vector2} A Spine Vector2 based on the given values.
|
||||
*/
|
||||
getVector2: function (x, y)
|
||||
|
@ -655,16 +655,16 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Returns a Spine Vector2 based on the given x, y and z values.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#getVector3
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {number} x - The Vector x value.
|
||||
* @param {number} y - The Vector y value.
|
||||
* @param {number} z - The Vector z value.
|
||||
*
|
||||
*
|
||||
* @return {spine.Vector2} A Spine Vector2 based on the given values.
|
||||
*/
|
||||
getVector3: function (x, y, z)
|
||||
|
@ -674,14 +674,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawBones` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugBones
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugBones: function (value)
|
||||
|
@ -695,14 +695,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugRegionAttachments
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugRegionAttachments: function (value)
|
||||
|
@ -716,14 +716,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugBoundingBoxes
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugBoundingBoxes: function (value)
|
||||
|
@ -737,14 +737,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugMeshHull
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugMeshHull: function (value)
|
||||
|
@ -758,14 +758,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugMeshTriangles
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugMeshTriangles: function (value)
|
||||
|
@ -779,14 +779,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawPaths` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugPaths
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugPaths: function (value)
|
||||
|
@ -800,14 +800,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugSkeletonXY
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugSkeletonXY: function (value)
|
||||
|
@ -821,14 +821,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets `drawClipping` in the Spine Skeleton Debug Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setDebugClipping
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {boolean} [value=true] - The value to set in the debug property.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setDebugClipping: function (value)
|
||||
|
@ -842,14 +842,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets the given vertex effect on the Spine Skeleton Renderer.
|
||||
*
|
||||
*
|
||||
* Only works in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#setEffect
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.
|
||||
*
|
||||
*
|
||||
* @return {this} This Spine Plugin.
|
||||
*/
|
||||
setEffect: function (effect)
|
||||
|
@ -861,15 +861,15 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.
|
||||
*
|
||||
*
|
||||
* The Skeleton data should have already been loaded before calling this method.
|
||||
*
|
||||
* @method SpinePlugin#createSkeleton
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {string} key - The key of the Spine skeleton data, as loaded by the plugin. If the Spine JSON contains multiple skeletons, reference them with a period, i.e. `set.spineBoy`.
|
||||
* @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.
|
||||
*
|
||||
*
|
||||
* @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.
|
||||
*/
|
||||
createSkeleton: function (key, skeletonJSON)
|
||||
|
@ -902,7 +902,7 @@ var SpinePlugin = new Class({
|
|||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
||||
var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);
|
||||
|
||||
|
||||
var skeletonJson = new Spine.SkeletonJson(atlasLoader);
|
||||
|
||||
var data;
|
||||
|
@ -923,7 +923,7 @@ var SpinePlugin = new Class({
|
|||
var skeletonData = skeletonJson.readSkeletonData(data);
|
||||
|
||||
var skeleton = new Spine.Skeleton(skeletonData);
|
||||
|
||||
|
||||
return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };
|
||||
}
|
||||
else
|
||||
|
@ -934,14 +934,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Creates a new Animation State and Animation State Data for the given skeleton.
|
||||
*
|
||||
*
|
||||
* The returned object contains two properties: `state` and `stateData` respectively.
|
||||
*
|
||||
* @method SpinePlugin#createAnimationState
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.
|
||||
*
|
||||
*
|
||||
* @return {any} An object containing the Animation State and Animation State Data instances.
|
||||
*/
|
||||
createAnimationState: function (skeleton)
|
||||
|
@ -955,17 +955,17 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
|
||||
*
|
||||
*
|
||||
* The returned object contains two properties: `offset` and `size`:
|
||||
*
|
||||
*
|
||||
* `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.
|
||||
* `size` - The width and height of the AABB.
|
||||
*
|
||||
* @method SpinePlugin#getBounds
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.
|
||||
*
|
||||
*
|
||||
* @return {any} The bounds object.
|
||||
*/
|
||||
getBounds: function (skeleton)
|
||||
|
@ -980,7 +980,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Internal handler for when the renderer resizes.
|
||||
*
|
||||
*
|
||||
* Only called if running in WebGL.
|
||||
*
|
||||
* @method SpinePlugin#onResize
|
||||
|
@ -996,14 +996,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
sceneRenderer.camera.position.x = viewportWidth / 2;
|
||||
sceneRenderer.camera.position.y = viewportHeight / 2;
|
||||
|
||||
|
||||
sceneRenderer.camera.viewportWidth = viewportWidth;
|
||||
sceneRenderer.camera.viewportHeight = viewportHeight;
|
||||
},
|
||||
|
||||
/**
|
||||
* The Scene that owns this plugin is shutting down.
|
||||
*
|
||||
*
|
||||
* We need to kill and reset all internal properties as well as stop listening to Scene events.
|
||||
*
|
||||
* @method SpinePlugin#shutdown
|
||||
|
@ -1024,7 +1024,7 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* The Scene that owns this plugin is being destroyed.
|
||||
*
|
||||
*
|
||||
* We need to shutdown and then kill off all external references.
|
||||
*
|
||||
* @method SpinePlugin#destroy
|
||||
|
@ -1060,30 +1060,30 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Creates a new Spine Game Object and adds it to the Scene.
|
||||
*
|
||||
*
|
||||
* The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from
|
||||
* skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects
|
||||
* do not have a Phaser origin.
|
||||
*
|
||||
*
|
||||
* If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period
|
||||
* character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains
|
||||
* multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference
|
||||
* that.
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.
|
||||
*
|
||||
*
|
||||
* The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.
|
||||
*
|
||||
*
|
||||
* Should you wish for more control over the object creation, such as setting a slot attachment or skin
|
||||
* name, then use `SpinePlugin.make` instead.
|
||||
*
|
||||
* @method SpinePlugin#add
|
||||
* @since 3.19.0
|
||||
*
|
||||
*
|
||||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.
|
||||
|
@ -1095,16 +1095,16 @@ var SpinePlugin = new Class({
|
|||
|
||||
/**
|
||||
* Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.
|
||||
*
|
||||
*
|
||||
* The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from
|
||||
* skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects
|
||||
* do not have a Phaser origin.
|
||||
*
|
||||
*
|
||||
* If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period
|
||||
* character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains
|
||||
* multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference
|
||||
* that.
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* let jelly = this.make.spine({
|
||||
* x: 500, y: 500, key: 'jelly',
|
||||
|
|
|
@ -389,7 +389,7 @@ var Game = new Class({
|
|||
*
|
||||
* @method Phaser.Game#texturesReady
|
||||
* @private
|
||||
* @fires Phaser.Game#ready
|
||||
* @fires Phaser.Game#READY
|
||||
* @since 3.12.0
|
||||
*/
|
||||
texturesReady: function ()
|
||||
|
@ -443,11 +443,11 @@ var Game = new Class({
|
|||
* It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events.
|
||||
*
|
||||
* @method Phaser.Game#step
|
||||
* @fires Phaser.Core.Events#PRE_STEP_EVENT
|
||||
* @fires Phaser.Core.Events#STEP_EVENT
|
||||
* @fires Phaser.Core.Events#POST_STEP_EVENT
|
||||
* @fires Phaser.Core.Events#PRE_RENDER_EVENT
|
||||
* @fires Phaser.Core.Events#POST_RENDER_EVENT
|
||||
* @fires Phaser.Core.Events#PRE_STEP
|
||||
* @fires Phaser.Core.Events#PRE_STEP
|
||||
* @fires Phaser.Core.Events#POST_STEP
|
||||
* @fires Phaser.Core.Events#PRE_RENDER
|
||||
* @fires Phaser.Core.Events#POST_RENDER
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
|
||||
|
@ -510,8 +510,8 @@ var Game = new Class({
|
|||
* This process emits `prerender` and `postrender` events, even though nothing actually displays.
|
||||
*
|
||||
* @method Phaser.Game#headlessStep
|
||||
* @fires Phaser.Game#prerenderEvent
|
||||
* @fires Phaser.Game#postrenderEvent
|
||||
* @fires Phaser.Game#PRE_RENDER
|
||||
* @fires Phaser.Game#POST_RENDER
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
|
||||
|
@ -672,7 +672,7 @@ var Game = new Class({
|
|||
runDestroy: function ()
|
||||
{
|
||||
this.scene.destroy();
|
||||
|
||||
|
||||
this.events.emit(Events.DESTROY);
|
||||
|
||||
this.events.removeAllListeners();
|
||||
|
|
|
@ -297,14 +297,14 @@ var Animation = new Class({
|
|||
|
||||
/**
|
||||
* Sets an animation to be played immediately after the current one completes.
|
||||
*
|
||||
*
|
||||
* The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it.
|
||||
*
|
||||
*
|
||||
* An animation set to repeat forever will never enter a completed state.
|
||||
*
|
||||
*
|
||||
* You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback).
|
||||
* Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing.
|
||||
*
|
||||
*
|
||||
* Call this method with no arguments to reset the chained animation.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#chain
|
||||
|
@ -496,7 +496,7 @@ var Animation = new Class({
|
|||
|
||||
/**
|
||||
* Plays an Animation on a Game Object that has the Animation component, such as a Sprite.
|
||||
*
|
||||
*
|
||||
* Animations are stored in the global Animation Manager and are referenced by a unique string-based key.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#play
|
||||
|
@ -570,9 +570,9 @@ var Animation = new Class({
|
|||
* Load an Animation and fires 'onStartEvent' event, extracted from 'play' method.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#_startAnimation
|
||||
* @fires Phaser.Animations.Events#START_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_START_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_START_KEY_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#ANIMATION_START
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_START
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager.
|
||||
|
@ -777,9 +777,9 @@ var Animation = new Class({
|
|||
* Restarts the current animation from its beginning, optionally including its delay value.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#restart
|
||||
* @fires Phaser.Animations.Events#RESTART_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_RESTART_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_RESTART_KEY_ANIMATION_EVENT
|
||||
* @fires Phaser.Animations.Events#ANIMATION_RESTART
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_RESTART
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting.
|
||||
|
@ -816,9 +816,9 @@ var Animation = new Class({
|
|||
|
||||
/**
|
||||
* Immediately stops the current animation from playing and dispatches the `animationcomplete` event.
|
||||
*
|
||||
*
|
||||
* If no animation is set, no event will be dispatched.
|
||||
*
|
||||
*
|
||||
* If there is another animation queued (via the `chain` method) then it will start playing immediately.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#stop
|
||||
|
@ -842,7 +842,7 @@ var Animation = new Class({
|
|||
anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject);
|
||||
|
||||
gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject);
|
||||
|
||||
|
||||
gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject);
|
||||
}
|
||||
|
||||
|
@ -1039,8 +1039,8 @@ var Animation = new Class({
|
|||
* Internal frame change handler.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Animation#updateFrame
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE_EVENT
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE
|
||||
* @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE
|
||||
* @private
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -1073,7 +1073,7 @@ var Animation = new Class({
|
|||
/**
|
||||
* Advances the animation to the next frame, regardless of the time or animation state.
|
||||
* If the animation is set to repeat, or yoyo, this will still take effect.
|
||||
*
|
||||
*
|
||||
* Calling this does not change the direction of the animation. I.e. if it was currently
|
||||
* playing in reverse, calling this method doesn't then change the direction to forwards.
|
||||
*
|
||||
|
@ -1095,7 +1095,7 @@ var Animation = new Class({
|
|||
/**
|
||||
* Advances the animation to the previous frame, regardless of the time or animation state.
|
||||
* If the animation is set to repeat, or yoyo, this will still take effect.
|
||||
*
|
||||
*
|
||||
* Calling this does not change the direction of the animation. I.e. if it was currently
|
||||
* playing in forwards, calling this method doesn't then change the direction to backwards.
|
||||
*
|
||||
|
|
|
@ -151,9 +151,9 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* If you want to append a URL before the path of any asset you can set this here.
|
||||
*
|
||||
*
|
||||
* Useful if allowing the asset base url to be configured outside of the game code.
|
||||
*
|
||||
*
|
||||
* If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you.
|
||||
*
|
||||
* @name Phaser.Loader.LoaderPlugin#baseURL
|
||||
|
@ -232,7 +232,7 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* Files are placed in this Set when they're added to the Loader via `addFile`.
|
||||
*
|
||||
*
|
||||
* They are moved to the `inflight` Set when they start loading, and assuming a successful
|
||||
* load, to the `queue` Set for further processing.
|
||||
*
|
||||
|
@ -246,9 +246,9 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* Files are stored in this Set while they're in the process of being loaded.
|
||||
*
|
||||
*
|
||||
* Upon a successful load they are moved to the `queue` Set.
|
||||
*
|
||||
*
|
||||
* By the end of the load process this Set will be empty.
|
||||
*
|
||||
* @name Phaser.Loader.LoaderPlugin#inflight
|
||||
|
@ -259,10 +259,10 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* Files are stored in this Set while they're being processed.
|
||||
*
|
||||
*
|
||||
* If the process is successful they are moved to their final destination, which could be
|
||||
* a Cache or the Texture Manager.
|
||||
*
|
||||
*
|
||||
* At the end of the load process this Set will be empty.
|
||||
*
|
||||
* @name Phaser.Loader.LoaderPlugin#queue
|
||||
|
@ -357,9 +357,9 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* If you want to append a URL before the path of any asset you can set this here.
|
||||
*
|
||||
*
|
||||
* Useful if allowing the asset base url to be configured outside of the game code.
|
||||
*
|
||||
*
|
||||
* Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any
|
||||
* file _already_ being loaded. To reset it, call this method with no arguments.
|
||||
*
|
||||
|
@ -399,7 +399,7 @@ var LoaderPlugin = new Class({
|
|||
* given as it's an absolute URL.
|
||||
*
|
||||
* Please note that the path is added before the filename but *after* the baseURL (if set.)
|
||||
*
|
||||
*
|
||||
* Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any
|
||||
* file _already_ in the load queue. To reset it, call this method with no arguments.
|
||||
*
|
||||
|
@ -426,9 +426,9 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* An optional prefix that is automatically prepended to the start of every file key.
|
||||
*
|
||||
*
|
||||
* If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`.
|
||||
*
|
||||
*
|
||||
* Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any
|
||||
* file _already_ in the load queue. To reset it, call this method with no arguments.
|
||||
*
|
||||
|
@ -450,9 +450,9 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* Sets the Cross Origin Resource Sharing value used when loading files.
|
||||
*
|
||||
*
|
||||
* Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config.
|
||||
*
|
||||
*
|
||||
* Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have
|
||||
* their own CORs setting. To reset it, call this method with no arguments.
|
||||
*
|
||||
|
@ -586,7 +586,7 @@ var LoaderPlugin = new Class({
|
|||
* @method Phaser.Loader.LoaderPlugin#addPack
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {any} data - The Pack File data to be parsed and each entry of it to added to the load queue.
|
||||
* @param {any} pack - The Pack File data to be parsed and each entry of it to added to the load queue.
|
||||
* @param {string} [packKey] - An optional key to use from the pack file data.
|
||||
*
|
||||
* @return {boolean} `true` if any files were added to the queue, otherwise `false`.
|
||||
|
@ -609,6 +609,11 @@ var LoaderPlugin = new Class({
|
|||
// Here we go ...
|
||||
for (var key in pack)
|
||||
{
|
||||
if (!Object.prototype.hasOwnProperty.call(pack, key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var config = pack[key];
|
||||
|
||||
// Any meta data to process?
|
||||
|
@ -753,10 +758,10 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* An internal method called by the Loader.
|
||||
*
|
||||
*
|
||||
* It will check to see if there are any more files in the pending list that need loading, and if so it will move
|
||||
* them from the list Set into the inflight Set, set their CORs flag and start them loading.
|
||||
*
|
||||
*
|
||||
* It will carrying on doing this for each file in the pending list until it runs out, or hits the max allowed parallel downloads.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#checkLoadQueue
|
||||
|
@ -793,7 +798,7 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* An internal method called automatically by the XHRLoader belong to a File.
|
||||
*
|
||||
*
|
||||
* This method will remove the given file from the inflight Set and update the load progress.
|
||||
* If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue.
|
||||
*
|
||||
|
@ -933,7 +938,7 @@ var LoaderPlugin = new Class({
|
|||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#flagForRemoval
|
||||
* @since 3.7.0
|
||||
*
|
||||
*
|
||||
* @param {Phaser.Loader.File} file - The File to be queued for deletion when the Loader completes.
|
||||
*/
|
||||
flagForRemoval: function (file)
|
||||
|
@ -961,7 +966,7 @@ var LoaderPlugin = new Class({
|
|||
|
||||
/**
|
||||
* Causes the browser to save the given data as a file to its default Downloads folder.
|
||||
*
|
||||
*
|
||||
* Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href
|
||||
* to be an ObjectURL based on the given data, and then invokes a click event.
|
||||
*
|
||||
|
|
|
@ -14,7 +14,7 @@ var LoaderEvents = require('../events');
|
|||
* A single Animation JSON File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation.
|
||||
*
|
||||
* @class AnimationJSONFile
|
||||
|
@ -80,7 +80,7 @@ var AnimationJSONFile = new Class({
|
|||
* Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -95,17 +95,17 @@ var AnimationJSONFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the JSON Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the JSON Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.animation({
|
||||
* key: 'baddieAnims',
|
||||
|
@ -122,9 +122,9 @@ var AnimationJSONFile = new Class({
|
|||
*
|
||||
* Once the animation data has been parsed you will be able to play animations using that data.
|
||||
* Please see the Animation Manager `fromJSON` method for more details about the format and playback.
|
||||
*
|
||||
*
|
||||
* You can also access the raw animation data from its Cache using its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.animation('baddieAnims', 'files/BaddieAnims.json');
|
||||
* // and later in your game ...
|
||||
|
@ -143,7 +143,7 @@ var AnimationJSONFile = new Class({
|
|||
*
|
||||
* You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache,
|
||||
* rather than the whole file. For example, if your JSON data had a structure like this:
|
||||
*
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "level1": {
|
||||
|
@ -163,7 +163,7 @@ var AnimationJSONFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#animation
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,9 +17,9 @@ var MultiFile = require('../MultiFile.js');
|
|||
* A single JSON based Texture Atlas File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas.
|
||||
*
|
||||
*
|
||||
* https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm
|
||||
*
|
||||
* @class AtlasJSONFile
|
||||
|
@ -112,7 +112,7 @@ var AtlasJSONFile = new Class({
|
|||
* Adds a JSON based Texture Atlas, or array of atlases, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -127,7 +127,7 @@ var AtlasJSONFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
|
@ -135,7 +135,7 @@ var AtlasJSONFile = new Class({
|
|||
* These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate.
|
||||
* If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader
|
||||
* instead of this one.
|
||||
*
|
||||
*
|
||||
* Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.
|
||||
|
@ -144,7 +144,7 @@ var AtlasJSONFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlas({
|
||||
* key: 'mainmenu',
|
||||
|
@ -158,7 +158,7 @@ var AtlasJSONFile = new Class({
|
|||
* Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.
|
||||
*
|
||||
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
|
||||
* // and later in your game ...
|
||||
|
@ -179,13 +179,13 @@ var AtlasJSONFile = new Class({
|
|||
*
|
||||
* Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,
|
||||
* then you can specify it by providing an array as the `url` where the second element is the normal map:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json');
|
||||
* ```
|
||||
*
|
||||
* Or, if you are using a config object use the `normalMap` property:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlas({
|
||||
* key: 'mainmenu',
|
||||
|
@ -202,7 +202,7 @@ var AtlasJSONFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#atlas
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var XMLFile = require('./XMLFile.js');
|
|||
* A single XML based Texture Atlas File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML.
|
||||
*
|
||||
* @class AtlasXMLFile
|
||||
|
@ -110,7 +110,7 @@ var AtlasXMLFile = new Class({
|
|||
* Adds an XML based Texture Atlas, or array of atlases, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -125,13 +125,13 @@ var AtlasXMLFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
* Phaser expects the atlas data to be provided in an XML file format.
|
||||
* These files are created by software such as Shoebox and Adobe Flash / Animate.
|
||||
*
|
||||
*
|
||||
* Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.
|
||||
|
@ -140,7 +140,7 @@ var AtlasXMLFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlasXML({
|
||||
* key: 'mainmenu',
|
||||
|
@ -152,7 +152,7 @@ var AtlasXMLFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details.
|
||||
*
|
||||
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml');
|
||||
* // and later in your game ...
|
||||
|
@ -173,13 +173,13 @@ var AtlasXMLFile = new Class({
|
|||
*
|
||||
* Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,
|
||||
* then you can specify it by providing an array as the `url` where the second element is the normal map:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml');
|
||||
* ```
|
||||
*
|
||||
* Or, if you are using a config object use the `normalMap` property:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.atlasXML({
|
||||
* key: 'mainmenu',
|
||||
|
@ -196,7 +196,7 @@ var AtlasXMLFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#atlasXML
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Audio File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio.
|
||||
*
|
||||
* @class AudioFile
|
||||
|
@ -168,7 +168,7 @@ AudioFile.getAudioURL = function (game, urls)
|
|||
* Adds an Audio or HTML5Audio file, or array of audio files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -183,14 +183,14 @@ AudioFile.getAudioURL = function (game, urls)
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Audio Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Audio Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.audio({
|
||||
* key: 'title',
|
||||
|
@ -212,7 +212,7 @@ AudioFile.getAudioURL = function (game, urls)
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#audio
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var MultiFile = require('../MultiFile.js');
|
|||
* An Audio Sprite File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite.
|
||||
*
|
||||
* @class AudioSpriteFile
|
||||
|
@ -60,7 +60,7 @@ var AudioSpriteFile = new Class({
|
|||
if (!audioURL)
|
||||
{
|
||||
data = new JSONFile(loader, key, jsonURL, jsonXhrSettings);
|
||||
|
||||
|
||||
MultiFile.call(this, loader, 'audiosprite', key, [ data ]);
|
||||
|
||||
this.config.resourceLoad = true;
|
||||
|
@ -144,7 +144,7 @@ var AudioSpriteFile = new Class({
|
|||
* Adds a JSON based Audio Sprite, or array of audio sprites, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -155,13 +155,13 @@ var AudioSpriteFile = new Class({
|
|||
* ]);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Audio Sprites are a combination of audio files and a JSON configuration.
|
||||
* The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite
|
||||
*
|
||||
* If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio
|
||||
* files automatically based on its content. To do this exclude the audio URLs from the load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -176,7 +176,7 @@ var AudioSpriteFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
|
@ -186,7 +186,7 @@ var AudioSpriteFile = new Class({
|
|||
* then remove it from the Audio Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.audioSprite({
|
||||
* key: 'kyobi',
|
||||
|
@ -204,7 +204,7 @@ var AudioSpriteFile = new Class({
|
|||
* Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead.
|
||||
*
|
||||
* Once the audio has finished loading you can use it create an Audio Sprite by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.audioSprite('kyobi', 'kyobi.json');
|
||||
* // and later in your game ...
|
||||
|
@ -223,12 +223,12 @@ var AudioSpriteFile = new Class({
|
|||
* browser support.
|
||||
*
|
||||
* If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded.
|
||||
*
|
||||
*
|
||||
* Note: The ability to load this type of file will only be available if the Audio Sprite File type has been built into Phaser.
|
||||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#audioSprite
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[])} key - The key to use for this file, or a file configuration object, or an array of objects.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Binary File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary.
|
||||
*
|
||||
* @class BinaryFile
|
||||
|
@ -90,7 +90,7 @@ var BinaryFile = new Class({
|
|||
* Adds a Binary file, or array of Binary files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -105,14 +105,14 @@ var BinaryFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Binary Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Binary Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Binary Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.binary({
|
||||
* key: 'doom',
|
||||
|
@ -124,7 +124,7 @@ var BinaryFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details.
|
||||
*
|
||||
* Once the file has finished loading you can access it from its Cache using its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.binary('doom', 'files/Doom.wad');
|
||||
* // and later in your game ...
|
||||
|
@ -145,7 +145,7 @@ var BinaryFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#binary
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig|Phaser.Types.Loader.FileTypes.BinaryFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -18,7 +18,7 @@ var XMLFile = require('./XMLFile.js');
|
|||
* A single Bitmap Font based File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont.
|
||||
*
|
||||
* @class BitmapFontFile
|
||||
|
@ -126,14 +126,14 @@ var BitmapFontFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
* Phaser expects the font data to be provided in an XML file format.
|
||||
* These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/),
|
||||
* [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner)
|
||||
*
|
||||
*
|
||||
* Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.
|
||||
|
@ -142,7 +142,7 @@ var BitmapFontFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.bitmapFont({
|
||||
* key: 'goldenFont',
|
||||
|
@ -154,7 +154,7 @@ var BitmapFontFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details.
|
||||
*
|
||||
* Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml');
|
||||
* // and later in your game ...
|
||||
|
@ -173,13 +173,13 @@ var BitmapFontFile = new Class({
|
|||
*
|
||||
* Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,
|
||||
* then you can specify it by providing an array as the `url` where the second element is the normal map:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml');
|
||||
* ```
|
||||
*
|
||||
* Or, if you are using a config object use the `normalMap` property:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.bitmapFont({
|
||||
* key: 'goldenFont',
|
||||
|
@ -196,7 +196,7 @@ var BitmapFontFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#bitmapFont
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single CSS File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css.
|
||||
*
|
||||
* @class CSSFile
|
||||
|
@ -89,7 +89,7 @@ var CSSFile = new Class({
|
|||
* Adds a CSS file, or array of CSS files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -104,11 +104,11 @@ var CSSFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String and not already in-use by another file in the Loader.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.css({
|
||||
* key: 'headers',
|
||||
|
@ -132,7 +132,7 @@ var CSSFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#css
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.17.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig|Phaser.Types.Loader.FileTypes.CSSFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var Shader = require('../../display/shader/BaseShader');
|
|||
* A single GLSL File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl.
|
||||
*
|
||||
* @class GLSLFile
|
||||
|
@ -159,9 +159,9 @@ var GLSLFile = new Class({
|
|||
*
|
||||
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderName
|
||||
* @since 3.17.0
|
||||
*
|
||||
*
|
||||
* @param {string[]} headerSource - The header data.
|
||||
*
|
||||
*
|
||||
* @return {string} The shader name.
|
||||
*/
|
||||
getShaderName: function (headerSource)
|
||||
|
@ -184,9 +184,9 @@ var GLSLFile = new Class({
|
|||
*
|
||||
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderType
|
||||
* @since 3.17.0
|
||||
*
|
||||
*
|
||||
* @param {string[]} headerSource - The header data.
|
||||
*
|
||||
*
|
||||
* @return {string} The shader type. Either 'fragment' or 'vertex'.
|
||||
*/
|
||||
getShaderType: function (headerSource)
|
||||
|
@ -209,9 +209,9 @@ var GLSLFile = new Class({
|
|||
*
|
||||
* @method Phaser.Loader.FileTypes.GLSLFile#getShaderUniforms
|
||||
* @since 3.17.0
|
||||
*
|
||||
*
|
||||
* @param {string[]} headerSource - The header data.
|
||||
*
|
||||
*
|
||||
* @return {any} The shader uniforms object.
|
||||
*/
|
||||
getShaderUniforms: function (headerSource)
|
||||
|
@ -251,10 +251,10 @@ var GLSLFile = new Class({
|
|||
* @method Phaser.Loader.FileTypes.GLSLFile#extractBlock
|
||||
* @private
|
||||
* @since 3.17.0
|
||||
*
|
||||
*
|
||||
* @param {string[]} data - The array of shader data to process.
|
||||
* @param {integer} offset - The offset to start processing from.
|
||||
*
|
||||
*
|
||||
* @return {any} The processed shader block, or null.
|
||||
*/
|
||||
extractBlock: function (data, offset)
|
||||
|
@ -319,7 +319,7 @@ var GLSLFile = new Class({
|
|||
* In Phaser 3 GLSL files are just plain Text files at the current moment in time.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -334,14 +334,14 @@ var GLSLFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Shader Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Shader Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Shader Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.glsl({
|
||||
* key: 'plasma',
|
||||
|
@ -353,7 +353,7 @@ var GLSLFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details.
|
||||
*
|
||||
* Once the file has finished loading you can access it from its Cache using its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.glsl('plasma', 'shaders/Plasma.glsl');
|
||||
* // and later in your game ...
|
||||
|
@ -374,7 +374,7 @@ var GLSLFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#glsl
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig|Phaser.Types.Loader.FileTypes.GLSLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -139,7 +139,7 @@ var HTMLFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#html
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig|Phaser.Types.Loader.FileTypes.HTMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single HTML File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture.
|
||||
*
|
||||
* @class HTMLTextureFile
|
||||
|
@ -155,7 +155,7 @@ var HTMLTextureFile = new Class({
|
|||
* will be rendered to textures and stored in the Texture Manager.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -177,7 +177,7 @@ var HTMLTextureFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.htmlTexture({
|
||||
* key: 'instructions',
|
||||
|
@ -190,7 +190,7 @@ var HTMLTextureFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` for more details.
|
||||
*
|
||||
* Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.htmlTexture('instructions', 'content/intro.html', 256, 512);
|
||||
* // and later in your game ...
|
||||
|
@ -220,7 +220,7 @@ var HTMLTextureFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#htmlTexture
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.12.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Image File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.
|
||||
*
|
||||
* @class ImageFile
|
||||
|
@ -160,7 +160,7 @@ var ImageFile = new Class({
|
|||
* Adds an Image, or array of Images, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -175,7 +175,7 @@ var ImageFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.
|
||||
* If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback
|
||||
* of animated gifs to Canvas elements.
|
||||
|
@ -186,7 +186,7 @@ var ImageFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.image({
|
||||
* key: 'logo',
|
||||
|
@ -197,7 +197,7 @@ var ImageFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.
|
||||
*
|
||||
* Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.image('logo', 'images/AtariLogo.png');
|
||||
* // and later in your game ...
|
||||
|
@ -216,13 +216,13 @@ var ImageFile = new Class({
|
|||
*
|
||||
* Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,
|
||||
* then you can specify it by providing an array as the `url` where the second element is the normal map:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);
|
||||
* ```
|
||||
*
|
||||
* Or, if you are using a config object use the `normalMap` property:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.image({
|
||||
* key: 'logo',
|
||||
|
@ -238,7 +238,7 @@ var ImageFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#image
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single JSON File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.
|
||||
*
|
||||
* @class JSONFile
|
||||
|
@ -121,7 +121,7 @@ var JSONFile = new Class({
|
|||
* Adds a JSON file, or array of JSON files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -136,14 +136,14 @@ var JSONFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the JSON Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the JSON Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.json({
|
||||
* key: 'wavedata',
|
||||
|
@ -154,7 +154,7 @@ var JSONFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.
|
||||
*
|
||||
* Once the file has finished loading you can access it from its Cache using its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.json('wavedata', 'files/AlienWaveData.json');
|
||||
* // and later in your game ...
|
||||
|
@ -173,7 +173,7 @@ var JSONFile = new Class({
|
|||
*
|
||||
* You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache,
|
||||
* rather than the whole file. For example, if your JSON data had a structure like this:
|
||||
*
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "level1": {
|
||||
|
@ -193,7 +193,7 @@ var JSONFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#json
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var MultiFile = require('../MultiFile.js');
|
|||
* A single Multi Texture Atlas File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas.
|
||||
*
|
||||
* @class MultiAtlasFile
|
||||
|
@ -183,7 +183,7 @@ var MultiAtlasFile = new Class({
|
|||
if (item.image === key)
|
||||
{
|
||||
images.push(image);
|
||||
|
||||
|
||||
data.push(item);
|
||||
|
||||
if (file.linkFile)
|
||||
|
@ -218,7 +218,7 @@ var MultiAtlasFile = new Class({
|
|||
* Adds a Multi Texture Atlas, or array of multi atlases, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -233,7 +233,7 @@ var MultiAtlasFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
|
@ -243,14 +243,14 @@ var MultiAtlasFile = new Class({
|
|||
* The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and
|
||||
* extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps,
|
||||
* Phaser will load those as well.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Texture Manager.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.multiatlas({
|
||||
* key: 'level1',
|
||||
|
@ -263,7 +263,7 @@ var MultiAtlasFile = new Class({
|
|||
* Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead.
|
||||
*
|
||||
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.multiatlas('level1', 'images/Level1.json');
|
||||
* // and later in your game ...
|
||||
|
@ -286,7 +286,7 @@ var MultiAtlasFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#multiatlas
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var ScriptFile = require('./ScriptFile.js');
|
|||
* A Multi Script File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts.
|
||||
*
|
||||
* @class MultiScriptFile
|
||||
|
@ -96,7 +96,7 @@ var MultiScriptFile = new Class({
|
|||
file.data.type = 'text/javascript';
|
||||
file.data.defer = false;
|
||||
file.data.text = file.xhrLoader.responseText;
|
||||
|
||||
|
||||
document.head.appendChild(file.data);
|
||||
}
|
||||
|
||||
|
@ -108,13 +108,13 @@ var MultiScriptFile = new Class({
|
|||
|
||||
/**
|
||||
* Adds an array of Script files to the current load queue.
|
||||
*
|
||||
*
|
||||
* The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method,
|
||||
* and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that
|
||||
* may have dependencies on each other without worrying about the async nature of traditional script loading.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -128,7 +128,7 @@ var MultiScriptFile = new Class({
|
|||
* ]);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact
|
||||
* order given in the array.
|
||||
*
|
||||
|
@ -139,11 +139,11 @@ var MultiScriptFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String and not already in-use by another file in the Loader.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.scripts({
|
||||
* key: 'PostProcess',
|
||||
|
@ -171,7 +171,7 @@ var MultiScriptFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#scripts
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.17.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -14,7 +14,7 @@ var JSONFile = require('./JSONFile.js');
|
|||
* A single JSON Pack File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack.
|
||||
*
|
||||
* @class PackFile
|
||||
|
@ -73,7 +73,7 @@ var PackFile = new Class({
|
|||
* Adds a JSON File Pack, or array of packs, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -85,7 +85,7 @@ var PackFile = new Class({
|
|||
* Here is a small example:
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* {
|
||||
* "test1": {
|
||||
* "files": [
|
||||
* {
|
||||
|
@ -126,17 +126,17 @@ var PackFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the JSON Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the JSON Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.pack({
|
||||
* key: 'level1',
|
||||
|
@ -158,7 +158,7 @@ var PackFile = new Class({
|
|||
*
|
||||
* You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache,
|
||||
* rather than the whole file. For example, if your JSON data had a structure like this:
|
||||
*
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "level1": {
|
||||
|
@ -178,7 +178,7 @@ var PackFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#pack
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig|Phaser.Types.Loader.FileTypes.PackFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Plugin Script File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin.
|
||||
*
|
||||
* @class PluginFile
|
||||
|
@ -130,7 +130,7 @@ var PluginFile = new Class({
|
|||
* Adds a Plugin Script file, or array of plugin files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -145,11 +145,11 @@ var PluginFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String and not already in-use by another file in the Loader.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.plugin({
|
||||
* key: 'modplayer',
|
||||
|
@ -174,7 +174,7 @@ var PluginFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#plugin
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig|Phaser.Types.Loader.FileTypes.PluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -248,21 +248,21 @@ var SVGFile = new Class({
|
|||
* If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien"
|
||||
* and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although
|
||||
* this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.
|
||||
*
|
||||
*
|
||||
* You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture
|
||||
* at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down
|
||||
* or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize
|
||||
* the SVG to:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
* this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 });
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Or when using a configuration object:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.svg({
|
||||
* key: 'morty',
|
||||
|
@ -273,18 +273,18 @@ var SVGFile = new Class({
|
|||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Alternatively, you can just provide a scale factor instead:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
* this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 });
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Or when using a configuration object:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.svg({
|
||||
* key: 'morty',
|
||||
|
@ -294,14 +294,14 @@ var SVGFile = new Class({
|
|||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If scale, width and height values are all given, the scale has priority and the width and height values are ignored.
|
||||
*
|
||||
* Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser.
|
||||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#svg
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig|Phaser.Types.Loader.FileTypes.SVGFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -120,34 +120,34 @@ var SceneFile = new Class({
|
|||
* loaded.
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load.
|
||||
*
|
||||
*
|
||||
* For a Scene File it's vitally important that the key matches the class name in the JavaScript file.
|
||||
*
|
||||
*
|
||||
* For example here is the source file:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* class ExternalScene extends Phaser.Scene {
|
||||
*
|
||||
*
|
||||
* constructor ()
|
||||
* {
|
||||
* super('myScene');
|
||||
* }
|
||||
*
|
||||
*
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Because the class is called `ExternalScene` that is the exact same key you must use when loading it:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
* this.load.sceneFile('ExternalScene', 'src/yourScene.js');
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene
|
||||
* constructor, as we've done in the example above, where the Scene key was changed to `myScene`.
|
||||
*
|
||||
*
|
||||
* The key should be unique both in terms of files being loaded and Scenes already present in the Scene Manager.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Scene Manager first, before loading a new one.
|
||||
|
@ -185,7 +185,7 @@ var SceneFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#sceneFile
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig|Phaser.Types.Loader.FileTypes.SceneFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Scene Plugin Script File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin.
|
||||
*
|
||||
* @class ScenePluginFile
|
||||
|
@ -124,7 +124,7 @@ var ScenePluginFile = new Class({
|
|||
* Adds a Scene Plugin Script file, or array of plugin files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -139,11 +139,11 @@ var ScenePluginFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String and not already in-use by another file in the Loader.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.scenePlugin({
|
||||
* key: 'modplayer',
|
||||
|
@ -168,7 +168,7 @@ var ScenePluginFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#scenePlugin
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.8.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -16,7 +16,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Script File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script.
|
||||
*
|
||||
* @class ScriptFile
|
||||
|
@ -91,7 +91,7 @@ var ScriptFile = new Class({
|
|||
* Adds a Script file, or array of Script files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -106,11 +106,11 @@ var ScriptFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String and not already in-use by another file in the Loader.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.script({
|
||||
* key: 'aliens',
|
||||
|
@ -135,7 +135,7 @@ var ScriptFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#script
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -154,7 +154,7 @@ var SpriteSheetFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#spritesheet
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -139,7 +139,7 @@ var TextFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#text
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -159,7 +159,7 @@ var TilemapCSVFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#tilemapCSV
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -120,7 +120,7 @@ var TilemapImpactFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#tilemapImpact
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -120,7 +120,7 @@ var TilemapJSONFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#tilemapTiledJSON
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var TextFile = require('./TextFile.js');
|
|||
* A single text file based Unity Texture Atlas File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas.
|
||||
*
|
||||
* @class UnityAtlasFile
|
||||
|
@ -110,7 +110,7 @@ var UnityAtlasFile = new Class({
|
|||
* Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -125,12 +125,12 @@ var UnityAtlasFile = new Class({
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring
|
||||
* its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.
|
||||
*
|
||||
* Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity.
|
||||
*
|
||||
*
|
||||
* Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.
|
||||
|
@ -139,7 +139,7 @@ var UnityAtlasFile = new Class({
|
|||
* then remove it from the Texture Manager first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.unityAtlas({
|
||||
* key: 'mainmenu',
|
||||
|
@ -151,7 +151,7 @@ var UnityAtlasFile = new Class({
|
|||
* See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details.
|
||||
*
|
||||
* Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
|
||||
* // and later in your game ...
|
||||
|
@ -172,13 +172,13 @@ var UnityAtlasFile = new Class({
|
|||
*
|
||||
* Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,
|
||||
* then you can specify it by providing an array as the `url` where the second element is the normal map:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt');
|
||||
* ```
|
||||
*
|
||||
* Or, if you are using a config object use the `normalMap` property:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.unityAtlas({
|
||||
* key: 'mainmenu',
|
||||
|
@ -195,7 +195,7 @@ var UnityAtlasFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#unityAtlas
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -17,7 +17,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
|
|||
* A single Video File suitable for loading by the Loader.
|
||||
*
|
||||
* These are created when you use the Phaser.Loader.LoaderPlugin#video method and are not typically created directly.
|
||||
*
|
||||
*
|
||||
* For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#video.
|
||||
*
|
||||
* @class VideoFile
|
||||
|
@ -122,13 +122,13 @@ var VideoFile = new Class({
|
|||
* @method Phaser.Loader.FileTypes.VideoFile#createVideoElement
|
||||
* @private
|
||||
* @since 3.20.0
|
||||
*
|
||||
*
|
||||
* @return {HTMLVideoElement} The newly created Video element.
|
||||
*/
|
||||
createVideoElement: function ()
|
||||
{
|
||||
var video = document.createElement('video');
|
||||
|
||||
|
||||
video.controls = false;
|
||||
video.crossOrigin = this.loader.crossOrigin;
|
||||
|
||||
|
@ -293,7 +293,7 @@ VideoFile.getVideoURL = function (game, urls)
|
|||
* Adds a Video file, or array of video files, to the current load queue.
|
||||
*
|
||||
* You can call this method from within your Scene's `preload`, along with any other files you wish to load:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* function preload ()
|
||||
* {
|
||||
|
@ -308,14 +308,14 @@ VideoFile.getVideoURL = function (game, urls)
|
|||
* The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the
|
||||
* Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been
|
||||
* loaded.
|
||||
*
|
||||
*
|
||||
* The key must be a unique String. It is used to add the file to the global Video Cache upon a successful load.
|
||||
* The key should be unique both in terms of files being loaded and files already present in the Video Cache.
|
||||
* Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file
|
||||
* then remove it from the Video Cache first, before loading a new one.
|
||||
*
|
||||
* Instead of passing arguments you can pass a configuration object, such as:
|
||||
*
|
||||
*
|
||||
* ```javascript
|
||||
* this.load.video({
|
||||
* key: 'intro',
|
||||
|
@ -332,7 +332,7 @@ VideoFile.getVideoURL = function (game, urls)
|
|||
* Due to different browsers supporting different video file types you should usually provide your video files in a variety of formats.
|
||||
* mp4, mov and webm are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on
|
||||
* browser support, starting with the first in the array and progressing to the end.
|
||||
*
|
||||
*
|
||||
* Unlike most asset-types, videos do not _need_ to be preloaded. You can create a Video Game Object and then call its `loadURL` method,
|
||||
* to load a video at run-time, rather than in advance.
|
||||
*
|
||||
|
@ -340,7 +340,7 @@ VideoFile.getVideoURL = function (game, urls)
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#video
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.20.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.VideoFileConfig|Phaser.Types.Loader.FileTypes.VideoFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -149,7 +149,7 @@ var XMLFile = new Class({
|
|||
* It is available in the default build but can be excluded from custom builds.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#xml
|
||||
* @fires Phaser.Loader.LoaderPlugin#addFileEvent
|
||||
* @fires Phaser.Loader.LoaderPlugin#ADD
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|Phaser.Types.Loader.FileTypes.XMLFileConfig|Phaser.Types.Loader.FileTypes.XMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
|
||||
|
|
|
@ -164,7 +164,7 @@ var Body = new Class({
|
|||
|
||||
/**
|
||||
* The position of this Body during the previous frame.
|
||||
*
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Body#prevFrame
|
||||
* @type {Phaser.Math.Vector2}
|
||||
* @since 3.20.0
|
||||
|
@ -394,10 +394,10 @@ var Body = new Class({
|
|||
|
||||
/**
|
||||
* The rectangle used for world boundary collisions.
|
||||
*
|
||||
*
|
||||
* By default it is set to the world boundary rectangle. Or, if this Body was
|
||||
* created by a Physics Group, then whatever rectangle that Group defined.
|
||||
*
|
||||
*
|
||||
* You can also change it by using the `Body.setBoundsRectangle` method.
|
||||
*
|
||||
* @name Phaser.Physics.Arcade.Body#customBoundsRectangle
|
||||
|
@ -415,7 +415,7 @@ var Body = new Class({
|
|||
* @type {boolean}
|
||||
* @default false
|
||||
* @since 3.0.0
|
||||
* @see Phaser.Physics.Arcade.World#worldboundsEvent
|
||||
* @see Phaser.Physics.Arcade.World#WORLD_BOUNDS
|
||||
*/
|
||||
this.onWorldBounds = false;
|
||||
|
||||
|
@ -426,7 +426,7 @@ var Body = new Class({
|
|||
* @type {boolean}
|
||||
* @default false
|
||||
* @since 3.0.0
|
||||
* @see Phaser.Physics.Arcade.World#collideEvent
|
||||
* @see Phaser.Physics.Arcade.World#COLLIDE
|
||||
*/
|
||||
this.onCollide = false;
|
||||
|
||||
|
@ -437,7 +437,7 @@ var Body = new Class({
|
|||
* @type {boolean}
|
||||
* @default false
|
||||
* @since 3.0.0
|
||||
* @see Phaser.Physics.Arcade.World#overlapEvent
|
||||
* @see Phaser.Physics.Arcade.World#OVERLAP
|
||||
*/
|
||||
this.onOverlap = false;
|
||||
|
||||
|
@ -1109,7 +1109,7 @@ var Body = new Class({
|
|||
* @since 3.20
|
||||
*
|
||||
* @param {?Phaser.Geom.Rectangle} [bounds] - The new boundary rectangle. Pass `null` to use the World bounds.
|
||||
*
|
||||
*
|
||||
* @return {this} This Body object.
|
||||
*/
|
||||
setBoundsRectangle: function (bounds)
|
||||
|
@ -1472,7 +1472,7 @@ var Body = new Class({
|
|||
/**
|
||||
* The change in this Body's horizontal position from the previous step.
|
||||
* This value is set during the Body's update phase.
|
||||
*
|
||||
*
|
||||
* As a Body can update multiple times per step this may not hold the final
|
||||
* delta value for the Body. In this case, please see the `deltaXFinal` method.
|
||||
*
|
||||
|
@ -1489,7 +1489,7 @@ var Body = new Class({
|
|||
/**
|
||||
* The change in this Body's vertical position from the previous step.
|
||||
* This value is set during the Body's update phase.
|
||||
*
|
||||
*
|
||||
* As a Body can update multiple times per step this may not hold the final
|
||||
* delta value for the Body. In this case, please see the `deltaYFinal` method.
|
||||
*
|
||||
|
@ -1505,10 +1505,10 @@ var Body = new Class({
|
|||
|
||||
/**
|
||||
* The change in this Body's horizontal position from the previous game update.
|
||||
*
|
||||
*
|
||||
* This value is set during the `postUpdate` phase and takes into account the
|
||||
* `deltaMax` and final position of the Body.
|
||||
*
|
||||
*
|
||||
* Because this value is not calculated until `postUpdate`, you must listen for it
|
||||
* during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will
|
||||
* not be calculated by that point. If you _do_ use these values in `update` they
|
||||
|
@ -1526,10 +1526,10 @@ var Body = new Class({
|
|||
|
||||
/**
|
||||
* The change in this Body's vertical position from the previous game update.
|
||||
*
|
||||
*
|
||||
* This value is set during the `postUpdate` phase and takes into account the
|
||||
* `deltaMax` and final position of the Body.
|
||||
*
|
||||
*
|
||||
* Because this value is not calculated until `postUpdate`, you must listen for it
|
||||
* during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will
|
||||
* not be calculated by that point. If you _do_ use these values in `update` they
|
||||
|
|
|
@ -114,7 +114,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the global Animations Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.anims` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#anims
|
||||
|
@ -126,7 +126,7 @@ var Systems = new Class({
|
|||
/**
|
||||
* A reference to the global Cache. The Cache stores all files bought in to Phaser via
|
||||
* the Loader, with the exception of images. Images are stored in the Texture Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.cache` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#cache
|
||||
|
@ -137,7 +137,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the global Plugins Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.plugins` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#plugins
|
||||
|
@ -149,7 +149,7 @@ var Systems = new Class({
|
|||
/**
|
||||
* A reference to the global registry. This is a game-wide instance of the Data Manager, allowing
|
||||
* you to exchange data between Scenes via a universal and shared point.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.registry` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#registry
|
||||
|
@ -160,7 +160,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the global Scale Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.scale` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#scale
|
||||
|
@ -171,7 +171,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the global Sound Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.sound` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#sound
|
||||
|
@ -182,7 +182,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the global Texture Manager.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.textures` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#textures
|
||||
|
@ -195,9 +195,9 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Game Object Factory.
|
||||
*
|
||||
*
|
||||
* Use this to quickly and easily create new Game Object's.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.add` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#add
|
||||
|
@ -208,9 +208,9 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Camera Manager.
|
||||
*
|
||||
*
|
||||
* Use this to manipulate and create Cameras for this specific Scene.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.cameras` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#cameras
|
||||
|
@ -221,9 +221,9 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Display List.
|
||||
*
|
||||
*
|
||||
* Use this to organize the children contained in the display list.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.children` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#displayList
|
||||
|
@ -234,9 +234,9 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Event Manager.
|
||||
*
|
||||
*
|
||||
* Use this to listen for Scene specific events, such as `pause` and `shutdown`.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.events` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#events
|
||||
|
@ -247,11 +247,11 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Game Object Creator.
|
||||
*
|
||||
*
|
||||
* Use this to quickly and easily create new Game Object's. The difference between this and the
|
||||
* Game Object Factory, is that the Creator just creates and returns Game Object instances, it
|
||||
* doesn't then add them to the Display List or Update List.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.make` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#make
|
||||
|
@ -262,10 +262,10 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene Manager Plugin.
|
||||
*
|
||||
*
|
||||
* Use this to manipulate both this and other Scene's in your game, for example to launch a parallel Scene,
|
||||
* or pause or resume a Scene, or switch from this Scene to another.
|
||||
*
|
||||
*
|
||||
* In the default set-up you can access this from within a Scene via the `this.scene` property.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#scenePlugin
|
||||
|
@ -276,12 +276,12 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* A reference to the Scene's Update List.
|
||||
*
|
||||
*
|
||||
* Use this to organize the children contained in the update list.
|
||||
*
|
||||
*
|
||||
* The Update List is responsible for managing children that need their `preUpdate` methods called,
|
||||
* in order to process so internal components, such as Sprites with Animations.
|
||||
*
|
||||
*
|
||||
* In the default set-up there is no reference to this from within the Scene itself.
|
||||
*
|
||||
* @name Phaser.Scenes.Systems#updateList
|
||||
|
@ -365,7 +365,7 @@ var Systems = new Class({
|
|||
*
|
||||
* @method Phaser.Scenes.Systems#step
|
||||
* @fires Phaser.Scenes.Events#PRE_UPDATE
|
||||
* @fires Phaser.Scenes.Events#_UPDATE
|
||||
* @fires Phaser.Scenes.Events#UPDATE
|
||||
* @fires Phaser.Scenes.Events#POST_UPDATE
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -433,7 +433,7 @@ var Systems = new Class({
|
|||
* @method Phaser.Scenes.Systems#pause
|
||||
* @fires Phaser.Scenes.Events#PAUSE
|
||||
* @since 3.0.0
|
||||
*
|
||||
*
|
||||
* @param {object} [data] - A data object that will be passed in the 'pause' event.
|
||||
*
|
||||
* @return {Phaser.Scenes.Systems} This Systems object.
|
||||
|
@ -488,7 +488,7 @@ var Systems = new Class({
|
|||
* @method Phaser.Scenes.Systems#sleep
|
||||
* @fires Phaser.Scenes.Events#SLEEP
|
||||
* @since 3.0.0
|
||||
*
|
||||
*
|
||||
* @param {object} [data] - A data object that will be passed in the 'sleep' event.
|
||||
*
|
||||
* @return {Phaser.Scenes.Systems} This Systems object.
|
||||
|
@ -537,14 +537,14 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* Returns any data that was sent to this Scene by another Scene.
|
||||
*
|
||||
*
|
||||
* The data is also passed to `Scene.init` and in various Scene events, but
|
||||
* you can access it at any point via this method.
|
||||
*
|
||||
* @method Phaser.Scenes.Systems#getData
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @return {any}
|
||||
* @return {any}
|
||||
*/
|
||||
getData: function ()
|
||||
{
|
||||
|
@ -662,7 +662,7 @@ var Systems = new Class({
|
|||
|
||||
/**
|
||||
* Set the active state of this Scene.
|
||||
*
|
||||
*
|
||||
* An active Scene will run its core update loop.
|
||||
*
|
||||
* @method Phaser.Scenes.Systems#setActive
|
||||
|
@ -725,7 +725,7 @@ var Systems = new Class({
|
|||
* @method Phaser.Scenes.Systems#shutdown
|
||||
* @fires Phaser.Scenes.Events#SHUTDOWN
|
||||
* @since 3.0.0
|
||||
*
|
||||
*
|
||||
* @param {object} [data] - A data object that will be passed in the 'shutdown' event.
|
||||
*/
|
||||
shutdown: function (data)
|
||||
|
|
Loading…
Reference in a new issue