From 02f7801f2dfc4517e5aaa35dc3ff39b66d95799a Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Mon, 21 Sep 2020 11:30:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=A4=A7=E5=B0=8F=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index e56d813..79a0531 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -263,13 +263,16 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (item.assetData.FixedSize) { const data = 1 / scale; item.scale.set(data); + } else { + const data = 1 / scale; + item.text.scale.set(data); } } else if (item instanceof MultipointIcon) { const data = 1 / scale; - item.text.scale.set(scale); + item.text.scale.set(data); } else if (item instanceof PolygonIcon) { const data = 1 / scale; - item.text.scale.set(scale); + item.text.scale.set(data); } }); }); @@ -448,9 +451,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV IsFromBuilding: false, GameMode: 2 }; - const tempCar = new SinglePointIcon(tempData, this); + const tempCar = new Car(tempData, this); tempCar.setParent(this.app.stage); - tempCar.position.set(300, 66); + tempCar.position.set(25, 25); const tempData2 = { TemplateId: null, @@ -493,14 +496,15 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV IsFromBuilding: false, GameMode: 2 }; - const tempCar2 = new SinglePointIcon(tempData2, this); + const tempCar2 = new Car(tempData2, this); tempCar2.setParent(this.app.stage); - tempCar2.position.set(300, 148); + tempCar2.position.set(25, 50); this.cancelPaint(); this.paintMode = PaintMode.connection; this.previewSinglePointIcon.texture = PIXI.Texture.from('./assets/images/水罐消防车.png'); } + /** * * @param id 图标ID @@ -785,7 +789,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ public destroyBackgroundImage(): void { this.app.stage.removeChild(this.backgroundImage); - this.removeAllListeners('backgroundScale'); + // this.removeAllListeners('backgroundScale'); } /** * 设置背景图缩放 @@ -1062,7 +1066,7 @@ export class SinglePointIcon extends PIXI.Container { wordWrapWidth: 100, }); - private text = new PIXI.Text(this.assetData.Name + public text = new PIXI.Text(this.assetData.Name + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); private image = PIXI.Sprite.from(this.assetData.ImageUrl); @@ -1646,7 +1650,9 @@ export class PolygonIcon extends PIXI.Container { this.polygonGraphics.endFill(); } } +export class Car extends SinglePointIcon { +} export class Conection extends PIXI.Container { }