mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 22:36:27 +01:00
Updates
This commit is contained in:
parent
871a3d27e1
commit
4e4c4e4ce6
@ -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 { IGraphicAsset } from '../../room';
|
||||||
import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection';
|
import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection';
|
||||||
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
|
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
|
||||||
@ -110,7 +112,7 @@ export class AssetManager extends Disposable implements IAssetManager
|
|||||||
|
|
||||||
let totalDownloaded = 0;
|
let totalDownloaded = 0;
|
||||||
|
|
||||||
const onDownloaded = (loader: Loader, resource: ILoaderResource, flag: boolean) =>
|
const onDownloaded = (loader: Loader, resource: LoaderResource, flag: boolean) =>
|
||||||
{
|
{
|
||||||
if(loader) loader.destroy();
|
if(loader) loader.destroy();
|
||||||
|
|
||||||
@ -140,7 +142,7 @@ export class AssetManager extends Disposable implements IAssetManager
|
|||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
xhrType: url.endsWith('.nitro') ? LoaderResource.XHR_RESPONSE_TYPE.BUFFER : LoaderResource.XHR_RESPONSE_TYPE.JSON
|
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);
|
this.assetLoader(loader, resource, onDownloaded);
|
||||||
|
|
||||||
@ -152,7 +154,7 @@ export class AssetManager extends Disposable implements IAssetManager
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private assetLoader(loader: Loader, resource: ILoaderResource, onDownloaded: Function): void
|
private assetLoader(loader: Loader, resource: LoaderResource, onDownloaded: Function): void
|
||||||
{
|
{
|
||||||
if(!resource || resource.error)
|
if(!resource || resource.error)
|
||||||
{
|
{
|
||||||
|
@ -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 { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset';
|
||||||
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
|
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
|
||||||
import { IAssetData } from './interfaces';
|
import { IAssetData } from './interfaces';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
import { BaseTexture } from '@pixi/core';
|
||||||
import { Data, inflate } from 'pako';
|
import { Data, inflate } from 'pako';
|
||||||
import { BaseTexture } from 'pixi.js';
|
|
||||||
import { BinaryReader } from '../communication/codec/BinaryReader';
|
import { BinaryReader } from '../communication/codec/BinaryReader';
|
||||||
|
|
||||||
export class NitroBundle
|
export class NitroBundle
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
import { IPoint } from 'pixi.js';
|
import { IPoint } from '@pixi/math';
|
||||||
|
|
||||||
export type INitroPoint = IPoint;
|
export type INitroPoint = IPoint
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Container } from 'pixi.js';
|
import { Container } from '@pixi/display';
|
||||||
|
|
||||||
export class NitroContainer extends Container
|
export class NitroContainer extends Container
|
||||||
{}
|
{}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Filter } from 'pixi.js';
|
import { Filter } from '@pixi/core';
|
||||||
|
|
||||||
export class NitroFilter extends Filter
|
export class NitroFilter extends Filter
|
||||||
{}
|
{}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Point } from 'pixi.js';
|
import { Point } from '@pixi/math';
|
||||||
import { INitroPoint } from './INitroPoint';
|
import { INitroPoint } from './INitroPoint';
|
||||||
|
|
||||||
export class NitroPoint extends Point implements INitroPoint
|
export class NitroPoint extends Point implements INitroPoint
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Rectangle } from 'pixi.js';
|
import { Rectangle } from '@pixi/math';
|
||||||
|
|
||||||
export class NitroRectangle extends Rectangle
|
export class NitroRectangle extends Rectangle
|
||||||
{}
|
{}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Texture } from 'pixi.js';
|
import { Texture } from '@pixi/core';
|
||||||
|
|
||||||
export class NitroTexture extends Texture
|
export class NitroTexture extends Texture
|
||||||
{}
|
{}
|
||||||
|
@ -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 { IEventDispatcher } from '../core/events/IEventDispatcher';
|
||||||
import { ILinkEventTracker } from '../core/events/ILinkEventTracker';
|
import { ILinkEventTracker } from '../core/events/ILinkEventTracker';
|
||||||
import { IWorkerEventTracker } from '../core/events/IWorkerEventTracker';
|
import { IWorkerEventTracker } from '../core/events/IWorkerEventTracker';
|
||||||
@ -42,6 +43,7 @@ export interface INitro extends Application
|
|||||||
cameraManager: IRoomCameraWidgetManager;
|
cameraManager: IRoomCameraWidgetManager;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
|
ticker: Ticker;
|
||||||
time: number;
|
time: number;
|
||||||
isReady: boolean;
|
isReady: boolean;
|
||||||
isDisposed: boolean;
|
isDisposed: boolean;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { Application, IApplicationOptions, SCALE_MODES, settings } from 'pixi.js';
|
import { Application, IApplicationOptions } from '@pixi/app';
|
||||||
import { INitroManager } from '..';
|
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 { ConfigurationEvent } from '../core/configuration/ConfigurationEvent';
|
||||||
import { EventDispatcher } from '../core/events/EventDispatcher';
|
import { EventDispatcher } from '../core/events/EventDispatcher';
|
||||||
import { IEventDispatcher } from '../core/events/IEventDispatcher';
|
import { IEventDispatcher } from '../core/events/IEventDispatcher';
|
||||||
@ -405,6 +408,11 @@ export class Nitro extends Application implements INitro
|
|||||||
return (this.renderer.height / this.renderer.resolution);
|
return (this.renderer.height / this.renderer.resolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get ticker(): Ticker
|
||||||
|
{
|
||||||
|
return Ticker.shared;
|
||||||
|
}
|
||||||
|
|
||||||
public get time(): number
|
public get time(): number
|
||||||
{
|
{
|
||||||
return this.ticker.lastTime;
|
return this.ticker.lastTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user