From 9dd2b6186b18c6d3281fe8c48f1ff4c2bc1fc8d7 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 14 十月 2024 14:00:56 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/tool.js | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/zy-acs-flow/src/map/tool.js b/zy-acs-flow/src/map/tool.js index 7bcd534..5a8e868 100644 --- a/zy-acs-flow/src/map/tool.js +++ b/zy-acs-flow/src/map/tool.js @@ -76,11 +76,15 @@ default: break; } + if (sprite) { + sprite.blendMode = PIXI.BLEND_MODES.MULTIPLY; + } return sprite; } export const initSprite = (sprite, type) => { sprite.anchor.set(0.5); + // sprite.alpha = 1; sprite.cursor = 'pointer'; sprite.eventMode = 'static'; sprite.data = { @@ -245,7 +249,6 @@ } } - export const showSelectedEffect = (sprite) => { if (!sprite?.texture || !sprite?.texture?.valid) { return; @@ -324,6 +327,20 @@ effectHalfCircle.position.set(sprite.x, sprite.y); } +export const rotationToNum = (rotation) => { + let res = rotation * 180 / Math.PI; + if (res < 0) { + res += 360; + } else if (res > 360) { + res -= 360; + } + return res; +} + +export const rotationParseNum = (num) => { + return num * Math.PI / 180; +} + export const incrementSpriteNo = (str, incrementValue) => { const match = str.match(/(\D*)(\d+)/); if (match) { -- Gitblit v1.9.1