From babcf4f0462ed0945fcefe59b1666d709910872c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 三月 2024 16:00:55 +0800
Subject: [PATCH] Merge branch 'master' of http://47.97.1.152:5880/r/zy-asrs-master
---
zy-asrs-flow/src/pages/map/player.js | 41 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index abb6437..4b5a39b 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -77,6 +77,7 @@
fontFamily: 'MicrosoftYaHei',
fontWeight: 'bold',
});
+ coordinatesText.name = 'xyStr'
coordinatesText.position.set(10, 10);
this.app.stage.addChild(coordinatesText);
@@ -86,6 +87,44 @@
coordinatesText.text = `{ x: ${mouseX.toFixed(2)}, y: ${mouseY.toFixed(2)} }`;
};
this.app.view.addEventListener('mousemove', mouseMoveInfoTextHandler);
+ }
+
+ showGridlines = () => {
+ if (!this.gridLineContainer) {
+ this.gridLineContainer = generatePixiContainer('gridLineContainer');
+ this.app.stage.addChild(this.gridLineContainer);
+ }
+
+ const inte = 30;
+ const lineDefaultAlpha = .5;;
+ const lineDefaultColor = 0x000000;
+ for (let i = 0; i < this.app.view.width / inte; i++) {
+ const graphics = new PIXI.Graphics();
+ graphics.lineStyle(.3, lineDefaultColor, lineDefaultAlpha);
+ graphics.beginFill(lineDefaultColor);
+ graphics.moveTo(i * inte, 0);
+ graphics.lineTo(i * inte, this.app.view.height);
+ graphics.endFill();
+ this.gridLineContainer.addChild(graphics);
+ }
+
+ for (let i = 0; i < this.app.view.height / inte; i++) {
+ const graphics = new PIXI.Graphics();
+ graphics.lineStyle(.3, lineDefaultColor, lineDefaultAlpha);
+ graphics.beginFill(lineDefaultColor);
+ graphics.moveTo(0, i * inte);
+ graphics.lineTo(this.app.view.width, i * inte);
+ graphics.endFill();
+
+ this.gridLineContainer.addChild(graphics);
+ }
+ }
+
+ hideGridlines = () => {
+ if (this.gridLineContainer) {
+ this.app.stage.removeChild(this.gridLineContainer);
+ this.gridLineContainer = null;
+ }
}
appTicker = () => {
@@ -99,7 +138,7 @@
background: dark ? '#f1f2f6' : '#f1f2f6',
antialias: true,
})
- app.stage.eventMode = 'auto';
+ app.stage.eventMode = 'static';
app.stage.hitArea = app.screen;
return app;
}
--
Gitblit v1.9.1