setStartPositionRectangle 设置初始位置 - 矩形发射区域
setStartPositionRectangle
类型: MethodDeclaration
所属类: ParticleElement
定义位置: animation.ts
描述
设置初始位置 - 矩形发射区域
返回值
类型: void
源代码
位置: 第 2300 行
private setStartPositionRectangle(): void {
    const emitter = this.emitter
    const area = this.data.area as ParticleEmissionAreaRectangle
    const pos = this.getAreaPosition()
    const x = emitter.startX + pos[0]
    const y = emitter.startY + pos[1]
    const wh = area.width * emitter.scale / 2
    const hh = area.height * emitter.scale / 2
    this.x = Math.randomBetween(x - wh, x + wh)
    this.y = Math.randomBetween(y - hh, y + hh)
    this.transformStartPosition()
  }
文档生成时间:2025/7/21 20:53:39