mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-19 06:46:28 +01:00
Update visualizations
This commit is contained in:
parent
03ef597a06
commit
53d06531cb
@ -206,6 +206,10 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic
|
|||||||
Nitro.instance.roomEngine.roomContentLoader.createGifCollection(imageUrl, textures, durations);
|
Nitro.instance.roomEngine.roomContentLoader.createGifCollection(imageUrl, textures, durations);
|
||||||
|
|
||||||
this.processUpdateMessage(new ObjectAdUpdateMessage(ObjectAdUpdateMessage.IMAGE_LOADED));
|
this.processUpdateMessage(new ObjectAdUpdateMessage(ObjectAdUpdateMessage.IMAGE_LOADED));
|
||||||
|
})
|
||||||
|
.catch(error =>
|
||||||
|
{
|
||||||
|
this.processUpdateMessage(new ObjectAdUpdateMessage(ObjectAdUpdateMessage.IMAGE_LOADING_FAILED));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2,7 +2,6 @@ import { RenderTexture, Resource, Texture } from '@pixi/core';
|
|||||||
import { Matrix } from '@pixi/math';
|
import { Matrix } from '@pixi/math';
|
||||||
import { NitroSprite } from '../../../../../core/utils/proxy/NitroSprite';
|
import { NitroSprite } from '../../../../../core/utils/proxy/NitroSprite';
|
||||||
import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset';
|
import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset';
|
||||||
import { TextureUtils } from '../../../../../room/utils/TextureUtils';
|
|
||||||
import { Nitro } from '../../../../Nitro';
|
import { Nitro } from '../../../../Nitro';
|
||||||
import { FurnitureBBVisualization } from './FurnitureBBVisualization';
|
import { FurnitureBBVisualization } from './FurnitureBBVisualization';
|
||||||
import { FurnitureBrandedImageVisualization } from './FurnitureBrandedImageVisualization';
|
import { FurnitureBrandedImageVisualization } from './FurnitureBrandedImageVisualization';
|
||||||
@ -63,26 +62,19 @@ export class FurnitureIsometricBBVisualization extends FurnitureBBVisualization
|
|||||||
|
|
||||||
const sprite = new NitroSprite(texture);
|
const sprite = new NitroSprite(texture);
|
||||||
|
|
||||||
const x = asset.x;
|
|
||||||
const y = asset.y;
|
|
||||||
const flipH = asset.flipH;
|
|
||||||
const flipV = asset.flipV;
|
|
||||||
|
|
||||||
const renderTexture = RenderTexture.create({
|
const renderTexture = RenderTexture.create({
|
||||||
width: asset.width,
|
width: (asset.width + matrix.tx),
|
||||||
height: asset.height
|
height: (asset.height + matrix.ty)
|
||||||
});
|
});
|
||||||
|
|
||||||
Nitro.instance.renderer.render(sprite, {
|
Nitro.instance.renderer.render(sprite, {
|
||||||
renderTexture: renderTexture,
|
renderTexture,
|
||||||
clear: true,
|
clear: true,
|
||||||
transform: matrix
|
transform: matrix
|
||||||
});
|
});
|
||||||
|
|
||||||
const newTexture = TextureUtils.generateTexture(sprite);
|
|
||||||
|
|
||||||
this.asset.disposeAsset(`${ this._imageUrl }_${ i }`);
|
this.asset.disposeAsset(`${ this._imageUrl }_${ i }`);
|
||||||
this.asset.addAsset(`${ this._imageUrl }_${ i }`, newTexture, true, x, y, flipH, flipV);
|
this.asset.addAsset(`${ this._imageUrl }_${ i }`, renderTexture, true, asset.x, asset.y, asset.flipH, asset.flipV);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._needsTransform = false;
|
this._needsTransform = false;
|
||||||
@ -124,17 +116,19 @@ export class FurnitureIsometricBBVisualization extends FurnitureBBVisualization
|
|||||||
|
|
||||||
const sprite = new NitroSprite(texture);
|
const sprite = new NitroSprite(texture);
|
||||||
|
|
||||||
sprite.transform.setFromMatrix(matrix);
|
const renderTexture = RenderTexture.create({
|
||||||
|
width: (asset.width + matrix.tx),
|
||||||
|
height: (asset.height + matrix.ty)
|
||||||
|
});
|
||||||
|
|
||||||
const x = asset.x;
|
Nitro.instance.renderer.render(sprite, {
|
||||||
const y = asset.y;
|
renderTexture,
|
||||||
const flipH = asset.flipH;
|
clear: true,
|
||||||
const flipV = asset.flipV;
|
transform: matrix
|
||||||
|
});
|
||||||
const newTexture = TextureUtils.generateTexture(sprite);
|
|
||||||
|
|
||||||
this.asset.disposeAsset(`${ this._imageUrl }_0`);
|
this.asset.disposeAsset(`${ this._imageUrl }_0`);
|
||||||
this.asset.addAsset(`${ this._imageUrl }_0`, newTexture, true, x, y, flipH, flipV);
|
this.asset.addAsset(`${ this._imageUrl }_0`, renderTexture, true, sprite.x, sprite.y, asset.flipH, asset.flipV);
|
||||||
|
|
||||||
this._needsTransform = false;
|
this._needsTransform = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user