* 初始化数据和运行程序
()
| 111 | * 初始化数据和运行程序 |
| 112 | */ |
| 113 | protected init(): void { |
| 114 | this.ownResizeEvent() |
| 115 | this.optionsNormalize() |
| 116 | |
| 117 | if (this.options.range > 0) { |
| 118 | // 定位点坐标 |
| 119 | this.positionX = Math.random() * this.canvasWidth |
| 120 | this.positionY = Math.random() * this.canvasHeight |
| 121 | this.defineLineShape() |
| 122 | this.positionEvent() |
| 123 | } |
| 124 | |
| 125 | // 初始化鼠标在视差上的坐标 |
| 126 | this.mouseX = this.mouseY = 0 |
| 127 | this.parallaxEvent() |
| 128 | |
| 129 | // 创建粒子 |
| 130 | this.createDots() |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * 标准化配置参数,参考 calcQuantity 方法描述。 |
nothing calls this directly
no test coverage detected