This commit is contained in:
Bill 2021-08-02 23:48:00 -04:00
parent 871a3d27e1
commit 4e4c4e4ce6
12 changed files with 34 additions and 19 deletions

View File

@ -1,4 +1,6 @@
import { BaseTexture, ILoaderResource, Loader, LoaderResource, Resource, Spritesheet, Texture } from 'pixi.js';
import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Loader, LoaderResource } from '@pixi/loaders';
import { Spritesheet } from '@pixi/spritesheet';
import { IGraphicAsset } from '../../room';
import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection';
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
@ -110,7 +112,7 @@ export class AssetManager extends Disposable implements IAssetManager
let totalDownloaded = 0;
const onDownloaded = (loader: Loader, resource: ILoaderResource, flag: boolean) =>
const onDownloaded = (loader: Loader, resource: LoaderResource, flag: boolean) =>
{
if(loader) loader.destroy();
@ -140,7 +142,7 @@ export class AssetManager extends Disposable implements IAssetManager
crossOrigin: 'anonymous',
xhrType: url.endsWith('.nitro') ? LoaderResource.XHR_RESPONSE_TYPE.BUFFER : LoaderResource.XHR_RESPONSE_TYPE.JSON
})
.use((resource: ILoaderResource, next: Function) =>
.use((resource: LoaderResource, next: Function) =>
{
this.assetLoader(loader, resource, onDownloaded);
@ -152,7 +154,7 @@ export class AssetManager extends Disposable implements IAssetManager
return true;
}
private assetLoader(loader: Loader, resource: ILoaderResource, onDownloaded: Function): void
private assetLoader(loader: Loader, resource: LoaderResource, onDownloaded: Function): void
{
if(!resource || resource.error)
{

View File

@ -1,5 +1,6 @@
import { Resource, Spritesheet, Texture } from 'pixi.js';
import { Resource, Texture } from '@pixi/core';
import { Spritesheet } from '@pixi/spritesheet';
import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset';
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
import { IAssetData } from './interfaces';

View File

@ -1,5 +1,5 @@
import { BaseTexture } from '@pixi/core';
import { Data, inflate } from 'pako';
import { BaseTexture } from 'pixi.js';
import { BinaryReader } from '../communication/codec/BinaryReader';
export class NitroBundle

View File

@ -1,3 +1,3 @@
import { IPoint } from 'pixi.js';
import { IPoint } from '@pixi/math';
export type INitroPoint = IPoint;
export type INitroPoint = IPoint

View File

@ -1,4 +1,4 @@
import { Container } from 'pixi.js';
import { Container } from '@pixi/display';
export class NitroContainer extends Container
{}

View File

@ -1,4 +1,4 @@
import { Filter } from 'pixi.js';
import { Filter } from '@pixi/core';
export class NitroFilter extends Filter
{}

View File

@ -1,4 +1,4 @@
import { Point } from 'pixi.js';
import { Point } from '@pixi/math';
import { INitroPoint } from './INitroPoint';
export class NitroPoint extends Point implements INitroPoint

View File

@ -1,4 +1,4 @@
import { Rectangle } from 'pixi.js';
import { Rectangle } from '@pixi/math';
export class NitroRectangle extends Rectangle
{}

View File

@ -1,4 +1,6 @@
import { Sprite } from 'pixi.js';
import { Sprite as SpriteBase } from '@pixi/sprite';
export class NitroSprite extends Sprite
{}
export class NitroSprite extends SpriteBase
{
public name: string;
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Texture } from '@pixi/core';
export class NitroTexture extends Texture
{}

View File

@ -1,4 +1,5 @@
import { Application } from 'pixi.js';
import { Application } from '@pixi/app';
import { Ticker } from '@pixi/ticker';
import { IEventDispatcher } from '../core/events/IEventDispatcher';
import { ILinkEventTracker } from '../core/events/ILinkEventTracker';
import { IWorkerEventTracker } from '../core/events/IWorkerEventTracker';
@ -42,6 +43,7 @@ export interface INitro extends Application
cameraManager: IRoomCameraWidgetManager;
width: number;
height: number;
ticker: Ticker;
time: number;
isReady: boolean;
isDisposed: boolean;

View File

@ -1,5 +1,8 @@
import { Application, IApplicationOptions, SCALE_MODES, settings } from 'pixi.js';
import { INitroManager } from '..';
import { Application, IApplicationOptions } from '@pixi/app';
import { SCALE_MODES } from '@pixi/constants';
import { settings } from '@pixi/settings';
import { Ticker } from '@pixi/ticker';
import { INitroManager } from '../core';
import { ConfigurationEvent } from '../core/configuration/ConfigurationEvent';
import { EventDispatcher } from '../core/events/EventDispatcher';
import { IEventDispatcher } from '../core/events/IEventDispatcher';
@ -405,6 +408,11 @@ export class Nitro extends Application implements INitro
return (this.renderer.height / this.renderer.resolution);
}
public get ticker(): Ticker
{
return Ticker.shared;
}
public get time(): number
{
return this.ticker.lastTime;