Files
JiboOs/docs/rendering/tasks/TextureTask.js
2026-03-16 13:53:01 +02:00

48 lines
1.8 KiB
JavaScript

/**
* Loads an image and sets it up for Pixi to use as a PIXI.Texture.
* @class TextureTask
* @memberof jibo.loader
* @private
* @param {String} asset.type Must be "texture" to signify that this asset should be parsed
* specifically for Pixi.js.
* @param {String} [asset.src] The texture image path.
* @param {Boolean} [asset.upload=false] `true` to upload the GPU immediate after loading.
* @param {Boolean} [asset.remote=false] `true` to force a remote download over XMLHttpRequest.
* @param {Number} [asset.timeout=0] Number of milliseconds for remote load to timeout.
* @param {Boolean|String} [asset.cache=false] `true` to cache the result. String to add to a specific cache.
* @param {String} [asset.alpha] The alpha image path, if not using image property.
* @param {String} [asset.id] The ID of the task.
* @param {Function} [asset.complete] The callback to call when the load is completed.
*/
/**
* Tests if an asset should be loaded.
* @method jibo.loader.TextureTask.test
* @static
* @param {Object} asset The asset to test.
* @return {Boolean} `true` if the asset qualifies for this task.
*/
/**
* The atlas source path.
* @name jibo.loader.TextureTask#src
* @type {String}
*/
/**
* The atlas alpha source path.
* @name jibo.loader.TextureTask#alpha
* @type {String}
*/
/**
* `true` if the texture should be uploaded to the GPU immediately.
* @name jibo.loader.TextureTask#upload
* @type {Boolean}
*/
/**
* Starts the load.
* @method jibo.loader.TextureTask#start
* @param {jibo.loader.Task~completeCallback} callback Callback to call when the load is done
*/