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
d2cf15c471
commit
3ae4faf668
@ -2,5 +2,4 @@ import { Sprite as SpriteBase } from '@pixi/sprite';
|
||||
|
||||
export class NitroSprite extends SpriteBase
|
||||
{
|
||||
public name: string;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import { BatchRenderer, Renderer } from '@pixi/core';
|
||||
import { Extract } from '@pixi/extract';
|
||||
import { InteractionManager } from '@pixi/interaction';
|
||||
import { AppLoaderPlugin, Loader } from '@pixi/loaders';
|
||||
import '@pixi/mixin-get-child-by-name';
|
||||
import { ParticleRenderer } from '@pixi/particle-container';
|
||||
import { Prepare } from '@pixi/prepare';
|
||||
import { TilingSpriteRenderer } from '@pixi/sprite-tiling';
|
||||
|
@ -32,4 +32,12 @@ export class RenderRoomMessageComposer implements IMessageComposer<ConstructorPa
|
||||
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
deleteRoomObject(objectId: number, objectCategory: number): boolean;
|
||||
sessionDataManager: ISessionDataManager;
|
||||
|
@ -3316,21 +3316,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
|
||||
if(!displayObject) return null;
|
||||
|
||||
let index = (displayObject.children.length - 1);
|
||||
|
||||
while(index >= 0)
|
||||
{
|
||||
const child = (displayObject.getChildAt(index) as NitroSprite);
|
||||
|
||||
if(child)
|
||||
{
|
||||
if(child.name === RoomEngine.OVERLAY) return child;
|
||||
}
|
||||
|
||||
index--;
|
||||
}
|
||||
|
||||
return null;
|
||||
return ((displayObject.getChildByName(RoomEngine.OVERLAY) as NitroSprite) || null);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
const roomId = this.getRoomIdFromString(k);
|
||||
|
Loading…
Reference in New Issue
Block a user