mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-19 06:46:28 +01:00
Updates
This commit is contained in:
parent
d2cf15c471
commit
3ae4faf668
@ -2,5 +2,4 @@ import { Sprite as SpriteBase } from '@pixi/sprite';
|
|||||||
|
|
||||||
export class NitroSprite extends SpriteBase
|
export class NitroSprite extends SpriteBase
|
||||||
{
|
{
|
||||||
public name: string;
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import { BatchRenderer, Renderer } from '@pixi/core';
|
|||||||
import { Extract } from '@pixi/extract';
|
import { Extract } from '@pixi/extract';
|
||||||
import { InteractionManager } from '@pixi/interaction';
|
import { InteractionManager } from '@pixi/interaction';
|
||||||
import { AppLoaderPlugin, Loader } from '@pixi/loaders';
|
import { AppLoaderPlugin, Loader } from '@pixi/loaders';
|
||||||
|
import '@pixi/mixin-get-child-by-name';
|
||||||
import { ParticleRenderer } from '@pixi/particle-container';
|
import { ParticleRenderer } from '@pixi/particle-container';
|
||||||
import { Prepare } from '@pixi/prepare';
|
import { Prepare } from '@pixi/prepare';
|
||||||
import { TilingSpriteRenderer } from '@pixi/sprite-tiling';
|
import { TilingSpriteRenderer } from '@pixi/sprite-tiling';
|
||||||
|
@ -32,4 +32,12 @@ export class RenderRoomMessageComposer implements IMessageComposer<ConstructorPa
|
|||||||
|
|
||||||
this._data.push(binaryData.byteLength, binaryData.buffer);
|
this._data.push(binaryData.byteLength, binaryData.buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public assignBase64(base64: string):void
|
||||||
|
{
|
||||||
|
const base64Data = base64.split(',')[1];
|
||||||
|
const binaryData = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0));
|
||||||
|
|
||||||
|
this._data.push(binaryData.byteLength, binaryData.buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,8 @@ export interface IRoomEngine extends INitroManager
|
|||||||
processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean;
|
processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean;
|
||||||
dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void;
|
dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void;
|
||||||
createTextureFromRoom(roomId: number, canvasId?: number, bounds?: Rectangle): RenderTexture;
|
createTextureFromRoom(roomId: number, canvasId?: number, bounds?: Rectangle): RenderTexture;
|
||||||
saveTextureAsScreenshot(texture: RenderTexture, saveAsThumbnail?: boolean): void
|
saveTextureAsScreenshot(texture: RenderTexture, saveAsThumbnail?: boolean): void;
|
||||||
|
saveBase64AsScreenshot(base64: string, saveAsThumbnail?: boolean): void;
|
||||||
modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean;
|
modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean;
|
||||||
deleteRoomObject(objectId: number, objectCategory: number): boolean;
|
deleteRoomObject(objectId: number, objectCategory: number): boolean;
|
||||||
sessionDataManager: ISessionDataManager;
|
sessionDataManager: ISessionDataManager;
|
||||||
|
@ -3316,21 +3316,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
|
|
||||||
if(!displayObject) return null;
|
if(!displayObject) return null;
|
||||||
|
|
||||||
let index = (displayObject.children.length - 1);
|
return ((displayObject.getChildByName(RoomEngine.OVERLAY) as NitroSprite) || null);
|
||||||
|
|
||||||
while(index >= 0)
|
|
||||||
{
|
|
||||||
const child = (displayObject.getChildAt(index) as NitroSprite);
|
|
||||||
|
|
||||||
if(child)
|
|
||||||
{
|
|
||||||
if(child.name === RoomEngine.OVERLAY) return child;
|
|
||||||
}
|
|
||||||
|
|
||||||
index--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private removeOverlayIconSprite(k: NitroSprite, _arg_2: string): boolean
|
private removeOverlayIconSprite(k: NitroSprite, _arg_2: string): boolean
|
||||||
@ -3502,6 +3488,18 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
this._communication.connection.send(composer);
|
this._communication.connection.send(composer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public saveBase64AsScreenshot(base64: string, saveAsThumbnail: boolean = false): void
|
||||||
|
{
|
||||||
|
let composer: RenderRoomMessageComposer = null;
|
||||||
|
|
||||||
|
if(saveAsThumbnail) composer = new RenderRoomThumbnailMessageComposer();
|
||||||
|
else composer = new RenderRoomMessageComposer();
|
||||||
|
|
||||||
|
composer.assignBase64(base64);
|
||||||
|
|
||||||
|
this._communication.connection.send(composer);
|
||||||
|
}
|
||||||
|
|
||||||
public objectsInitialized(k: string): void
|
public objectsInitialized(k: string): void
|
||||||
{
|
{
|
||||||
const roomId = this.getRoomIdFromString(k);
|
const roomId = this.getRoomIdFromString(k);
|
||||||
|
Loading…
Reference in New Issue
Block a user