Fix IsometricImageFurniVisualization

This commit is contained in:
Bill 2021-12-08 22:43:09 -05:00
parent 4e431c6cd3
commit fda5ac1054

View File

@ -1,7 +1,6 @@
import { Resource, Texture } from '@pixi/core'; import { Resource, Texture } from '@pixi/core';
import { Graphics } from '@pixi/graphics';
import { Matrix } from '@pixi/math'; import { Matrix } from '@pixi/math';
import { NitroContainer, NitroRectangle, NitroSprite } from '../../../../../core'; import { NitroRectangle, NitroSprite } from '../../../../../core';
import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset'; import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset';
import { TextureUtils } from '../../../../../room/utils/TextureUtils'; import { TextureUtils } from '../../../../../room/utils/TextureUtils';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
@ -127,34 +126,16 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
matrix.ty = 0; matrix.ty = 0;
} }
const sprite = new NitroSprite(texture);
if(this._hasOutline) if(this._hasOutline)
{ {
const container = new NitroContainer(); //
const sprite = new NitroSprite(texture);
sprite.transform.setFromMatrix(matrix);
const border = new Graphics()
.beginFill(0x000000)
.setMatrix(matrix)
.drawRect(0, 0, texture.width + 2, texture.height + 2)
.endFill();
//border.skew.y = ((this.direction === 2) ? -0.5 : ((this.direction === 0) || (this.direction === 4)) ? 0.5 : 0);
container.addChild(border);
//container.addChild(sprite);
return TextureUtils.generateTexture(container);
} }
else
{
const sprite = new NitroSprite(texture);
sprite.transform.setFromMatrix(matrix); sprite.transform.setFromMatrix(matrix);
return TextureUtils.generateTexture(sprite, new NitroRectangle(0, 0, (asset.width + 2), (asset.height + 2))); return TextureUtils.generateTexture(sprite, new NitroRectangle(0, 0, (asset.width + 2), (asset.height + 2)));
}
} }
protected getSpriteAssetName(scale: number, layerId: number): string protected getSpriteAssetName(scale: number, layerId: number): string