From b46fe6fcd6cd5591c2cc4607a12d41466d194fcd Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 2 Aug 2021 23:51:46 -0400 Subject: [PATCH] Updates --- src/nitro/room/preview/RoomPreviewer.ts | 8 ++++++-- src/nitro/room/utils/SpriteDataCollector.ts | 2 +- src/nitro/session/BadgeImageManager.ts | 2 +- src/nitro/session/BadgeInfo.ts | 2 +- src/nitro/session/ISessionDataManager.ts | 2 +- src/nitro/session/SessionDataManager.ts | 2 +- src/nitro/session/events/BadgeImageReadyEvent.ts | 2 +- src/nitro/utils/WebGL.ts | 7 +++---- .../pixi-tilemap/CompositeRectTileLayer.ts | 6 ++++-- src/room/floorplan/pixi-tilemap/Constant.ts | 2 +- .../pixi-tilemap/MultiTextureResource.ts | 6 ++++-- src/room/floorplan/pixi-tilemap/RectTileLayer.ts | 7 +++++-- src/room/floorplan/pixi-tilemap/RectTileShader.ts | 4 +++- src/room/floorplan/pixi-tilemap/TileRenderer.ts | 5 +++-- .../object/visualization/IPlaneDrawingData.ts | 2 +- .../object/visualization/IRoomObjectSprite.ts | 3 ++- .../visualization/IRoomObjectVisualization.ts | 3 ++- src/room/object/visualization/RoomObjectSprite.ts | 4 +++- .../RoomObjectSpriteVisualization.ts | 8 +++++--- .../object/visualization/utils/GraphicAsset.ts | 3 ++- .../visualization/utils/GraphicAssetCollection.ts | 5 +++-- .../visualization/utils/GraphicAssetPalette.ts | 5 +++-- .../object/visualization/utils/IGraphicAsset.ts | 3 ++- .../utils/IGraphicAssetCollection.ts | 2 +- src/room/renderer/IRoomRenderingCanvas.ts | 4 +++- src/room/renderer/RoomSpriteCanvas.ts | 15 ++++++++------- src/room/renderer/utils/ExtendedSprite.ts | 10 ++++++++-- src/room/utils/IRoomGeometry.ts | 4 ++-- src/room/utils/PointMath.ts | 2 +- src/room/utils/Rasterizer.ts | 4 +++- src/room/utils/RoomGeometry.ts | 4 ++-- src/room/utils/SpriteUtilities.ts | 4 ++-- 32 files changed, 88 insertions(+), 54 deletions(-) diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 8720025b..68cdb8c0 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -1,4 +1,8 @@ -import { Container, DisplayObject, Point, Rectangle, RenderTexture, Sprite, Texture } from 'pixi.js'; +import { RenderTexture, Texture } from '@pixi/core'; +import { Container, DisplayObject } from '@pixi/display'; +import { Point, Rectangle } from '@pixi/math'; +import { Sprite } from '@pixi/sprite'; +import { NitroSprite } from '../../../core'; import { IRoomObjectController } from '../../../room/object/IRoomObjectController'; import { IRoomRenderingCanvas } from '../../../room/renderer/IRoomRenderingCanvas'; import { IVector3D } from '../../../room/utils/IVector3D'; @@ -455,7 +459,7 @@ export class RoomPreviewer if(!backgroundSprite) { - backgroundSprite = new Sprite(Texture.WHITE); + backgroundSprite = new NitroSprite(Texture.WHITE); displayObject.addChildAt(backgroundSprite, 0); } diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index 8812e966..e2e88c1a 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -1,4 +1,4 @@ -import { Point, Rectangle } from 'pixi.js'; +import { Point, Rectangle } from '@pixi/math'; import { RoomObjectSpriteData } from '../../../room/data/RoomObjectSpriteData'; import { IPlaneDrawingData } from '../../../room/object/visualization/IPlaneDrawingData'; import { IPlaneVisualization } from '../../../room/object/visualization/IPlaneVisualization'; diff --git a/src/nitro/session/BadgeImageManager.ts b/src/nitro/session/BadgeImageManager.ts index b14eb574..89d112b6 100644 --- a/src/nitro/session/BadgeImageManager.ts +++ b/src/nitro/session/BadgeImageManager.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; import { IAssetManager } from '../../core/asset/IAssetManager'; import { IEventDispatcher } from '../../core/events/IEventDispatcher'; import { Nitro } from '../Nitro'; diff --git a/src/nitro/session/BadgeInfo.ts b/src/nitro/session/BadgeInfo.ts index 0196680a..7cd89975 100644 --- a/src/nitro/session/BadgeInfo.ts +++ b/src/nitro/session/BadgeInfo.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; export class BadgeInfo { diff --git a/src/nitro/session/ISessionDataManager.ts b/src/nitro/session/ISessionDataManager.ts index 60663058..51a598c3 100644 --- a/src/nitro/session/ISessionDataManager.ts +++ b/src/nitro/session/ISessionDataManager.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; import { INitroManager } from '../../core/common/INitroManager'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { IFurnitureData } from './furniture/IFurnitureData'; diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 421e702d..7dbc69ab 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; import { NitroManager } from '../../core/common/NitroManager'; import { IMessageComposer } from '../../core/communication/messages/IMessageComposer'; import { NitroEvent } from '../../core/events/NitroEvent'; diff --git a/src/nitro/session/events/BadgeImageReadyEvent.ts b/src/nitro/session/events/BadgeImageReadyEvent.ts index 3b01d338..d060fb99 100644 --- a/src/nitro/session/events/BadgeImageReadyEvent.ts +++ b/src/nitro/session/events/BadgeImageReadyEvent.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; import { NitroEvent } from '../../../core/events/NitroEvent'; export class BadgeImageReadyEvent extends NitroEvent diff --git a/src/nitro/utils/WebGL.ts b/src/nitro/utils/WebGL.ts index 3539fd4c..85a2e9c9 100644 --- a/src/nitro/utils/WebGL.ts +++ b/src/nitro/utils/WebGL.ts @@ -1,9 +1,8 @@ -import { utils } from 'pixi.js'; - +import { isWebGLSupported } from '@pixi/utils'; export class WebGL { public static isWebGLAvailable(): boolean { - return utils.isWebGLSupported(); + return isWebGLSupported(); } -} \ No newline at end of file +} diff --git a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts index 7e8d6167..60cab12c 100644 --- a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts @@ -1,10 +1,12 @@ -import { Container, Matrix, Renderer, Resource, Texture } from 'pixi.js'; +import { Renderer, Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; +import { Matrix } from '@pixi/math'; import { Constant } from './Constant'; import { RectTileLayer } from './RectTileLayer'; export class CompositeRectTileLayer extends Container { - constructor(zIndex?: number, bitmaps?: Array, texPerChild?: number, alpha?: number) + constructor(zIndex?: number, bitmaps?: Texture[], texPerChild?: number, alpha?: number) { super(); // eslint-disable-next-line prefer-spread,prefer-rest-params diff --git a/src/room/floorplan/pixi-tilemap/Constant.ts b/src/room/floorplan/pixi-tilemap/Constant.ts index a4d3f799..103b2199 100644 --- a/src/room/floorplan/pixi-tilemap/Constant.ts +++ b/src/room/floorplan/pixi-tilemap/Constant.ts @@ -1,4 +1,4 @@ -import { SCALE_MODES } from 'pixi.js'; +import { SCALE_MODES } from '@pixi/constants'; export const Constant = { maxTextures: 16, diff --git a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts index 31655f5a..1b14b354 100644 --- a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts +++ b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts @@ -1,4 +1,6 @@ -import { BaseTexture, GLTexture, IAutoDetectOptions, Renderer, Resource, Sprite, Texture } from 'pixi.js'; +import { BaseTexture, GLTexture, IAutoDetectOptions, Renderer, Resource, Texture } from '@pixi/core'; +import { Sprite } from '@pixi/sprite'; +import { NitroSprite } from '../../../core'; export interface IMultiTextureOptions { boundCountPerBuffer: number; @@ -18,7 +20,7 @@ export class MultiTextureResource extends Resource this.boundSize = options.boundSize; for(let j = 0; j < options.boundCountPerBuffer; j++) { - const spr = new Sprite(); + const spr = new NitroSprite(); spr.position.x = options.boundSize * (j & 1); spr.position.y = options.boundSize * (j >> 1); bounds.push(spr); diff --git a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts index 109de68f..55819bc8 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts @@ -1,4 +1,7 @@ -import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Resource, Texture } from 'pixi.js'; +import { DRAW_MODES } from '@pixi/constants'; +import { Renderer, Resource, Texture } from '@pixi/core'; +import { Bounds, Container } from '@pixi/display'; +import { groupD8, Matrix, Rectangle } from '@pixi/math'; import { Constant } from './Constant'; import { RectTileGeom } from './RectTileShader'; import { TileRenderer } from './TileRenderer'; @@ -24,7 +27,7 @@ export const POINT_STRUCT_SIZE_TWO = (Object.keys(PointStruct).length / 2); //export const POINT_STRUCT_SIZE = 12; export class RectTileLayer extends Container { - constructor(zIndex: number, texture: Texture | Array) + constructor(zIndex: number, texture: Texture | Texture[]) { super(); this.initialize(zIndex, texture); diff --git a/src/room/floorplan/pixi-tilemap/RectTileShader.ts b/src/room/floorplan/pixi-tilemap/RectTileShader.ts index 2fd04a8c..9ee325a9 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileShader.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileShader.ts @@ -1,4 +1,5 @@ -import { Buffer, Geometry, Matrix, Program, Shader } from 'pixi.js'; +import { Buffer, Geometry, Program, Shader } from '@pixi/core'; +import { Matrix } from '@pixi/math'; import * as shaderGenerator from './shaderGenerator'; const rectShaderFrag = ` @@ -22,6 +23,7 @@ void main(void){ gl_FragColor = (color * vAlpha) + (gl_FragColor * (1.0 - vAlpha)); } `; + const rectShaderVert = ` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; diff --git a/src/room/floorplan/pixi-tilemap/TileRenderer.ts b/src/room/floorplan/pixi-tilemap/TileRenderer.ts index 5383e598..d4e0e6f8 100644 --- a/src/room/floorplan/pixi-tilemap/TileRenderer.ts +++ b/src/room/floorplan/pixi-tilemap/TileRenderer.ts @@ -1,5 +1,6 @@ +import { WRAP_MODES } from '@pixi/constants'; +import { Buffer, ObjectRenderer, Renderer, Resource, Texture } from '@pixi/core'; import { createIndicesForQuads } from '@pixi/utils'; -import { BaseTexture, Buffer, ObjectRenderer, Renderer, Texture, WRAP_MODES } from 'pixi.js'; import { Constant } from './Constant'; import { MultiTextureResource } from './MultiTextureResource'; import type { TilemapShader } from './RectTileShader'; @@ -49,7 +50,7 @@ export class TileRenderer extends ObjectRenderer } } - bindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Array) + bindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Texture[]) { const samplerSize: Array = (shader as any).uniforms.uSamplerSize; this.texLoc.length = 0; diff --git a/src/room/object/visualization/IPlaneDrawingData.ts b/src/room/object/visualization/IPlaneDrawingData.ts index 8a67219e..0aae6afb 100644 --- a/src/room/object/visualization/IPlaneDrawingData.ts +++ b/src/room/object/visualization/IPlaneDrawingData.ts @@ -1,4 +1,4 @@ -import { Point } from 'pixi.js'; +import { Point } from '@pixi/math'; export interface IPlaneDrawingData { diff --git a/src/room/object/visualization/IRoomObjectSprite.ts b/src/room/object/visualization/IRoomObjectSprite.ts index 9be4e40c..c6914adb 100644 --- a/src/room/object/visualization/IRoomObjectSprite.ts +++ b/src/room/object/visualization/IRoomObjectSprite.ts @@ -1,4 +1,5 @@ -import { Container, Filter, Resource, Texture } from 'pixi.js'; +import { Filter, Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; export interface IRoomObjectSprite { diff --git a/src/room/object/visualization/IRoomObjectVisualization.ts b/src/room/object/visualization/IRoomObjectVisualization.ts index ed16b108..e32eb675 100644 --- a/src/room/object/visualization/IRoomObjectVisualization.ts +++ b/src/room/object/visualization/IRoomObjectVisualization.ts @@ -1,4 +1,5 @@ -import { Rectangle, RenderTexture } from 'pixi.js'; +import { RenderTexture } from '@pixi/core'; +import { Rectangle } from '@pixi/math'; import { IRoomGeometry } from '../../utils/IRoomGeometry'; import { IRoomObject } from '../IRoomObject'; import { IObjectVisualizationData } from './IRoomObjectVisualizationData'; diff --git a/src/room/object/visualization/RoomObjectSprite.ts b/src/room/object/visualization/RoomObjectSprite.ts index 8e6c15f0..43a0dc24 100644 --- a/src/room/object/visualization/RoomObjectSprite.ts +++ b/src/room/object/visualization/RoomObjectSprite.ts @@ -1,4 +1,6 @@ -import { BLEND_MODES, Container, Filter, Resource, Texture } from 'pixi.js'; +import { BLEND_MODES } from '@pixi/constants'; +import { Filter, Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { AlphaTolerance } from '../enum/AlphaTolerance'; import { RoomObjectSpriteType } from '../enum/RoomObjectSpriteType'; import { IRoomObjectSprite } from './IRoomObjectSprite'; diff --git a/src/room/object/visualization/RoomObjectSpriteVisualization.ts b/src/room/object/visualization/RoomObjectSpriteVisualization.ts index 9f2c205e..90953008 100644 --- a/src/room/object/visualization/RoomObjectSpriteVisualization.ts +++ b/src/room/object/visualization/RoomObjectSpriteVisualization.ts @@ -1,4 +1,6 @@ -import { Container, Point, Rectangle, RenderTexture, Sprite } from 'pixi.js'; +import { RenderTexture } from '@pixi/core'; +import { Point, Rectangle } from '@pixi/math'; +import { NitroContainer, NitroSprite } from '../../../core'; import { RoomObjectSpriteData } from '../../data/RoomObjectSpriteData'; import { IRoomGeometry } from '../../utils/IRoomGeometry'; import { TextureUtils } from '../../utils/TextureUtils'; @@ -153,7 +155,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza return b.relativeDepth - a.relativeDepth; }); - const container = new Container(); + const container = new NitroContainer(); index = 0; @@ -164,7 +166,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza if(texture) { - const sprite = Sprite.from(texture); + const sprite = new NitroSprite(texture); sprite.alpha = (objectSprite.alpha / 255); sprite.tint = objectSprite.color; diff --git a/src/room/object/visualization/utils/GraphicAsset.ts b/src/room/object/visualization/utils/GraphicAsset.ts index 54fa8b37..a9d8e75c 100644 --- a/src/room/object/visualization/utils/GraphicAsset.ts +++ b/src/room/object/visualization/utils/GraphicAsset.ts @@ -1,4 +1,5 @@ -import { Rectangle, Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; +import { Rectangle } from '@pixi/math'; import { IGraphicAsset } from './IGraphicAsset'; export class GraphicAsset implements IGraphicAsset diff --git a/src/room/object/visualization/utils/GraphicAssetCollection.ts b/src/room/object/visualization/utils/GraphicAssetCollection.ts index eddd0063..953c9a70 100644 --- a/src/room/object/visualization/utils/GraphicAssetCollection.ts +++ b/src/room/object/visualization/utils/GraphicAssetCollection.ts @@ -1,5 +1,6 @@ +import { Resource, Texture } from '@pixi/core'; +import { Spritesheet } from '@pixi/spritesheet'; import { Dict } from '@pixi/utils'; -import { Resource, Spritesheet, Texture } from 'pixi.js'; import { AssetManager } from '../../../../core/asset/AssetManager'; import { IAsset, IAssetData, IAssetPalette } from '../../../../core/asset/interfaces'; import { Nitro } from '../../../../nitro/Nitro'; @@ -17,7 +18,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection private _name: string; private _data: IAssetData; - private _textures: Map; + private _textures: Map>; private _assets: Map; private _palettes: Map; private _paletteAssetNames: string[]; diff --git a/src/room/object/visualization/utils/GraphicAssetPalette.ts b/src/room/object/visualization/utils/GraphicAssetPalette.ts index 9a49d6aa..7032354b 100644 --- a/src/room/object/visualization/utils/GraphicAssetPalette.ts +++ b/src/room/object/visualization/utils/GraphicAssetPalette.ts @@ -1,4 +1,5 @@ -import { Resource, Sprite, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; +import { NitroSprite } from '../../../../core'; import { TextureUtils } from '../../../utils'; export class GraphicAssetPalette @@ -24,7 +25,7 @@ export class GraphicAssetPalette public applyPalette(texture: Texture): Texture { - const sprite = Sprite.from(texture); + const sprite = new NitroSprite(texture); const textureCanvas = TextureUtils.generateCanvas(sprite); const textureCtx = textureCanvas.getContext('2d'); const textureImageData = textureCtx.getImageData(0, 0, textureCanvas.width, textureCanvas.height); diff --git a/src/room/object/visualization/utils/IGraphicAsset.ts b/src/room/object/visualization/utils/IGraphicAsset.ts index 54ce1d75..ea4c6336 100644 --- a/src/room/object/visualization/utils/IGraphicAsset.ts +++ b/src/room/object/visualization/utils/IGraphicAsset.ts @@ -1,4 +1,5 @@ -import { Rectangle, Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; +import { Rectangle } from '@pixi/math'; export interface IGraphicAsset { diff --git a/src/room/object/visualization/utils/IGraphicAssetCollection.ts b/src/room/object/visualization/utils/IGraphicAssetCollection.ts index 6fb07a6a..853befe1 100644 --- a/src/room/object/visualization/utils/IGraphicAssetCollection.ts +++ b/src/room/object/visualization/utils/IGraphicAssetCollection.ts @@ -1,4 +1,4 @@ -import { Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; import { IAssetData } from '../../../../core/asset/interfaces'; import { GraphicAssetPalette } from './GraphicAssetPalette'; import { IGraphicAsset } from './IGraphicAsset'; diff --git a/src/room/renderer/IRoomRenderingCanvas.ts b/src/room/renderer/IRoomRenderingCanvas.ts index cef930d4..1fc8d71f 100644 --- a/src/room/renderer/IRoomRenderingCanvas.ts +++ b/src/room/renderer/IRoomRenderingCanvas.ts @@ -1,4 +1,6 @@ -import { DisplayObject, Point, RenderTexture } from 'pixi.js'; +import { RenderTexture } from '@pixi/core'; +import { DisplayObject } from '@pixi/display'; +import { Point } from '@pixi/math'; import { RoomObjectSpriteData } from '../data/RoomObjectSpriteData'; import { IRoomGeometry } from '../utils/IRoomGeometry'; import { IRoomCanvasMouseListener } from './IRoomCanvasMouseListener'; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 14b40908..048ae3d3 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -1,4 +1,9 @@ -import { Container, DisplayObject, Graphics, Matrix, Point, Rectangle, RenderTexture, Sprite } from 'pixi.js'; +import { RenderTexture } from '@pixi/core'; +import { Container, DisplayObject } from '@pixi/display'; +import { Graphics } from '@pixi/graphics'; +import { Matrix, Point, Rectangle } from '@pixi/math'; +import { Sprite } from '@pixi/sprite'; +import { NitroContainer, NitroSprite } from '../../core'; import { Nitro } from '../../nitro/Nitro'; import { MouseEventType } from '../../nitro/ui/MouseEventType'; import { RoomObjectSpriteData } from '../data/RoomObjectSpriteData'; @@ -124,16 +129,14 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { if(!this._master) { - this._master = new Sprite(); + this._master = new NitroSprite(); this._master.interactiveChildren = false; } if(!this._display) { - const display = new Container(); - - display.name = 'canvas'; + const display = new NitroContainer(); this._master.addChild(display); @@ -221,8 +224,6 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas .drawRect(0, 0, width, height) .endFill(); - this._mask.name = 'mask'; - if(this._master) { this._master.addChild(this._mask); diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index 60ac3d58..4cc92437 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -1,4 +1,8 @@ -import { BaseTexture, BLEND_MODES, Point, RenderTexture, Resource, Sprite, Texture } from 'pixi.js'; +import { BLEND_MODES } from '@pixi/constants'; +import { BaseTexture, RenderTexture, Resource, Texture } from '@pixi/core'; +import { Point } from '@pixi/math'; +import { Sprite } from '@pixi/sprite'; +import { NitroSprite } from '../../../core'; import { TextureUtils } from '../../utils'; export class ExtendedSprite extends Sprite @@ -13,6 +17,8 @@ export class ExtendedSprite extends Sprite private _pairedSpriteId: number; private _pairedSpriteUpdateCounter: number; + public name: string; + constructor(texture: Texture = null) { super(texture); @@ -93,7 +99,7 @@ export class ExtendedSprite extends Sprite //@ts-ignore if(!texture.getLocalBounds) { - const tempSprite = Sprite.from(texture); + const tempSprite = new NitroSprite(texture); canvas = TextureUtils.generateCanvas(tempSprite); diff --git a/src/room/utils/IRoomGeometry.ts b/src/room/utils/IRoomGeometry.ts index 4b4cb9c4..1ee0bc3e 100644 --- a/src/room/utils/IRoomGeometry.ts +++ b/src/room/utils/IRoomGeometry.ts @@ -1,4 +1,4 @@ -import { Point } from 'pixi.js'; +import { Point } from '@pixi/math'; import { IVector3D } from './IVector3D'; export interface IRoomGeometry @@ -18,4 +18,4 @@ export interface IRoomGeometry scale: number; directionAxis: IVector3D; direction: IVector3D; -} \ No newline at end of file +} diff --git a/src/room/utils/PointMath.ts b/src/room/utils/PointMath.ts index 376204c3..d01f6681 100644 --- a/src/room/utils/PointMath.ts +++ b/src/room/utils/PointMath.ts @@ -1,4 +1,4 @@ -import { Point } from 'pixi.js'; +import { Point } from '@pixi/math'; export class PointMath { diff --git a/src/room/utils/Rasterizer.ts b/src/room/utils/Rasterizer.ts index 7f2b29ff..d11f945f 100644 --- a/src/room/utils/Rasterizer.ts +++ b/src/room/utils/Rasterizer.ts @@ -1,4 +1,6 @@ -import { Graphics, Matrix, Resource, Texture } from 'pixi.js'; +import { Resource, Texture } from '@pixi/core'; +import { Graphics } from '@pixi/graphics'; +import { Matrix } from '@pixi/math'; import { TextureUtils } from './TextureUtils'; export class Rasterizer diff --git a/src/room/utils/RoomGeometry.ts b/src/room/utils/RoomGeometry.ts index e140ad11..5c76d9cb 100644 --- a/src/room/utils/RoomGeometry.ts +++ b/src/room/utils/RoomGeometry.ts @@ -1,4 +1,4 @@ -import { Point } from 'pixi.js'; +import { Point } from '@pixi/math'; import { IRoomGeometry } from './IRoomGeometry'; import { IVector3D } from './IVector3D'; import { Vector3d } from './Vector3d'; @@ -430,4 +430,4 @@ export class RoomGeometry implements IRoomGeometry { this.scale = RoomGeometry.SCALE_ZOOMED_IN; } -} \ No newline at end of file +} diff --git a/src/room/utils/SpriteUtilities.ts b/src/room/utils/SpriteUtilities.ts index 7513d505..00a7186d 100644 --- a/src/room/utils/SpriteUtilities.ts +++ b/src/room/utils/SpriteUtilities.ts @@ -1,4 +1,4 @@ -import { BLEND_MODES } from 'pixi.js'; +import { BLEND_MODES } from '@pixi/constants'; export class SpriteUtilities { @@ -13,4 +13,4 @@ export class SpriteUtilities return BLEND_MODES.NORMAL; } -} \ No newline at end of file +}