Socket
Socket
Sign inDemoInstall

@pixi/core

Package Overview
Dependencies
Maintainers
2
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/core - npm Package Compare versions

Comparing version 7.1.1 to 7.1.2

71

lib/autoDetectRenderer.d.ts
import type { ICanvas } from '@pixi/settings';
import type { IRenderer, IRendererOptions } from './IRenderer';
/**
* Renderer options supplied to `autoDetectRenderer`.
* @memberof PIXI
*/
export interface IRendererOptionsAuto extends IRendererOptions {

@@ -13,32 +17,47 @@ forceCanvas?: boolean;

* WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by
* the browser then this function will return a canvas renderer
* the browser then this function will return a canvas renderer.
* @memberof PIXI
* @function autoDetectRenderer
* @param {object} [options] - The optional renderer parameters
* @param {number} [options.width=800] - the width of the renderers view
* @param {number} [options.height=600] - the height of the renderers view
* @param {PIXI.ICanvas} [options.view] - the canvas to use as a view, optional
* @param {boolean} [options.useContextAlpha=true] - Pass-through value for canvas' context `alpha` property.
* If you want to set transparency, please use `backgroundAlpha`. This option is for cases where the
* canvas needs to be opaque, possibly for performance reasons on some older devices.
* @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for
* resolutions other than 1
* @param {boolean} [options.antialias=false] - sets antialias
* @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you
* need to call toDataUrl on the webgl context
* @param {number|string} [options.backgroundColor=0x000000] - The background color of the rendered area
* (shown if not transparent). Also, accepts hex strings or color names (e.g., 'white').
* @param {PIXI.IRendererOptionsAuto} [options] - The optional renderer parameters.
* @param {boolean} [options.antialias=false] -
* **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.
* @param {boolean} [options.autoDensity=false] -
* Whether the CSS dimensions of the renderer's view should be resized automatically.
* @param {number|string} [options.background] - Alias for `options.backgroundColor`.
* @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
* not before the new render pass.
* @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.
* @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this
* option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise
* it is ignored.
* @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance"
* for devices with dual graphics card **webgl only**
* @param {boolean} [options.hello=false] - Logs renderer type and version.
* @returns {PIXI.Renderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer
* @param {number} [options.backgroundAlpha=1] -
* Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).
* @param {number|string} [options.backgroundColor=0x000000] -
* The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`),
* hex strings (e.g. `'#f00'` or `'#ff0000'`) or color names (e.g. `'red'`).
* @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.
* @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.
* @param {boolean} [options.forceCanvas=false] -
* Force using {@link PIXI.CanvasRenderer}, even if WebGL is available. This option only is available when
* using **pixi.js-legacy** or **@pixi/canvas-renderer** packages, otherwise it will throw an error.
* @param {number} [options.height=600] - The height of the renderer's view.
* @param {boolean} [options.hello=false] - Whether to log the version and type information of renderer to console.
* @param {string} [options.powerPreference] -
* **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,
* can be `'default'`, `'high-performance'` or `'low-power'`.
* Setting to `'high-performance'` will prioritize rendering performance over power consumption,
* while setting to `'low-power'` will prioritize power saving over rendering performance.
* @param {boolean} [options.premultipliedAlpha=true] -
* **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.
* @param {boolean} [options.preserveDrawingBuffer=false] -
* **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
* its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.
* @param {number} [options.resolution=PIXI.settings.RESOLUTION] -
* The resolution / device pixel ratio of the renderer.
* @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -
* **Deprecated since 7.0.0, use `premultipliedAlpha` and `backgroundAlpha` instead.** \
* Pass-through value for canvas' context attribute `alpha`. This option is for cases where the
* canvas needs to be opaque, possibly for performance reasons on some older devices.
* If you want to set transparency, please use `backgroundAlpha`. \
* **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be
* set to `true` and `premultipliedAlpha` will be to `false`.
* @param {PIXI.ICanvas} [options.view=null] -
* The canvas to use as the view. If omitted, a new canvas will be created.
* @param {number} [options.width=800] - The width of the renderer's view.
* @returns Returns {@link PIXI.Renderer} if WebGL is available, otherwise {@link PIXI.CanvasRenderer}.
*/
export declare function autoDetectRenderer<VIEW extends ICanvas = ICanvas>(options?: IRendererOptionsAuto): IRenderer<VIEW>;

@@ -116,3 +116,3 @@ 'use strict';

const VERSION = "7.1.1";
const VERSION = "7.1.2";

@@ -119,0 +119,0 @@ exports.utils = utils__namespace;

@@ -36,3 +36,6 @@ import type { RENDERER_TYPE } from '@pixi/constants';

}
/** Mixed WebGL1/WebGL2 Rendering Context. Either its WebGL2, either its WebGL1 with PixiJS polyfills on it */
/**
* Mixed WebGL1 / WebGL2 rendering context. Either it's WebGL2, either it's WebGL1 with PixiJS polyfills on it.
* @memberof PIXI
*/
export interface IRenderingContext extends WebGL2RenderingContext {

@@ -56,38 +59,87 @@ texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;

* @memberof PIXI
* @see PIXI.settings.RENDER_OPTIONS
*/
export interface IRendererOptions extends GlobalMixins.IRendererOptions {
/** Width of the view */
/** The canvas to use as the view. If omitted, a new canvas will be created. */
view?: ICanvas;
/**
* The width of the renderer's view.
* @default 800
*/
width?: number;
/** Height of the view */
/**
* The height of the renderer's view.
* @default 600
*/
height?: number;
/** Canvas or OffscreenCanvas to use, will be created if omitted */
view?: ICanvas;
/**
* Use premultipliedAlpha and backgroundAlpha instead
* @deprecated since 7.0.0
* The resolution / device pixel ratio of the renderer.
* @default PIXI.settings.RESOLUTION
*/
useContextAlpha?: boolean | 'notMultiplied';
/** Consider the resolution when resizing the view */
resolution?: number;
/**
* Whether the CSS dimensions of the renderer's view should be resized automatically.
* @default false
*/
autoDensity?: boolean;
/** Antialias turn on for WebGL, impacts performance */
antialias?: boolean;
/** Base resolution for the Renderer */
resolution?: number;
/** Preserve the drawing buffer */
preserveDrawingBuffer?: boolean;
/** Clear the draw before render */
clearBeforeRender?: boolean;
/** The background color, can be number (`0xff0000`) or string (`#f00`) */
/**
* The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`),
* hex strings (e.g. `'#f00'` or `'#ff0000'`) or color names (e.g. `'red'`).
* @default 0x000000
*/
backgroundColor?: number | string;
/** Alias for `backgroundColor` */
/** Alias for `backgroundColor`. */
background?: number | string;
/** Background color alpha */
/**
* Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).
* @default 1
*/
backgroundAlpha?: number;
/** Premultiply alpha */
/**
* **Deprecated since 7.0.0, use `premultipliedAlpha` and `backgroundAlpha` instead.**
*
* Pass-through value for canvas' context attribute `alpha`. This option is for cases where the
* canvas needs to be opaque, possibly for performance reasons on some older devices.
* If you want to set transparency, please use `backgroundAlpha`.
*
* **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be
* set to `true` and `premultipliedAlpha` will be to `false`.
* @default true
* @deprecated since 7.0.0
*/
useContextAlpha?: boolean | 'notMultiplied';
/**
* Whether to clear the canvas before new render passes.
* @default true
*/
clearBeforeRender?: boolean;
/** **WebGL Only.** User-provided WebGL rendering context object. */
context?: IRenderingContext;
/**
* **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.
* @default false
*/
antialias?: boolean;
/**
* **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,
* can be `'default'`, `'high-performance'` or `'low-power'`.
* Setting to `'high-performance'` will prioritize rendering performance over power consumption,
* while setting to `'low-power'` will prioritize power saving over rendering performance.
*/
powerPreference?: WebGLPowerPreference;
/**
* **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.
* @default true
*/
premultipliedAlpha?: boolean;
/** Power preference, for multiple GPUs */
powerPreference?: WebGLPowerPreference;
/** User-proviced rendering context object */
context?: IRenderingContext;
/** Console log the version and type of Renderer */
/**
* **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
* its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.
* @default false
*/
preserveDrawingBuffer?: boolean;
/**
* Whether to log the version and type information of renderer to console.
* @default false
*/
hello?: boolean;

@@ -94,0 +146,0 @@ }

@@ -238,27 +238,39 @@ import { UniformGroup } from './shader/UniformGroup';

/**
* @param [options] - The optional renderer parameters.
* @param {number} [options.width=800] - The width of the screen.
* @param {number} [options.height=600] - The height of the screen.
* @param {PIXI.ICanvas} [options.view] - The canvas to use as a view, optional.
* @param {boolean} [options.premultipliedAlpha=true] - Set to `false` to disable premultipliedAlpha.
* @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for
* resolutions other than 1.
* @param {boolean} [options.antialias=false] - Sets antialias. If not available natively then FXAA
* antialiasing is used.
* @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear
* the canvas or not before the new render pass. If you wish to set this to false, you *must* set
* preserveDrawingBuffer to `true`.
* @param {boolean} [options.preserveDrawingBuffer=false] - Enables drawing buffer preservation,
* enable this if you need to call toDataURL on the WebGL context.
* @param {number|string} [options.backgroundColor=0x000000] - The background color of the rendered area
* (shown if not transparent). Also, accepts hex strings or color names (e.g., 'white').
* @param {PIXI.IRendererOptions} [options] - The optional renderer parameters.
* @param {boolean} [options.antialias=false] -
* **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.
* @param {boolean} [options.autoDensity=false] -
* Whether the CSS dimensions of the renderer's view should be resized automatically.
* @param {number|string} [options.background] - Alias for `options.backgroundColor`.
* @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).
* @param {string} [options.powerPreference] - Parameter passed to WebGL context, set to "high-performance"
* for devices with dual graphics card.
* @param {object} [options.context] - If WebGL context already exists, all parameters must be taken from it.
* @param {object} [options.blit] - if rendering to a renderTexture, set to true if you want to run blit after
* the render. defaults to false.
* @param {boolean} [options.hello=false] - Logs renderer type and version.
* @param {number} [options.backgroundAlpha=1] -
* Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).
* @param {number|string} [options.backgroundColor=0x000000] -
* The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`),
* hex strings (e.g. `'#f00'` or `'#ff0000'`) or color names (e.g. `'red'`).
* @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.
* @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.
* @param {number} [options.height=600] - The height of the renderer's view.
* @param {boolean} [options.hello=false] - Whether to log the version and type information of renderer to console.
* @param {string} [options.powerPreference] -
* **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,
* can be `'default'`, `'high-performance'` or `'low-power'`.
* Setting to `'high-performance'` will prioritize rendering performance over power consumption,
* while setting to `'low-power'` will prioritize power saving over rendering performance.
* @param {boolean} [options.premultipliedAlpha=true] -
* **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.
* @param {boolean} [options.preserveDrawingBuffer=false] -
* **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
* its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.
* @param {number} [options.resolution=PIXI.settings.RESOLUTION] -
* The resolution / device pixel ratio of the renderer.
* @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -
* **Deprecated since 7.0.0, use `premultipliedAlpha` and `backgroundAlpha` instead.** \
* Pass-through value for canvas' context attribute `alpha`. This option is for cases where the
* canvas needs to be opaque, possibly for performance reasons on some older devices.
* If you want to set transparency, please use `backgroundAlpha`. \
* **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be
* set to `true` and `premultipliedAlpha` will be to `false`.
* @param {PIXI.ICanvas} [options.view=null] -
* The canvas to use as the view. If omitted, a new canvas will be created.
* @param {number} [options.width=800] - The width of the renderer's view.
*/

@@ -265,0 +277,0 @@ constructor(options?: IRendererOptions);

@@ -88,4 +88,4 @@ 'use strict';

};
this.options = options;
this.startup.run(startupOptions);
this.options = options;
}

@@ -92,0 +92,0 @@ static test(options) {

@@ -15,3 +15,3 @@ 'use strict';

if (options.hello) {
console.log(`PixiJS ${"7.1.1"} - ${renderer.rendererLogId} - https://pixijs.com`);
console.log(`PixiJS ${"7.1.2"} - ${renderer.rendererLogId} - https://pixijs.com`);
}

@@ -18,0 +18,0 @@ renderer.resize(this.renderer.screen.width, this.renderer.screen.height);

{
"name": "@pixi/core",
"version": "7.1.1",
"version": "7.1.2",
"main": "lib/index.js",

@@ -43,12 +43,12 @@ "module": "lib/index.mjs",

"dependencies": {
"@pixi/constants": "7.1.1",
"@pixi/extensions": "7.1.1",
"@pixi/math": "7.1.1",
"@pixi/runner": "7.1.1",
"@pixi/settings": "7.1.1",
"@pixi/ticker": "7.1.1",
"@pixi/utils": "7.1.1",
"@pixi/constants": "7.1.2",
"@pixi/extensions": "7.1.2",
"@pixi/math": "7.1.2",
"@pixi/runner": "7.1.2",
"@pixi/settings": "7.1.2",
"@pixi/ticker": "7.1.2",
"@pixi/utils": "7.1.2",
"@types/offscreencanvas": "^2019.6.4"
},
"gitHead": "99b26d1d5a18760019b034c69c5979ca5e6c536b"
"gitHead": "27e65c73bb36a06fd00d6da5bf460bbee9f6c984"
}

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc