sdfsdfs
This commit is contained in:
39
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.d.ts
generated
vendored
Normal file
39
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { Point } from '../../../../maths/point/Point';
|
||||
import type { Bounds, BoundsData } from '../../../../scene/container/bounds/Bounds';
|
||||
export interface ViewObserver {
|
||||
onViewUpdate: () => void;
|
||||
}
|
||||
/**
|
||||
* A view is something that is able to be rendered by the renderer.
|
||||
* @memberof scene
|
||||
*/
|
||||
export interface View {
|
||||
/** a unique id for this view */
|
||||
readonly uid: number;
|
||||
/** whether or not this view should be batched */
|
||||
batched: boolean;
|
||||
/**
|
||||
* an identifier that is used to identify the type of system that will be used to render this renderable
|
||||
* eg, 'sprite' will use the sprite system (based on the systems name
|
||||
*/
|
||||
readonly renderPipeId: string;
|
||||
/** this is an int because it is packed directly into an attribute in the shader */
|
||||
_roundPixels: 0 | 1;
|
||||
/** @private */
|
||||
_lastUsed: number;
|
||||
/** @private */
|
||||
_lastInstructionTick: number;
|
||||
/**
|
||||
* Whether or not to round the x/y position of the object.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get roundPixels(): boolean;
|
||||
/** if true, the view will have its position rounded to the nearest whole number */
|
||||
set roundPixels(value: boolean);
|
||||
/** this is the AABB rectangle bounds of the view in local untransformed space. */
|
||||
bounds: BoundsData;
|
||||
/** Adds the current bounds of this view to the supplied bounds */
|
||||
addBounds: (bounds: Bounds) => void;
|
||||
/** Checks if the point is within the view */
|
||||
containsPoint: (point: Point) => boolean;
|
||||
}
|
4
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.js
generated
vendored
Normal file
4
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
//# sourceMappingURL=View.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"View.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
2
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.mjs
generated
vendored
Normal file
2
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=View.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/View.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"View.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
128
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts
generated
vendored
Normal file
128
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
import { ExtensionType } from '../../../../extensions/Extensions';
|
||||
import { Rectangle } from '../../../../maths/shapes/Rectangle';
|
||||
import { RenderTarget } from '../renderTarget/RenderTarget';
|
||||
import type { ICanvas } from '../../../../environment/canvas/ICanvas';
|
||||
import type { TypeOrBool } from '../../../../scene/container/destroyTypes';
|
||||
import type { System } from '../system/System';
|
||||
import type { CanvasSource } from '../texture/sources/CanvasSource';
|
||||
import type { Texture } from '../texture/Texture';
|
||||
/**
|
||||
* Options passed to the ViewSystem
|
||||
* @memberof rendering
|
||||
* @property {number} [width=800] - The width of the screen.
|
||||
* @property {number} [height=600] - The height of the screen.
|
||||
* @property {ICanvas} [canvas] - The canvas to use as a view, optional.
|
||||
* @property {boolean} [autoDensity=false] - Resizes renderer view in CSS pixels to allow for resolutions other than 1.
|
||||
* @property {number} [resolution] - The resolution / device pixel ratio of the renderer.
|
||||
* @property {boolean} [antialias=false] - Whether to enable anti-aliasing. This may affect performance.
|
||||
* @property {boolean} [depth] -
|
||||
* Whether to ensure the main view has can make use of the depth buffer. Always true for WebGL renderer.
|
||||
* @property {boolean} [multiView] - TODO: multiView
|
||||
* @property {number} [backgroundAlpha] - The alpha of the background.
|
||||
*/
|
||||
export interface ViewSystemOptions {
|
||||
/**
|
||||
* The width of the screen.
|
||||
* @default 800
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* The height of the screen.
|
||||
* @default 600
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* The canvas to use as a view, optional.
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
canvas?: ICanvas;
|
||||
/** @deprecated */
|
||||
view?: ICanvas;
|
||||
/**
|
||||
* Resizes renderer view in CSS pixels to allow for resolutions other than 1.
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
autoDensity?: boolean;
|
||||
/**
|
||||
* The resolution / device pixel ratio of the renderer.
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
resolution?: number;
|
||||
/**
|
||||
* Whether to enable anti-aliasing. This may affect performance.
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
antialias?: boolean;
|
||||
/**
|
||||
* Whether to ensure the main view has can make use of the depth buffer. Always true for WebGL renderer.
|
||||
* @memberof rendering.SharedRendererOptions
|
||||
*/
|
||||
depth?: boolean;
|
||||
/**
|
||||
* Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).
|
||||
* @default 1
|
||||
*/
|
||||
backgroundAlpha?: number;
|
||||
}
|
||||
export interface ViewSystemDestroyOptions {
|
||||
/** Whether to remove the view element from the DOM. Defaults to `false`. */
|
||||
removeView?: boolean;
|
||||
}
|
||||
/**
|
||||
* The view system manages the main canvas that is attached to the DOM.
|
||||
* This main role is to deal with how the holding the view reference and dealing with how it is resized.
|
||||
* @memberof rendering
|
||||
*/
|
||||
export declare class ViewSystem implements System<ViewSystemOptions, TypeOrBool<ViewSystemDestroyOptions>> {
|
||||
/** @ignore */
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGLSystem, ExtensionType.WebGPUSystem, ExtensionType.CanvasSystem];
|
||||
readonly name: "view";
|
||||
readonly priority: 0;
|
||||
};
|
||||
/** The default options for the view system. */
|
||||
static defaultOptions: ViewSystemOptions;
|
||||
/** The canvas element that everything is drawn to. */
|
||||
canvas: ICanvas;
|
||||
/** The texture that is used to draw the canvas to the screen. */
|
||||
texture: Texture<CanvasSource>;
|
||||
/**
|
||||
* Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
|
||||
* @member {boolean}
|
||||
*/
|
||||
get autoDensity(): boolean;
|
||||
set autoDensity(value: boolean);
|
||||
/** Whether to enable anti-aliasing. This may affect performance. */
|
||||
antialias: boolean;
|
||||
/**
|
||||
* Measurements of the screen. (0, 0, screenWidth, screenHeight).
|
||||
*
|
||||
* Its safe to use as filterArea or hitArea for the whole stage.
|
||||
*/
|
||||
screen: Rectangle;
|
||||
/** The render target that the view is drawn to. */
|
||||
renderTarget: RenderTarget;
|
||||
/** The resolution / device pixel ratio of the renderer. */
|
||||
get resolution(): number;
|
||||
set resolution(value: number);
|
||||
/**
|
||||
* initiates the view system
|
||||
* @param options - the options for the view
|
||||
*/
|
||||
init(options: ViewSystemOptions): void;
|
||||
/**
|
||||
* Resizes the screen and canvas to the specified dimensions.
|
||||
* @param desiredScreenWidth - The new width of the screen.
|
||||
* @param desiredScreenHeight - The new height of the screen.
|
||||
* @param resolution
|
||||
*/
|
||||
resize(desiredScreenWidth: number, desiredScreenHeight: number, resolution: number): void;
|
||||
/**
|
||||
* Destroys this System and optionally removes the canvas from the dom.
|
||||
* @param {options | false} options - The options for destroying the view, or "false".
|
||||
* @param options.removeView - Whether to remove the view element from the DOM. Defaults to `false`.
|
||||
*/
|
||||
destroy(options?: TypeOrBool<ViewSystemDestroyOptions>): void;
|
||||
}
|
117
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.js
generated
vendored
Normal file
117
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
var adapter = require('../../../../environment/adapter.js');
|
||||
var Extensions = require('../../../../extensions/Extensions.js');
|
||||
var Rectangle = require('../../../../maths/shapes/Rectangle.js');
|
||||
var deprecation = require('../../../../utils/logging/deprecation.js');
|
||||
var RenderTarget = require('../renderTarget/RenderTarget.js');
|
||||
var getCanvasTexture = require('../texture/utils/getCanvasTexture.js');
|
||||
|
||||
"use strict";
|
||||
const _ViewSystem = class _ViewSystem {
|
||||
/**
|
||||
* Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
|
||||
* @member {boolean}
|
||||
*/
|
||||
get autoDensity() {
|
||||
return this.texture.source.autoDensity;
|
||||
}
|
||||
set autoDensity(value) {
|
||||
this.texture.source.autoDensity = value;
|
||||
}
|
||||
/** The resolution / device pixel ratio of the renderer. */
|
||||
get resolution() {
|
||||
return this.texture.source._resolution;
|
||||
}
|
||||
set resolution(value) {
|
||||
this.texture.source.resize(
|
||||
this.texture.source.width,
|
||||
this.texture.source.height,
|
||||
value
|
||||
);
|
||||
}
|
||||
/**
|
||||
* initiates the view system
|
||||
* @param options - the options for the view
|
||||
*/
|
||||
init(options) {
|
||||
options = {
|
||||
..._ViewSystem.defaultOptions,
|
||||
...options
|
||||
};
|
||||
if (options.view) {
|
||||
deprecation.deprecation(deprecation.v8_0_0, "ViewSystem.view has been renamed to ViewSystem.canvas");
|
||||
options.canvas = options.view;
|
||||
}
|
||||
this.screen = new Rectangle.Rectangle(0, 0, options.width, options.height);
|
||||
this.canvas = options.canvas || adapter.DOMAdapter.get().createCanvas();
|
||||
this.antialias = !!options.antialias;
|
||||
this.texture = getCanvasTexture.getCanvasTexture(this.canvas, options);
|
||||
this.renderTarget = new RenderTarget.RenderTarget({
|
||||
colorTextures: [this.texture],
|
||||
depth: !!options.depth,
|
||||
isRoot: true
|
||||
});
|
||||
this.texture.source.transparent = options.backgroundAlpha < 1;
|
||||
this.resolution = options.resolution;
|
||||
}
|
||||
/**
|
||||
* Resizes the screen and canvas to the specified dimensions.
|
||||
* @param desiredScreenWidth - The new width of the screen.
|
||||
* @param desiredScreenHeight - The new height of the screen.
|
||||
* @param resolution
|
||||
*/
|
||||
resize(desiredScreenWidth, desiredScreenHeight, resolution) {
|
||||
this.texture.source.resize(desiredScreenWidth, desiredScreenHeight, resolution);
|
||||
this.screen.width = this.texture.frame.width;
|
||||
this.screen.height = this.texture.frame.height;
|
||||
}
|
||||
/**
|
||||
* Destroys this System and optionally removes the canvas from the dom.
|
||||
* @param {options | false} options - The options for destroying the view, or "false".
|
||||
* @param options.removeView - Whether to remove the view element from the DOM. Defaults to `false`.
|
||||
*/
|
||||
destroy(options = false) {
|
||||
const removeView = typeof options === "boolean" ? options : !!options?.removeView;
|
||||
if (removeView && this.canvas.parentNode) {
|
||||
this.canvas.parentNode.removeChild(this.canvas);
|
||||
}
|
||||
}
|
||||
};
|
||||
/** @ignore */
|
||||
_ViewSystem.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGLSystem,
|
||||
Extensions.ExtensionType.WebGPUSystem,
|
||||
Extensions.ExtensionType.CanvasSystem
|
||||
],
|
||||
name: "view",
|
||||
priority: 0
|
||||
};
|
||||
/** The default options for the view system. */
|
||||
_ViewSystem.defaultOptions = {
|
||||
/**
|
||||
* {@link WebGLOptions.width}
|
||||
* @default 800
|
||||
*/
|
||||
width: 800,
|
||||
/**
|
||||
* {@link WebGLOptions.height}
|
||||
* @default 600
|
||||
*/
|
||||
height: 600,
|
||||
/**
|
||||
* {@link WebGLOptions.autoDensity}
|
||||
* @default false
|
||||
*/
|
||||
autoDensity: false,
|
||||
/**
|
||||
* {@link WebGLOptions.antialias}
|
||||
* @default false
|
||||
*/
|
||||
antialias: false
|
||||
};
|
||||
let ViewSystem = _ViewSystem;
|
||||
|
||||
exports.ViewSystem = ViewSystem;
|
||||
//# sourceMappingURL=ViewSystem.js.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
115
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs
generated
vendored
Normal file
115
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import { DOMAdapter } from '../../../../environment/adapter.mjs';
|
||||
import { ExtensionType } from '../../../../extensions/Extensions.mjs';
|
||||
import { Rectangle } from '../../../../maths/shapes/Rectangle.mjs';
|
||||
import { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation.mjs';
|
||||
import { RenderTarget } from '../renderTarget/RenderTarget.mjs';
|
||||
import { getCanvasTexture } from '../texture/utils/getCanvasTexture.mjs';
|
||||
|
||||
"use strict";
|
||||
const _ViewSystem = class _ViewSystem {
|
||||
/**
|
||||
* Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
|
||||
* @member {boolean}
|
||||
*/
|
||||
get autoDensity() {
|
||||
return this.texture.source.autoDensity;
|
||||
}
|
||||
set autoDensity(value) {
|
||||
this.texture.source.autoDensity = value;
|
||||
}
|
||||
/** The resolution / device pixel ratio of the renderer. */
|
||||
get resolution() {
|
||||
return this.texture.source._resolution;
|
||||
}
|
||||
set resolution(value) {
|
||||
this.texture.source.resize(
|
||||
this.texture.source.width,
|
||||
this.texture.source.height,
|
||||
value
|
||||
);
|
||||
}
|
||||
/**
|
||||
* initiates the view system
|
||||
* @param options - the options for the view
|
||||
*/
|
||||
init(options) {
|
||||
options = {
|
||||
..._ViewSystem.defaultOptions,
|
||||
...options
|
||||
};
|
||||
if (options.view) {
|
||||
deprecation(v8_0_0, "ViewSystem.view has been renamed to ViewSystem.canvas");
|
||||
options.canvas = options.view;
|
||||
}
|
||||
this.screen = new Rectangle(0, 0, options.width, options.height);
|
||||
this.canvas = options.canvas || DOMAdapter.get().createCanvas();
|
||||
this.antialias = !!options.antialias;
|
||||
this.texture = getCanvasTexture(this.canvas, options);
|
||||
this.renderTarget = new RenderTarget({
|
||||
colorTextures: [this.texture],
|
||||
depth: !!options.depth,
|
||||
isRoot: true
|
||||
});
|
||||
this.texture.source.transparent = options.backgroundAlpha < 1;
|
||||
this.resolution = options.resolution;
|
||||
}
|
||||
/**
|
||||
* Resizes the screen and canvas to the specified dimensions.
|
||||
* @param desiredScreenWidth - The new width of the screen.
|
||||
* @param desiredScreenHeight - The new height of the screen.
|
||||
* @param resolution
|
||||
*/
|
||||
resize(desiredScreenWidth, desiredScreenHeight, resolution) {
|
||||
this.texture.source.resize(desiredScreenWidth, desiredScreenHeight, resolution);
|
||||
this.screen.width = this.texture.frame.width;
|
||||
this.screen.height = this.texture.frame.height;
|
||||
}
|
||||
/**
|
||||
* Destroys this System and optionally removes the canvas from the dom.
|
||||
* @param {options | false} options - The options for destroying the view, or "false".
|
||||
* @param options.removeView - Whether to remove the view element from the DOM. Defaults to `false`.
|
||||
*/
|
||||
destroy(options = false) {
|
||||
const removeView = typeof options === "boolean" ? options : !!options?.removeView;
|
||||
if (removeView && this.canvas.parentNode) {
|
||||
this.canvas.parentNode.removeChild(this.canvas);
|
||||
}
|
||||
}
|
||||
};
|
||||
/** @ignore */
|
||||
_ViewSystem.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGLSystem,
|
||||
ExtensionType.WebGPUSystem,
|
||||
ExtensionType.CanvasSystem
|
||||
],
|
||||
name: "view",
|
||||
priority: 0
|
||||
};
|
||||
/** The default options for the view system. */
|
||||
_ViewSystem.defaultOptions = {
|
||||
/**
|
||||
* {@link WebGLOptions.width}
|
||||
* @default 800
|
||||
*/
|
||||
width: 800,
|
||||
/**
|
||||
* {@link WebGLOptions.height}
|
||||
* @default 600
|
||||
*/
|
||||
height: 600,
|
||||
/**
|
||||
* {@link WebGLOptions.autoDensity}
|
||||
* @default false
|
||||
*/
|
||||
autoDensity: false,
|
||||
/**
|
||||
* {@link WebGLOptions.antialias}
|
||||
* @default false
|
||||
*/
|
||||
antialias: false
|
||||
};
|
||||
let ViewSystem = _ViewSystem;
|
||||
|
||||
export { ViewSystem };
|
||||
//# sourceMappingURL=ViewSystem.mjs.map
|
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user