Socket
Socket
Sign inDemoInstall

@pixi/settings

Package Overview
Dependencies
2
Maintainers
2
Versions
118
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.1.0-alpha to 7.1.0

6

global.d.ts

@@ -8,2 +8,8 @@ declare namespace GlobalMixins

}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Settings
{
}
}

8

lib/adapter.d.ts
/// <reference types="css-font-loading-module" />
import type { ICanvas } from './ICanvas';
import type { ICanvasRenderingContext2D } from './ICanvasRenderingContext2D';
/**

@@ -12,3 +13,7 @@ * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.

createCanvas: (width?: number, height?: number) => ICanvas;
/** Returns a webgl rendering context. */
/** Returns a 2D rendering context. */
getCanvasRenderingContext2D: () => {
prototype: ICanvasRenderingContext2D;
};
/** Returns a WebGL rendering context. */
getWebGLRenderingContext: () => typeof WebGLRenderingContext;

@@ -23,3 +28,4 @@ /** Returns a partial implementation of the browsers window.navigator */

fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;
parseXML: (xml: string) => Document;
}
export declare const BrowserAdapter: IAdapter;

@@ -12,2 +12,3 @@ 'use strict';

},
getCanvasRenderingContext2D: () => CanvasRenderingContext2D,
getWebGLRenderingContext: () => WebGLRenderingContext,

@@ -17,3 +18,7 @@ getNavigator: () => navigator,

getFontFaceSet: () => document.fonts,
fetch: (url, options) => fetch(url, options)
fetch: (url, options) => fetch(url, options),
parseXML: (xml) => {
const parser = new DOMParser();
return parser.parseFromString(xml, "text/xml");
}
};

@@ -20,0 +25,0 @@

@@ -11,2 +11,4 @@ import type { ICanvas } from './ICanvas';

drawImage(image: CanvasImageSource | ICanvas, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
letterSpacing?: string;
textLetterSpacing?: string;
}

4

lib/index.d.ts
/// <reference path="../global.d.ts" />
export * from './settings';
export * from './utils/isMobile';
export * from './adapter';
export * from './ICanvas';
export * from './ICanvasRenderingContext2D';
export * from './settings';
export * from './utils/isMobile';

@@ -5,13 +5,13 @@ 'use strict';

var settings = require('./settings.js');
var isMobile = require('./utils/isMobile.js');
var adapter = require('./adapter.js');
require('./ICanvas.js');
require('./ICanvasRenderingContext2D.js');
var settings = require('./settings.js');
var isMobile = require('./utils/isMobile.js');
exports.BrowserAdapter = adapter.BrowserAdapter;
exports.settings = settings.settings;
exports.isMobile = isMobile.isMobile;
exports.BrowserAdapter = adapter.BrowserAdapter;
//# sourceMappingURL=index.js.map

@@ -1,5 +0,3 @@

import { GC_MODES, MIPMAP_MODES, MSAA_QUALITY, PRECISION, SCALE_MODES, WRAP_MODES } from '@pixi/constants';
import type { ENV } from '@pixi/constants';
import type { IAdapter } from './adapter';
import type { ICanvas } from './ICanvas';
import type { IAdapter } from './adapter';
export interface IRenderOptions {

@@ -12,3 +10,5 @@ view: ICanvas;

backgroundAlpha: number;
useContextAlpha: boolean | 'notMultiplied';
premultipliedAlpha: boolean;
/** @deprecated */
useContextAlpha?: boolean | 'notMultiplied';
clearBeforeRender: boolean;

@@ -21,30 +21,8 @@ preserveDrawingBuffer: boolean;

}
export interface ISettings {
interface ISettings {
ADAPTER: IAdapter;
MIPMAP_TEXTURES: MIPMAP_MODES;
ANISOTROPIC_LEVEL: number;
RESOLUTION: number;
FILTER_RESOLUTION: number;
FILTER_MULTISAMPLE: MSAA_QUALITY;
SPRITE_MAX_TEXTURES: number;
SPRITE_BATCH_SIZE: number;
RENDER_OPTIONS: IRenderOptions;
GC_MODE: GC_MODES;
GC_MAX_IDLE: number;
GC_MAX_CHECK_COUNT: number;
WRAP_MODE: WRAP_MODES;
SCALE_MODE: SCALE_MODES;
PRECISION_VERTEX: PRECISION;
PRECISION_FRAGMENT: PRECISION;
CAN_UPLOAD_SAME_BUFFER: boolean;
CREATE_IMAGE_BITMAP: boolean;
ROUND_PIXELS: boolean;
RETINA_PREFIX?: RegExp;
FAIL_IF_MAJOR_PERFORMANCE_CAVEAT?: boolean;
UPLOADS_PER_FRAME?: number;
SORTABLE_CHILDREN?: boolean;
PREFER_ENV?: ENV;
STRICT_TEXTURE_CACHE?: boolean;
MESH_CANVAS_PADDING?: number;
TARGET_FPMS?: number;
}

@@ -55,10 +33,13 @@ /**

* @example
* import { settings, ENV } from 'pixi.js';
*
* // Use the native window resolution as the default resolution
* // will support high-density displays when rendering
* PIXI.settings.RESOLUTION = window.devicePixelRatio;
* settings.RESOLUTION = window.devicePixelRatio;
*
* // Disable interpolation when scaling, will make texture be pixelated
* PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
* // Used for older v1 WebGL devices for backwards compatibility
* settings.PREFER_ENV = ENV.WEBGL_LEGACY;
* @namespace PIXI.settings
*/
export declare const settings: ISettings;
export declare const settings: ISettings & Partial<GlobalMixins.Settings>;
export {};

@@ -5,17 +5,7 @@ 'use strict';

var constants = require('@pixi/constants');
var adapter = require('./adapter.js');
var canUploadSameBuffer = require('./utils/canUploadSameBuffer.js');
var isMobile = require('./utils/isMobile.js');
var maxRecommendedTextures = require('./utils/maxRecommendedTextures.js');
const settings = {
ADAPTER: adapter.BrowserAdapter,
MIPMAP_TEXTURES: constants.MIPMAP_MODES.POW2,
ANISOTROPIC_LEVEL: 0,
RESOLUTION: 1,
FILTER_RESOLUTION: 1,
FILTER_MULTISAMPLE: constants.MSAA_QUALITY.NONE,
SPRITE_MAX_TEXTURES: maxRecommendedTextures.maxRecommendedTextures(32),
SPRITE_BATCH_SIZE: 4096,
RENDER_OPTIONS: {

@@ -27,3 +17,3 @@ view: null,

backgroundAlpha: 1,
useContextAlpha: true,
premultipliedAlpha: true,
clearBeforeRender: true,

@@ -36,10 +26,2 @@ preserveDrawingBuffer: false,

},
GC_MODE: constants.GC_MODES.AUTO,
GC_MAX_IDLE: 60 * 60,
GC_MAX_CHECK_COUNT: 60 * 10,
WRAP_MODE: constants.WRAP_MODES.CLAMP,
SCALE_MODE: constants.SCALE_MODES.LINEAR,
PRECISION_VERTEX: constants.PRECISION.HIGH,
PRECISION_FRAGMENT: isMobile.isMobile.apple.device ? constants.PRECISION.HIGH : constants.PRECISION.MEDIUM,
CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer.canUploadSameBuffer(),
CREATE_IMAGE_BITMAP: false,

@@ -46,0 +28,0 @@ ROUND_PIXELS: false

{
"name": "@pixi/settings",
"version": "7.1.0-alpha",
"version": "7.1.0",
"main": "lib/index.js",

@@ -25,7 +25,7 @@ "module": "lib/index.mjs",

"homepage": "http://pixijs.com/",
"bugs": "https://github.com/pixijs/pixi.js/issues",
"bugs": "https://github.com/pixijs/pixijs/issues",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pixijs/pixi.js.git"
"url": "https://github.com/pixijs/pixijs.git"
},

@@ -40,3 +40,3 @@ "publishConfig": {

"dependencies": {
"@pixi/constants": "7.1.0-alpha",
"@pixi/constants": "7.1.0",
"@types/css-font-loading-module": "^0.0.7"

@@ -47,3 +47,3 @@ },

},
"gitHead": "0fb26a500c738cb550da277c112d15d9dd3f87b6"
"gitHead": "4079e92895ecb692afe9f0b15d3e48ee40852ada"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc