Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* If set to `true`, Textures and BaseTexture objects stored
* in the caches ({@link PIXI.utils.TextureCache TextureCache} and
* {@link PIXI.utils.BaseTextureCache BaseTextureCache}) can *only* be
* used when calling {@link PIXI.Texture.from Texture.from} or
* {@link PIXI.BaseTexture.from BaseTexture.from}.
* Otherwise, these `from` calls throw an exception. Using this property
* can be useful if you want to enforce preloading all assets with
* {@link PIXI.Loader Loader}.
*
* @static
* @name STRICT_TEXTURE_CACHE
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
settings.STRICT_TEXTURE_CACHE = false;
export { settings };
static from(source, options, strict = settings.STRICT_TEXTURE_CACHE)
{
const isFrame = typeof source === 'string';
let cacheId = null;
if (isFrame)
{
cacheId = source;
}
else
{
if (!source._pixiId)
{
source._pixiId = `pixiid_${uid()}`;
}
cacheId = source._pixiId;
static from(source, options = {}, strict = settings.STRICT_TEXTURE_CACHE)
{
const isFrame = typeof source === 'string';
let cacheId = null;
if (isFrame)
{
cacheId = source;
}
else
{
if (!source._pixiId)
{
source._pixiId = `pixiid_${uid()}`;
}
cacheId = source._pixiId;