| | |
| | | const shuttle = new PIXI.Sprite(resources.shuttle.texture); |
| | | shuttle.width = width |
| | | shuttle.height = height |
| | | shuttle.x = item.wcsPoint.x * width;//更新坐标x |
| | | shuttle.y = item.wcsPoint.y * height;//更新坐标y |
| | | shuttle.x = (item.wcsPoint.y - 0) * width;//更新坐标x |
| | | shuttle.y = (item.wcsPoint.x - 1) * height;//更新坐标y |
| | | shuttle.updateMoveStatus = true;//动画执行完成 |
| | | shuttle.interactive = true; // 必须要设置才能接收事件 |
| | | shuttle.buttonMode = true; // 让光标在hover时变为手型指针 |
| | |
| | | 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.wcsPoint.x * width, // 目标位置 |
| | | y: item.wcsPoint.y * height, // 目标位置 |
| | | duration: distance / 100, // 动画持续时间(秒) |
| | | x: (item.wcsPoint.y - 0) * width, // 目标位置 |
| | | y: (item.wcsPoint.x - 1) * height, // 目标位置 |
| | | duration: 0.2, // 动画持续时间(秒) |
| | | ease: "power1.inOut", // 缓动类型 |
| | | onComplete: () => { |
| | | shuttle.updateMoveStatus = true;//动画执行完成 |
| | |
| | | moveAdvancePath.forEach((path, idx) => { |
| | | let locNo = that.getLocNoByXYZ(path.x, path.y, path.z); |
| | | if (!pixiShuttleMoveAdvancePathMap.has(locNo)) { |
| | | let graphics = getGraphics(0x9966ff, width, height, path.y * width, path.x * height); |
| | | let graphics = getGraphics(0x9966ff, width, height, path.y * width, (path.x - 1) * height); |
| | | let shuttleNos = [shuttleNo]; |
| | | // 创建文本对象 |
| | | const style = new PIXI.TextStyle({ |