You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.6 KiB
59 lines
2.6 KiB
// import { OldFilmFilter } from 'pixi-filters'; |
|
// import { WorkingAreaComponent } from '../working-area.component'; |
|
// import { PaintMode } from './paintModel'; |
|
// import { SinglePointIcon } from './axImageShape'; |
|
// import * as PIXI from 'pixi.js'; |
|
|
|
// /** |
|
// * 汽车放置区域 |
|
// */ |
|
// export class PutCarArea extends PIXI.Container { |
|
// public polygonGraphics: PIXI.Graphics = new PIXI.Graphics(); |
|
// constructor(public assetData: any, private workingArea: WorkingAreaComponent) { |
|
// super(); |
|
// this.name = this.assetData.Id; |
|
// this.x = this.assetData.Point.x; |
|
// this.y = this.assetData.Point.y; |
|
// this.workingArea.backgroundImage.addChild(this); |
|
// this.sortableChildren = true; |
|
|
|
// // 填充多边形 |
|
|
|
// const color: number = this.assetData.Color.substring(0, 7).replace('#', '0x'); |
|
// const angle: number = parseInt(this.assetData.Color.substring(7), 16) / 255; |
|
// this.polygonGraphics.beginFill(color, angle); |
|
// this.polygonGraphics.drawPolygon(this.assetData.MultiPoint); |
|
// this.polygonGraphics.endFill(); |
|
// this.addChild(this.polygonGraphics); |
|
// // 添加选中事件 |
|
// this.polygonGraphics.interactive = true; |
|
// this.polygonGraphics |
|
// .on('pointerdown', (event) => { |
|
// if (this.workingArea.getPaintMode() === PaintMode.Car) { |
|
// this.workingArea.selectCar.Point = |
|
// new PIXI.Point(this.workingArea.previewSinglePointIcon.x, this.workingArea.previewSinglePointIcon.y); |
|
// this.workingArea.selectCar.Angle = this.assetData.Direction; |
|
// const car = new SinglePointIcon(this.workingArea.selectCar, this.workingArea); |
|
// this.workingArea.setPaintMode(PaintMode.endPaint); |
|
// } |
|
// }) |
|
// .on('pointerup', (event) => { |
|
|
|
// }) |
|
// .on('pointerupoutside', (event) => { |
|
|
|
// }) |
|
// .on('pointerover', (event) => { |
|
// this.workingArea.previewSinglePointIcon.filters = null; |
|
// this.workingArea.previewSinglePointIcon.zIndex = this.zIndex + 1; |
|
// // 设置车辆方向 |
|
// this.workingArea.previewSinglePointIcon.angle = this.assetData.Direction; |
|
// console.log(this.assetData.Name); |
|
// }) |
|
// .on('pointerout', (event) => { |
|
// this.workingArea.previewSinglePointIcon.filters = [ |
|
// new OldFilmFilter() |
|
// ]; |
|
// }); |
|
// } |
|
// }
|
|
|