From 4aa8966850f73cbba83331eda7a6f85b28df5e1a Mon Sep 17 00:00:00 2001 From: ics-ikeda Date: Tue, 17 Apr 2018 18:32:53 +0900 Subject: [PATCH] =?UTF-8?q?JS=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E5=AD=90=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=82=82=E5=87=BA=E5=8A=9B=E3=81=99=E3=82=8B=E6=96=B9=E5=90=91?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/classes/colordata.html | 20 +- docs/classes/drawingdata.html | 76 +- docs/classes/particle.html | 42 +- docs/classes/particlesystem.html | 164 ++-- docs/classes/shapedata.html | 1094 +++++++++++++++++++++++++ docs/classes/shapegenerator.html | 10 +- docs/classes/shapetype.html | 1314 ++++++++++++++++++++++++++++++ docs/enums/alphacurvetype.html | 10 +- docs/examples/first-step.html | 2 +- docs/globals.html | 12 +- docs/index.html | 12 +- libs/d.ts/particlejs.d.ts | 10 +- libs/particlejs.js | 114 ++- libs/particlejs.min.js | 2 +- src/asset-shapes.js | 7 +- src/assets/shape-generator.ts | 4 +- src/particlejs.ts | 21 +- 17 files changed, 2755 insertions(+), 159 deletions(-) create mode 100644 docs/classes/shapedata.html create mode 100644 docs/classes/shapetype.html diff --git a/docs/classes/colordata.html b/docs/classes/colordata.html index 29dd7e0..446da8a 100644 --- a/docs/classes/colordata.html +++ b/docs/classes/colordata.html @@ -947,9 +947,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -1004,7 +1010,7 @@

    constructor

  • Returns ColorData

    @@ -1020,7 +1026,7 @@

    hue

    hue: number = 0
    @@ -1040,7 +1046,7 @@

    hueVariance

    hueVariance: number = 0
    @@ -1060,7 +1066,7 @@

    luminance

    luminance: number = 0
    @@ -1080,7 +1086,7 @@

    luminanceVariance

    luminanceVariance: number = 0
    @@ -1100,7 +1106,7 @@

    saturation

    saturation: number = 0
    @@ -1120,7 +1126,7 @@

    saturationVariance

    saturationVariance: number = 0
    diff --git a/docs/classes/drawingdata.html b/docs/classes/drawingdata.html index 70b1f38..a804256 100644 --- a/docs/classes/drawingdata.html +++ b/docs/classes/drawingdata.html @@ -1031,9 +1031,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -1121,7 +1127,7 @@

    constructor

  • Parameters

    @@ -1143,7 +1149,7 @@

    accelerationDirection

    accelerationDirection: number = 0
    @@ -1158,7 +1164,7 @@

    accelerationSpeed

    accelerationSpeed: number = 0
    @@ -1173,7 +1179,7 @@

    alphaCurveType

    alphaCurveType: number = AlphaCurveType.Normal
    @@ -1188,7 +1194,7 @@

    bgColor

    bgColor: string = ""
    @@ -1198,7 +1204,7 @@

    blendMode

    blendMode: boolean = true
    @@ -1213,7 +1219,7 @@

    emitFrequency

    emitFrequency: number = 0
    @@ -1228,7 +1234,7 @@

    finishAlpha

    finishAlpha: number = 0
    @@ -1243,7 +1249,7 @@

    finishAlphaVariance

    finishAlphaVariance: number = 0
    @@ -1258,7 +1264,7 @@

    finishScale

    finishScale: number = 0
    @@ -1273,7 +1279,7 @@

    finishScaleVariance

    finishScaleVariance: number = 0
    @@ -1288,7 +1294,7 @@

    friction

    friction: number = 0
    @@ -1303,7 +1309,7 @@

    height

    height: number = 0
    @@ -1313,7 +1319,7 @@

    initialDirection

    initialDirection: number = 0
    @@ -1328,7 +1334,7 @@

    initialDirectionVariance

    initialDirectionVariance: number = 0
    @@ -1343,7 +1349,7 @@

    initialSpeed

    initialSpeed: number = 0
    @@ -1358,7 +1364,7 @@

    initialSpeedVariance

    initialSpeedVariance: number = 0
    @@ -1373,7 +1379,7 @@

    lifeSpan

    lifeSpan: number = 0
    @@ -1388,7 +1394,7 @@

    lifeSpanVariance

    lifeSpanVariance: number = 0
    @@ -1403,7 +1409,7 @@

    shapeIdList

    shapeIdList: string[] = [""]
    @@ -1418,7 +1424,7 @@

    startAlpha

    startAlpha: number = 0
    @@ -1433,7 +1439,7 @@

    startAlphaVariance

    startAlphaVariance: number = 0
    @@ -1448,7 +1454,7 @@

    startColor

    startColor: ColorData = new ColorData()
    @@ -1463,7 +1469,7 @@

    startScale

    startScale: number = 0
    @@ -1478,7 +1484,7 @@

    startScaleVariance

    startScaleVariance: number = 0
    @@ -1493,7 +1499,7 @@

    startX

    startX: number = 0
    @@ -1508,7 +1514,7 @@

    startXVariance

    startXVariance: number = 0
    @@ -1523,7 +1529,7 @@

    startY

    startY: number = 0
    @@ -1538,7 +1544,7 @@

    startYVariance

    startYVariance: number = 0
    @@ -1553,7 +1559,7 @@

    width

    width: number = 0
    @@ -1563,7 +1569,7 @@

    Static ENABLE_REFLECT

    ENABLE_REFLECT: boolean = DrawingData.checkReflectEnable()
    @@ -1580,7 +1586,7 @@

    importData

  • @@ -1610,7 +1616,7 @@

    importFromJson

  • @@ -1640,7 +1646,7 @@

    Private setData

  • Parameters

    @@ -1684,7 +1690,7 @@

    Static checkReflectEna
  • Returns boolean

    diff --git a/docs/classes/particle.html b/docs/classes/particle.html index 1e3e791..c2e5619 100644 --- a/docs/classes/particle.html +++ b/docs/classes/particle.html @@ -980,9 +980,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -1055,7 +1061,7 @@

    constructor

  • Returns Particle

    @@ -1071,7 +1077,7 @@

    alphaCurveType

    alphaCurveType: number
    @@ -1086,7 +1092,7 @@

    colorCommand

    colorCommand: any
    @@ -1101,7 +1107,7 @@

    currentLife

    currentLife: number
    @@ -1116,7 +1122,7 @@

    easingAlpha

    easingAlpha: function
    @@ -1152,7 +1158,7 @@

    easingScale

    easingScale: function
    @@ -1188,7 +1194,7 @@

    finishAlpha

    finishAlpha: number
    @@ -1203,7 +1209,7 @@

    finishScale

    finishScale: number
    @@ -1218,7 +1224,7 @@

    isAlive

    isAlive: boolean
    @@ -1233,7 +1239,7 @@

    particleShape

    particleShape: Container
    @@ -1248,7 +1254,7 @@

    startAlpha

    startAlpha: number
    @@ -1263,7 +1269,7 @@

    startColor

    startColor: ColorData
    @@ -1278,7 +1284,7 @@

    startScale

    startScale: number
    @@ -1293,7 +1299,7 @@

    totalLife

    totalLife: number
    @@ -1308,7 +1314,7 @@

    vx

    vx: number
    @@ -1323,7 +1329,7 @@

    vy

    vy: number
    @@ -1338,7 +1344,7 @@

    x

    x: number
    @@ -1353,7 +1359,7 @@

    y

    y: number
    diff --git a/docs/classes/particlesystem.html b/docs/classes/particlesystem.html index c265a5c..08d5108 100644 --- a/docs/classes/particlesystem.html +++ b/docs/classes/particlesystem.html @@ -1085,9 +1085,15 @@
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -1205,7 +1211,7 @@

    constructor

  • Returns ParticleSystem

    @@ -1221,7 +1227,7 @@

    Private _activeParticles_activeParticles: Particle[] @@ -1231,7 +1237,7 @@

    Private _drawingData

    _drawingData: DrawingData
    @@ -1241,7 +1247,7 @@

    Private _frameCount

    _frameCount: number = 0
    @@ -1251,7 +1257,7 @@

    Private _particlesPool

    _particlesPool: Particle[] @@ -1261,7 +1267,7 @@

    Private _playing

    _playing: boolean
    @@ -1271,7 +1277,7 @@

    container

    container: Container
    @@ -1286,7 +1292,7 @@

    Private shapeGenerator

    shapeGenerator: ShapeGenerator
    @@ -1296,7 +1302,7 @@

    Static HELPER_GRAPHICS: Graphics = new createjs.Graphics()
    @@ -1314,8 +1320,8 @@

    accelerationDirection

    accelerationDirection:
    @@ -1331,8 +1337,8 @@

    accelerationSpeed

    accelerationSpeed:
    @@ -1348,8 +1354,8 @@

    alphaCurveType

    alphaCurveType:
    @@ -1365,8 +1371,8 @@

    blendMode

    blendMode:
    @@ -1382,8 +1388,8 @@

    emitFrequency

    emitFrequency:
    @@ -1399,8 +1405,8 @@

    finishAlpha

    finishAlpha:
    @@ -1416,8 +1422,8 @@

    finishAlphaVariance

    finishAlphaVariance:
    @@ -1433,8 +1439,8 @@

    finishScale

    finishScale:
    @@ -1450,8 +1456,8 @@

    finishScaleVariance

    finishScaleVariance:
    @@ -1467,8 +1473,8 @@

    friction

    friction:
    @@ -1484,8 +1490,8 @@

    initialDirection

    initialDirection:
    @@ -1501,8 +1507,8 @@

    initialDirectionVariance

    initialDirectionVariance:
    @@ -1518,8 +1524,8 @@

    initialSpeed

    initialSpeed:
    @@ -1535,8 +1541,8 @@

    initialSpeedVariance

    initialSpeedVariance:
    @@ -1552,8 +1558,8 @@

    lifeSpan

    lifeSpan:
    @@ -1569,8 +1575,8 @@

    lifeSpanVariance

    lifeSpanVariance:
    @@ -1586,8 +1592,8 @@

    shapeIdList

    shapeIdList:
    @@ -1603,8 +1609,8 @@

    startAlpha

    startAlpha:
    @@ -1620,8 +1626,8 @@

    startAlphaVariance

    startAlphaVariance:
    @@ -1637,8 +1643,8 @@

    startColor

    startColor:
    @@ -1654,8 +1660,8 @@

    startScale

    startScale:
    @@ -1671,8 +1677,8 @@

    startScaleVariance

    startScaleVariance:
    @@ -1688,8 +1694,8 @@

    startX

    startX:
    @@ -1705,8 +1711,8 @@

    startXVariance

    startXVariance:
    @@ -1722,8 +1728,8 @@

    startY

    startY:
    @@ -1739,8 +1745,8 @@

    startYVariance

    startYVariance:
    @@ -1763,7 +1769,7 @@

    Private animate

  • @@ -1785,7 +1791,7 @@

    Private calcCurrentVa
  • @@ -1829,7 +1835,7 @@

    Private calcRandomVal
  • @@ -1863,7 +1869,7 @@

    Private calcRandomVal
  • @@ -1907,7 +1913,7 @@

    clear

  • @@ -1929,7 +1935,7 @@

    dispose

  • @@ -1951,7 +1957,7 @@

    Private emit

  • @@ -1973,7 +1979,7 @@

    Private emitParticle

  • @@ -1995,7 +2001,7 @@

    Private generateParticle
    @@ -2017,7 +2023,7 @@

    generateShape

  • @@ -2050,7 +2056,7 @@

    importFromJson

  • @@ -2078,7 +2084,7 @@

    isPlaying

  • @@ -2100,7 +2106,7 @@

    Private lifeCheck

  • @@ -2122,7 +2128,7 @@

    pause

  • @@ -2144,7 +2150,7 @@

    resume

  • @@ -2166,7 +2172,7 @@

    setData

  • @@ -2194,7 +2200,7 @@

    Private setParticlePa
  • @@ -2224,7 +2230,7 @@

    update

  • diff --git a/docs/classes/shapedata.html b/docs/classes/shapedata.html new file mode 100644 index 0000000..e28d8c7 --- /dev/null +++ b/docs/classes/shapedata.html @@ -0,0 +1,1094 @@ + + + + + + ShapeData | ParticleJS + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    Created by 「asset-shapes.fla」/「generate-assets.jsfl」 on Wed Jan 20 2016 + !!!!!このコードはJSFLから自動生成されたコードです。修正する場合はご注意ください。!!!!!

    +
    +
    +
    +
    +

    Hierarchy

    +
      +
    • + ShapeData +
    • +
    +
    +
    +

    Index

    +
    +
    +
    +

    Constructors

    + +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Constructors

    +
    + +

    constructor

    + + +
    +
    +
    +

    Properties

    +
    + +

    assetList

    +
    assetList: string[]
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    +
    + + + \ No newline at end of file diff --git a/docs/classes/shapegenerator.html b/docs/classes/shapegenerator.html index e4d7e8a..1da4844 100644 --- a/docs/classes/shapegenerator.html +++ b/docs/classes/shapegenerator.html @@ -924,6 +924,9 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
      @@ -935,6 +938,9 @@
  • +
  • + ShapeType +
  • VERSION
  • @@ -984,7 +990,7 @@

    constructor

  • Returns ShapeGenerator

    @@ -1004,7 +1010,7 @@

    generateShape

  • Parameters

    diff --git a/docs/classes/shapetype.html b/docs/classes/shapetype.html new file mode 100644 index 0000000..df43e75 --- /dev/null +++ b/docs/classes/shapetype.html @@ -0,0 +1,1314 @@ + + + + + + ShapeType | ParticleJS + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    シェイプの種類を定義したクラスです。

    +
    +
    +
    +
    +

    Hierarchy

    +
      +
    • + ShapeType +
    • +
    +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    Static BLUR_CIRCLE

    +
    BLUR_CIRCLE: string = "blur_circle"
    + +
    +
    +

    ふわっとした円のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static CIRCLE

    +
    CIRCLE: string = "circle"
    + +
    +
    +

    円のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static FLOWER

    +
    FLOWER: string = "flower"
    + +
    +
    +

    花の形のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static HEART

    +
    HEART: string = "heart"
    + +
    +
    +

    ハートの形のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static KIRAKIRA

    +
    KIRAKIRA: string = "kirakira"
    + +
    +
    +

    キラキラ(1)のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static KIRAKIRA2

    +
    KIRAKIRA2: string = "kirakira2"
    + +
    +
    +

    キラキラ(2)のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static REVERSE_CIRCLE

    +
    REVERSE_CIRCLE: string = "reverse_blur_circle"
    + +
    +
    +

    中央が繰り抜かれた円のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static SQUARE

    +
    SQUARE: string = "square"
    + +
    +
    +

    四角形のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static STAR

    +
    STAR: string = "star"
    + +
    +
    +

    星形のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static STAR_10

    +
    STAR_10: string = "star_10"
    + +
    +
    +

    星形(棘が10)のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    + +

    Static TRIANGLE

    +
    TRIANGLE: string = "triangle"
    + +
    +
    +

    三角形のシェイプIDです。

    +
    +
    +
    type
    +

    {string}

    +
    +
    +
    +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    +
    + + + \ No newline at end of file diff --git a/docs/enums/alphacurvetype.html b/docs/enums/alphacurvetype.html index 90ddc77..7263bad 100644 --- a/docs/enums/alphacurvetype.html +++ b/docs/enums/alphacurvetype.html @@ -932,9 +932,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -974,7 +980,7 @@

    Normal

    Normal: = 0
    @@ -989,7 +995,7 @@

    Random

    Random: = 1
    diff --git a/docs/examples/first-step.html b/docs/examples/first-step.html index 789341d..b293106 100644 --- a/docs/examples/first-step.html +++ b/docs/examples/first-step.html @@ -56,7 +56,7 @@ <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script> <!-- パーティクルシステムのライブラリー読み込み --> - <script src="../libs/particlejs.min.js"></script> + <script src="https://cdn.rawgit.com/ics-creative/ParticleJS/release/1.0.0/libs/particlejs.min.js"></script> <!-- JS --> <script> diff --git a/docs/globals.html b/docs/globals.html index 6ba34bd..f1c877a 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -924,9 +924,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -970,7 +976,9 @@

    Classes

  • DrawingData
  • Particle
  • ParticleSystem
  • +
  • ShapeData
  • ShapeGenerator
  • +
  • ShapeType
  • @@ -996,7 +1004,7 @@

    Const VERSION

    VERSION: "1.0.0" = "1.0.0"
    @@ -1013,7 +1021,7 @@

    checkVersion

  • diff --git a/docs/index.html b/docs/index.html index 2f42fba..fb9fdc3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -924,9 +924,15 @@
  • ParticleSystem
  • +
  • + ShapeData +
  • ShapeGenerator
  • +
  • + ShapeType +
  • VERSION
  • @@ -971,7 +977,9 @@

    Classes

  • DrawingData
  • Particle
  • ParticleSystem
  • +
  • ShapeData
  • ShapeGenerator
  • +
  • ShapeType
  • @@ -997,7 +1005,7 @@

    Const VERSION

    VERSION: "1.0.0" = "1.0.0"
    @@ -1014,7 +1022,7 @@

    checkVersion

  • diff --git a/libs/d.ts/particlejs.d.ts b/libs/d.ts/particlejs.d.ts index 0bdc36d..9a6b480 100644 --- a/libs/d.ts/particlejs.d.ts +++ b/libs/d.ts/particlejs.d.ts @@ -1,2 +1,10 @@ +import { assets } from "./asset-shapes.js"; +import { ShapeGenerator } from "./assets/shape-generator"; +import { ColorData } from "./data/data-color"; +import { DrawingData } from "./data/data-drawing"; +import { ShapeData } from "./data/data-shape"; +import { AlphaCurveType } from "./enum/alpha-curve-type"; +import { ShapeType } from "./enum/shape-type"; +import { Particle } from "./particle/particle"; import { ParticleSystem, VERSION } from "./particle/particle-system"; -export { ParticleSystem, VERSION }; +export { ParticleSystem, Particle, VERSION, DrawingData, ColorData, ShapeData, ShapeGenerator, AlphaCurveType, ShapeType, assets }; diff --git a/libs/particlejs.js b/libs/particlejs.js index 1ca9d69..b62534d 100644 --- a/libs/particlejs.js +++ b/libs/particlejs.js @@ -87,7 +87,7 @@ return /******/ (function(modules) { // webpackBootstrap __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./src/asset-shapes.js -var libs = {}; +var lib = {}; var asset_shapes_images = {}; var asset_shapes_createjs = window.createjs; var ss = {}; @@ -298,8 +298,9 @@ p.nominalBounds = new cjs.Rectangle(-32.5,-32.5,65.1,65.1); }).prototype = p = new cjs.Container(); p.nominalBounds = new cjs.Rectangle(275,200,554,187.5); -})( (libs = libs||{}).assets = libs.assets || {} , asset_shapes_images = asset_shapes_images||{}, asset_shapes_createjs = asset_shapes_createjs||{}, ss = ss||{}); +})( (lib = lib||{}).assets = lib.assets || {} , asset_shapes_images = asset_shapes_images||{}, asset_shapes_createjs = asset_shapes_createjs||{}, ss = ss||{}); +var assets = lib.assets; // CONCATENATED MODULE: ./src/assets/shape-generator.ts @@ -307,7 +308,7 @@ var shape_generator_ShapeGenerator = /** @class */ (function () { function ShapeGenerator() { } ShapeGenerator.prototype.generateShape = function (id) { - var namespaceObj = libs.assets; + var namespaceObj = assets; var cls = namespaceObj[id]; return new cls(); }; @@ -495,6 +496,97 @@ var data_drawing_DrawingData = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./src/data/data-shape.ts +/** + * Created by 「asset-shapes.fla」/「generate-assets.jsfl」 on Wed Jan 20 2016 + * !!!!!このコードはJSFLから自動生成されたコードです。修正する場合はご注意ください。!!!!! + */ +var ShapeData = /** @class */ (function () { + function ShapeData() { + this.assetList = [ + "blur_circle", + "circle", + "flower", + "heart", + "kirakira", + "kirakira2", + "reverse_blur_circle", + "square", + "star", + "star_10", + "triangle" + ]; + } + return ShapeData; +}()); + + +// CONCATENATED MODULE: ./src/enum/shape-type.ts +/** + * シェイプの種類を定義したクラスです。 + */ +var ShapeType = /** @class */ (function () { + function ShapeType() { + } + /** + * ふわっとした円のシェイプIDです。 + * @type {string} + */ + ShapeType.BLUR_CIRCLE = "blur_circle"; + /** + * 円のシェイプIDです。 + * @type {string} + */ + ShapeType.CIRCLE = "circle"; + /** + * 花の形のシェイプIDです。 + * @type {string} + */ + ShapeType.FLOWER = "flower"; + /** + * ハートの形のシェイプIDです。 + * @type {string} + */ + ShapeType.HEART = "heart"; + /** + * キラキラ(1)のシェイプIDです。 + * @type {string} + */ + ShapeType.KIRAKIRA = "kirakira"; + /** + * キラキラ(2)のシェイプIDです。 + * @type {string} + */ + ShapeType.KIRAKIRA2 = "kirakira2"; + /** + * 中央が繰り抜かれた円のシェイプIDです。 + * @type {string} + */ + ShapeType.REVERSE_CIRCLE = "reverse_blur_circle"; + /** + * 四角形のシェイプIDです。 + * @type {string} + */ + ShapeType.SQUARE = "square"; + /** + * 星形のシェイプIDです。 + * @type {string} + */ + ShapeType.STAR = "star"; + /** + * 星形(棘が10)のシェイプIDです。 + * @type {string} + */ + ShapeType.STAR_10 = "star_10"; + /** + * 三角形のシェイプIDです。 + * @type {string} + */ + ShapeType.TRIANGLE = "triangle"; + return ShapeType; +}()); + + // CONCATENATED MODULE: ./src/particle/particle.ts /** @@ -1342,7 +1434,23 @@ var particle_system_ParticleSystem = /** @class */ (function () { // CONCATENATED MODULE: ./src/particlejs.ts /* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ParticleSystem", function() { return particle_system_ParticleSystem; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "Particle", function() { return particle_Particle; }); /* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "DrawingData", function() { return data_drawing_DrawingData; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ColorData", function() { return ColorData; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeData", function() { return ShapeData; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeGenerator", function() { return shape_generator_ShapeGenerator; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "AlphaCurveType", function() { return AlphaCurveType; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeType", function() { return ShapeType; }); +/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "assets", function() { return assets; }); + + + + + + + + diff --git a/libs/particlejs.min.js b/libs/particlejs.min.js index b4286ef..0521f0d 100644 --- a/libs/particlejs.min.js +++ b/libs/particlejs.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.particlejs=t():e.particlejs=t()}(window,function(){return function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t,i){"use strict";i.r(t);var a,n,r,o={},s={},c=window.createjs,l={};a=(o=o||{}).assets=o.assets||{},s=s||{},n=c=c||{},l=l||{},a.properties={width:550,height:400,fps:24,color:"#999999",manifest:[]},(a.triangle=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-.7,-27.8).lineTo(32,27.1).lineTo(-32,27.8).closePath(),this.shape.setTransform(0,-7),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-34.8,64,55.7),(a.star_10=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-4.3,18.3).lineTo(-19.9,29.3).lineTo(-14.1,10.3).lineTo(-32,10.3).lineTo(-19.7,.7).lineTo(-31.2,-8.7).lineTo(-15.2,-8.8).lineTo(-21.7,-26.4).lineTo(-5.4,-16.4).lineTo(-.2,-31.8).lineTo(4.4,-17.6).lineTo(17.8,-27.4).lineTo(13.1,-8.5).lineTo(30.3,-8.1).lineTo(19.9,.1).lineTo(32,8.4).lineTo(12.8,9.5).lineTo(18.2,29.8).lineTo(4.9,20).lineTo(1.4,31.8).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-31.7,64,63.6),(a.star=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-.2,17.3).lineTo(-20.2,31.5).lineTo(-13,7.4).lineTo(-32,-8).lineTo(-7.8,-8.4).lineTo(.3,-32).lineTo(8,-8.2).lineTo(32,-7.4).lineTo(12.8,7.5).lineTo(19.4,32).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-32,64,64),(a.square=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill().beginStroke("#FFFFFF").setStrokeStyle(8,1,1).moveTo(-32,-32).lineTo(32,-32).lineTo(32,32).lineTo(-32,32).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-36,-36,72,72),(a.reverse_blur_circle=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill().beginStroke("#FFFFFF").setStrokeStyle(8,1,1).moveTo(32,0).curveTo(32,13.2,22.6,22.6).curveTo(13.3,32,0,32).curveTo(-13.2,32,-22.7,22.6).curveTo(-32,13.2,-32,0).curveTo(-32,-13.3,-22.7,-22.7).curveTo(-13.2,-32,0,-32).curveTo(13.3,-32,22.6,-22.7).curveTo(32,-13.3,32,0).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-36,-36,72,72),(a.kirakira2=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-4,9.5).curveTo(-7.8,0,-13.4,-.1).curveTo(-7.8,-.2,-4,-9.9).curveTo(-.1,-19.2,0,-32).curveTo(.1,-19.2,4,-9.9).curveTo(8,-.2,13.4,-.1).curveTo(8,0,4,9.5).curveTo(.1,19,0,32).curveTo(-.1,19,-4,9.5).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-13.4,-32,26.8,64),(a.kirakira=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-9.6,9.3).curveTo(-18.9,0,-32,-.1).curveTo(-18.9,-.2,-9.6,-9.6).curveTo(-.2,-19,-.1,-32).curveTo(0,-19,9.4,-9.6).curveTo(18.9,-.2,32,-.1).curveTo(18.9,0,9.4,9.3).curveTo(0,18.8,-.1,32).curveTo(-.2,18.8,-9.6,9.3).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-32,64,64),(a.heart=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(-20.2,10).lineTo(-24.8,3.5).curveTo(-27,.1,-28.5,-3.1).curveTo(-30.1,-6.4,-31.1,-9.5).curveTo(-32,-13,-32,-16).curveTo(-32,-19.7,-30.4,-22.7).curveTo(-29.1,-25.4,-26.6,-27.4).curveTo(-24,-29.1,-21,-30.1).curveTo(-18.1,-31.1,-15,-31.1).curveTo(-11.7,-31.1,-8.8,-29.9).curveTo(-6.4,-29,-4.5,-27.4).curveTo(-3,-25.9,-1.7,-23.9).lineTo(0,-20.8).lineTo(1.7,-23.9).curveTo(3,-25.9,4.5,-27.4).curveTo(6.6,-29.1,8.8,-29.9).curveTo(11.7,-31.1,15.2,-31.1).curveTo(18.4,-31.1,21.3,-30.1).curveTo(24.2,-29.1,26.7,-27.2).curveTo(29.1,-25.3,30.5,-22.6).curveTo(32,-19.7,32,-16.1).curveTo(32,-13.3,31,-9.7).curveTo(30.2,-6.5,28.5,-3.2).curveTo(27.1,0,24.9,3.3).lineTo(20.3,9.7).curveTo(13.4,17.7,9.7,21.6).lineTo(0,31).curveTo(-13.6,18.3,-20.2,10).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-31,64,62.1),(a.flower=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().moveTo(4,27.3).curveTo(.5,23.7,.5,18.9).lineTo(.5,15.2).lineTo(-.5,15.2).lineTo(-.7,18.9).curveTo(-.9,24,-4.1,27.6).curveTo(-7.4,31.1,-12.1,31.1).curveTo(-17,31.1,-20.8,27.5).curveTo(-24.7,23.7,-24.7,19.1).curveTo(-24.7,15.3,-22.2,12.1).curveTo(-19.7,8.8,-16.1,7.7).lineTo(-12.5,6.4).lineTo(-12.7,5.8).lineTo(-13,5.4).lineTo(-16.5,6.6).lineTo(-20.2,7.1).curveTo(-25.3,7.1,-28.7,4).curveTo(-32,.7,-32,-4.1).curveTo(-32,-9.4,-28.7,-13).curveTo(-25.5,-16.8,-20.6,-16.8).curveTo(-17.8,-16.8,-15,-15.4).curveTo(-12.2,-14,-10.5,-11.6).lineTo(-8.4,-8.7).lineTo(-8,-8.8).lineTo(-7.4,-9.3).lineTo(-9.6,-12.2).curveTo(-10.7,-14,-11.3,-15.8).curveTo(-11.9,-17.9,-12,-19.9).curveTo(-12,-24.7,-8.5,-28).curveTo(-5.3,-31.1,-.1,-31.1).curveTo(5.2,-31.1,8.5,-28).curveTo(11.7,-24.7,11.8,-19.9).curveTo(11.7,-17.7,11.2,-15.7).curveTo(10.7,-13.8,9.5,-12.2).lineTo(7.4,-9.3).lineTo(7.8,-9).lineTo(8.2,-8.7).lineTo(10.5,-11.6).curveTo(12.2,-14,14.8,-15.4).curveTo(17.6,-16.8,20.4,-16.8).curveTo(25.3,-16.8,28.5,-13).curveTo(32,-9.4,32,-4.1).curveTo(32,.8,28.5,4).curveTo(25.3,7.1,20,7.1).lineTo(16.4,6.6).lineTo(12.9,5.5).curveTo(12.8,5.6,12.8,5.6).curveTo(12.7,5.7,12.7,5.7).curveTo(12.7,5.8,12.7,5.8).curveTo(12.7,5.9,12.7,6).lineTo(12.5,6.4).lineTo(15.9,7.7).curveTo(19.7,9.1,22.1,12.2).curveTo(24.5,15.3,24.5,19.1).curveTo(24.5,23.7,20.8,27.5).curveTo(16.9,31.1,11.9,31.1).curveTo(7.4,31.1,4,27.3).closePath().moveTo(-7.7,-5.9).curveTo(-10.9,-2.7,-10.9,1.8).curveTo(-10.9,6.3,-7.7,9.4).curveTo(-4.6,12.5,-.1,12.5).curveTo(4.4,12.5,7.6,9.4).curveTo(10.6,6.3,10.6,1.8).curveTo(10.6,-2.7,7.6,-5.9).curveTo(4.4,-9,-.1,-9).curveTo(-4.6,-9,-7.7,-5.9).closePath(),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-31,64,62.2),(a.circle=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginFill("#FFFFFF").beginStroke().drawEllipse(-10.8,-10.8,21.7,21.7),this.shape.setTransform(0,0,2.949,2.949),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32,-32,64,64),(a.blur_circle=function(){this.initialize(),this.shape=new n.Shape,this.shape.graphics.beginRadialGradientFill(["#FFFFFF","rgba(255,255,255,0)"],[0,1],0,0,0,0,0,11).beginStroke().drawEllipse(-10.8,-10.8,21.7,21.7),this.shape.setTransform(0,0,3,3),this.addChild(this.shape)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(-32.5,-32.5,65.1,65.1),(a.assetshapes=function(){this.initialize(),this.instance=new a.triangle,this.instance.setTransform(323.6,39.6),this.instance_1=new a.square,this.instance_1.setTransform(518,151.5),this.instance_2=new a.kirakira2,this.instance_2.setTransform(420.8,32.6),this.instance_3=new a.kirakira,this.instance_3.setTransform(32,151.5),this.instance_4=new a.flower,this.instance_4.setTransform(396.5,151.5),this.instance_5=new a.star_10,this.instance_5.setTransform(518,32.6),this.instance_6=new a.star,this.instance_6.setTransform(275,151.5),this.instance_7=new a.circle,this.instance_7.setTransform(226.4,32.6),this.instance_8=new a.reverse_blur_circle,this.instance_8.setTransform(153.5,151.5),this.instance_9=new a.blur_circle,this.instance_9.setTransform(129.2,32.6),this.instance_10=new a.heart,this.instance_10.setTransform(32,32.6),this.addChild(this.instance_10,this.instance_9,this.instance_8,this.instance_7,this.instance_6,this.instance_5,this.instance_4,this.instance_3,this.instance_2,this.instance_1,this.instance)}).prototype=r=new n.Container,r.nominalBounds=new n.Rectangle(275,200,554,187.5);var h,u=function(){function e(){}return e.prototype.generateShape=function(e){return new(0,o.assets[e])},e}(),p=function(){return function(){this.hue=0,this.hueVariance=0,this.saturation=0,this.saturationVariance=0,this.luminance=0,this.luminanceVariance=0}}();!function(e){e[e.Normal=0]="Normal",e[e.Random=1]="Random"}(h||(h={}));var f=function(){function e(e){void 0===e&&(e=null),this.bgColor="",this.width=0,this.height=0,this.emitFrequency=0,this.startX=0,this.startXVariance=0,this.startY=0,this.startYVariance=0,this.initialDirection=0,this.initialDirectionVariance=0,this.initialSpeed=0,this.initialSpeedVariance=0,this.friction=0,this.accelerationSpeed=0,this.accelerationDirection=0,this.startScale=0,this.startScaleVariance=0,this.finishScale=0,this.finishScaleVariance=0,this.lifeSpan=0,this.lifeSpanVariance=0,this.startAlpha=0,this.startAlphaVariance=0,this.finishAlpha=0,this.finishAlphaVariance=0,this.shapeIdList=[""],this.startColor=new p,this.blendMode=!0,this.alphaCurveType=h.Normal,e&&this.importFromJson(e)}return e.prototype.importFromJson=function(e){this.setData(e,function(e){return"width"==e||"height"==e||"bgColor"==e})},e.prototype.importData=function(e){this.setData(e,function(e){return"width"==e||"height"==e||"startX"==e||"startY"==e})},e.checkReflectEnable=function(){try{return!(!Reflect||!Reflect.has)}catch(e){return!1}},e.prototype.setData=function(t,i){if(e.ENABLE_REFLECT){for(var a in t)if(!i(a)&&1==Reflect.has(this,a)){var n=t[a];Reflect.set(this,a,n)}}else{for(var a in t)i(a)||this.hasOwnProperty(a)&&(this[a]=t[a])}},e.ENABLE_REFLECT=e.checkReflectEnable(),e}(),d=function(){return function(){this.particleShape=new createjs.Container,this.startColor=new p}}(),g="0.1.3";var T=function(){function e(){this._frameCount=0,this._drawingData=new f,this._particlesPool=[],this._activeParticles=[],this.container=new createjs.Container,this.container.mouseChildren=!1,this.container.mouseEnabled=!1,this._playing=!0,this.shapeGenerator=new u}return e.prototype.isPlaying=function(){return this._playing},e.prototype.setData=function(e){this._drawingData=e},e.prototype.importFromJson=function(e){(function(e){var t=g.split(".");if(t.length<=2)return console.log("バージョン表記エラーが発生しました。"),!1;if(!e)return"0"==t[0]&&"1"==t[1];var i=e.split(".");return t[0]==i[0]&&t[1]==i[1]})(e.VERSION||"")||console.warn("読み込んだJSONファイルとParticleJSのバージョンが異なります。\nhttps://github.com/ics-creative/ParticleJS"),this._drawingData.importFromJson(e)},e.prototype.update=function(){this._playing&&(this.emit(),this.animate(),this.lifeCheck())},e.prototype.animate=function(){for(var e=createjs.Matrix2D.DEG_TO_RAD*this._drawingData.accelerationDirection,t=Math.cos(e)*this._drawingData.accelerationSpeed,i=Math.sin(e)*this._drawingData.accelerationSpeed,a=0;a=e&&(this._frameCount=0)},e.prototype.emitParticle=function(){var e=this.generateParticle();this.container.addChild(e.particleShape),this._activeParticles.push(e)},e.prototype.generateParticle=function(){var e=null;return e=this._particlesPool.length>=1?this._particlesPool.shift():new d,this.setParticleParameter(e),e},e.prototype.setParticleParameter=function(e){e.particleShape.removeAllChildren(),e.isAlive=!0,e.x=this.calcRandomValueWithVariance(this._drawingData.startX,this._drawingData.startXVariance,!1),e.y=this.calcRandomValueWithVariance(this._drawingData.startY,this._drawingData.startYVariance,!1),this.generateShape(e,this._drawingData.shapeIdList),e.totalLife=Math.max(1,this.calcRandomValueWithVariance(this._drawingData.lifeSpan,this._drawingData.lifeSpanVariance,!0)),e.currentLife=e.totalLife;var t=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.initialSpeed,this._drawingData.initialSpeedVariance,!1)),i=createjs.Matrix2D.DEG_TO_RAD*this.calcRandomValueWithVariance(this._drawingData.initialDirection,this._drawingData.initialDirectionVariance,!1);e.vx=Math.cos(i)*t,e.vy=Math.sin(i)*t,e.startAlpha=this.calcRandomValueWithRange(0,1,this.calcRandomValueWithVariance(this._drawingData.startAlpha,this._drawingData.startAlphaVariance,!1)),e.finishAlpha=this.calcRandomValueWithRange(0,1,this.calcRandomValueWithVariance(this._drawingData.finishAlpha,this._drawingData.finishAlphaVariance,!1)),e.startScale=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.startScale,this._drawingData.startScaleVariance,!1)),e.finishScale=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.finishScale,this._drawingData.finishScaleVariance,!1)),e.particleShape.compositeOperation=1==this._drawingData.blendMode?"lighter":null,e.alphaCurveType=this._drawingData.alphaCurveType},e.prototype.generateShape=function(t,i){t.particleShape.removeAllChildren();var a=this._drawingData.startColor;t.startColor.hue=this.calcRandomValueWithVariance(a.hue,a.hueVariance,!1)%360,t.startColor.luminance=this.calcRandomValueWithVariance(a.luminance,a.luminanceVariance,!1),t.startColor.saturation=this.calcRandomValueWithVariance(a.saturation,a.saturationVariance,!1);var n=Number(t.startColor.hue),r=Number(t.startColor.saturation),o=Number(t.startColor.luminance),s="hsl("+n+", "+r+"%, "+o+"%)",c=Math.floor(Math.random()*this._drawingData.shapeIdList.length),l=0==this._drawingData.shapeIdList.length?"":this._drawingData.shapeIdList[c];t.colorCommand=null;var h=this.shapeGenerator.generateShape(l);t.particleShape.addChild(h);var u=h.getChildAt(0);if(null!=u){var p=u.graphics.instructions;if(p&&p.length>0)for(var f=0;f=e&&(this._frameCount=0)},e.prototype.emitParticle=function(){var e=this.generateParticle();this.container.addChild(e.particleShape),this._activeParticles.push(e)},e.prototype.generateParticle=function(){var e=null;return e=this._particlesPool.length>=1?this._particlesPool.shift():new d,this.setParticleParameter(e),e},e.prototype.setParticleParameter=function(e){e.particleShape.removeAllChildren(),e.isAlive=!0,e.x=this.calcRandomValueWithVariance(this._drawingData.startX,this._drawingData.startXVariance,!1),e.y=this.calcRandomValueWithVariance(this._drawingData.startY,this._drawingData.startYVariance,!1),this.generateShape(e,this._drawingData.shapeIdList),e.totalLife=Math.max(1,this.calcRandomValueWithVariance(this._drawingData.lifeSpan,this._drawingData.lifeSpanVariance,!0)),e.currentLife=e.totalLife;var t=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.initialSpeed,this._drawingData.initialSpeedVariance,!1)),i=createjs.Matrix2D.DEG_TO_RAD*this.calcRandomValueWithVariance(this._drawingData.initialDirection,this._drawingData.initialDirectionVariance,!1);e.vx=Math.cos(i)*t,e.vy=Math.sin(i)*t,e.startAlpha=this.calcRandomValueWithRange(0,1,this.calcRandomValueWithVariance(this._drawingData.startAlpha,this._drawingData.startAlphaVariance,!1)),e.finishAlpha=this.calcRandomValueWithRange(0,1,this.calcRandomValueWithVariance(this._drawingData.finishAlpha,this._drawingData.finishAlphaVariance,!1)),e.startScale=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.startScale,this._drawingData.startScaleVariance,!1)),e.finishScale=Math.max(0,this.calcRandomValueWithVariance(this._drawingData.finishScale,this._drawingData.finishScaleVariance,!1)),e.particleShape.compositeOperation=1==this._drawingData.blendMode?"lighter":null,e.alphaCurveType=this._drawingData.alphaCurveType},e.prototype.generateShape=function(t,i){t.particleShape.removeAllChildren();var a=this._drawingData.startColor;t.startColor.hue=this.calcRandomValueWithVariance(a.hue,a.hueVariance,!1)%360,t.startColor.luminance=this.calcRandomValueWithVariance(a.luminance,a.luminanceVariance,!1),t.startColor.saturation=this.calcRandomValueWithVariance(a.saturation,a.saturationVariance,!1);var n=Number(t.startColor.hue),r=Number(t.startColor.saturation),o=Number(t.startColor.luminance),s="hsl("+n+", "+r+"%, "+o+"%)",c=Math.floor(Math.random()*this._drawingData.shapeIdList.length),l=0==this._drawingData.shapeIdList.length?"":this._drawingData.shapeIdList[c];t.colorCommand=null;var h=this.shapeGenerator.generateShape(l);t.particleShape.addChild(h);var u=h.getChildAt(0);if(null!=u){var p=u.graphics.instructions;if(p&&p.length>0)for(var f=0;fnamespaceObj[id]; return new cls(); } diff --git a/src/particlejs.ts b/src/particlejs.ts index 469c73b..73bbfcb 100644 --- a/src/particlejs.ts +++ b/src/particlejs.ts @@ -1,3 +1,22 @@ +import { assets } from "./asset-shapes.js"; +import { ShapeGenerator } from "./assets/shape-generator"; +import { ColorData } from "./data/data-color"; +import { DrawingData } from "./data/data-drawing"; +import { ShapeData } from "./data/data-shape"; +import { AlphaCurveType } from "./enum/alpha-curve-type"; +import { ShapeType } from "./enum/shape-type"; +import { Particle } from "./particle/particle"; import { ParticleSystem, VERSION } from "./particle/particle-system"; -export { ParticleSystem, VERSION }; +export { + ParticleSystem, + Particle, + VERSION, + DrawingData, + ColorData, + ShapeData, + ShapeGenerator, + AlphaCurveType, + ShapeType, + assets +};