Junjie
2023-12-18 2d36c9a2951ded9f74dcc1c7a37eaca86bc40591
#map latest test
1个文件已修改
10 ■■■■ 已修改文件
src/main/webapp/views/console4.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/console4.html
@@ -249,8 +249,8 @@
                const shuttle = new PIXI.Sprite(resources.shuttle.texture);
                shuttle.width = width
                shuttle.height = height
                shuttle.x = item.wcsPoint.y * width;//更新坐标x
                shuttle.y = item.wcsPoint.x * height;//更新坐标y
                shuttle.x = item.wcsPoint.x * width;//更新坐标x
                shuttle.y = item.wcsPoint.y * height;//更新坐标y
                shuttle.updateMoveStatus = true;//动画执行完成
                shuttle.interactive = true; // 必须要设置才能接收事件
                shuttle.buttonMode = true; // 让光标在hover时变为手型指针
@@ -655,11 +655,11 @@
        if (shuttle.updateMoveStatus) {//动画执行完成才可继续执行动画
          shuttle.updateMoveStatus = false;//动画执行中
          // 计算两点之间的距离1
          const distance = Math.sqrt(Math.pow((item.point.x * width) - shuttle.x, 2) + Math.pow((item.point.y * height) - shuttle.y, 2));
          const distance = Math.sqrt(Math.pow((item.wcsPoint.x * width) - shuttle.x, 2) + Math.pow((item.wcsPoint.y * height) - shuttle.y, 2));
          gsap.killTweensOf(shuttle); // 杀死所有针对".class"的动画
          gsap.to(shuttle, {
            x: item.point.x * width, // 目标位置
            y: item.point.y * height, // 目标位置
            x: item.wcsPoint.x * width, // 目标位置
            y: item.wcsPoint.y * height, // 目标位置
            duration: distance / 100, // 动画持续时间(秒)
            ease: "power1.inOut", // 缓动类型
            onComplete: () => {