You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆙 Fixed the Door not visable when window is on wall
This commit is contained in:
@@ -5,7 +5,7 @@ import { RoomObjectUpdateMessage } from './RoomObjectUpdateMessage';
|
||||
export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage
|
||||
{
|
||||
public static ADD_MASK: string = 'RORMUM_ADD_MASK';
|
||||
public static REMOVE_MASK: string = 'RORMUM_ADD_MASK';
|
||||
public static REMOVE_MASK: string = 'RORMUM_REMOVE_MASK';
|
||||
public static DOOR: string = 'door';
|
||||
public static WINDOW: string = 'window';
|
||||
public static HOLE: string = 'hole';
|
||||
|
||||
@@ -812,6 +812,24 @@ export class RoomPlane implements IRoomPlane
|
||||
layerContainer.destroy({ children: true });
|
||||
}
|
||||
|
||||
private applyPlaneSpriteMasksTo(container: Container): void
|
||||
{
|
||||
if(!this._planeSprite || !this._planeSprite.children) return;
|
||||
|
||||
for(const child of this._planeSprite.children)
|
||||
{
|
||||
if(child instanceof Sprite)
|
||||
{
|
||||
const maskClone = new Sprite(child.texture);
|
||||
maskClone.position.copyFrom(child.position);
|
||||
maskClone.scale.copyFrom(child.scale);
|
||||
container.addChild(maskClone);
|
||||
}
|
||||
}
|
||||
|
||||
if(this._maskFilter && (container.children.length > 1)) container.filters = [this._maskFilter];
|
||||
}
|
||||
|
||||
private renderBackgroundColor(): void
|
||||
{
|
||||
if(!this._planeTexture || this._landscapeBackgroundColor === null) return;
|
||||
@@ -828,6 +846,8 @@ export class RoomPlane implements IRoomPlane
|
||||
const colorContainer = new Container();
|
||||
colorContainer.addChild(colorGraphics);
|
||||
|
||||
this.applyPlaneSpriteMasksTo(colorContainer);
|
||||
|
||||
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
|
||||
|
||||
GetRenderer().render({
|
||||
@@ -869,6 +889,8 @@ export class RoomPlane implements IRoomPlane
|
||||
const colorContainer = new Container();
|
||||
colorContainer.addChild(colorGraphics);
|
||||
|
||||
this.applyPlaneSpriteMasksTo(colorContainer);
|
||||
|
||||
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
|
||||
|
||||
GetRenderer().render({
|
||||
|
||||
Reference in New Issue
Block a user