@crispcode/shimmer 5.0.0 → 5.0.3
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@crispcode/shimmer",
|
3
|
-
"version": "5.0.
|
3
|
+
"version": "5.0.3",
|
4
4
|
"description": "A PIXI.JS wrapper plugin for MODUX",
|
5
5
|
"author": "Crisp Code ( contact@crispcode.ro )",
|
6
6
|
"access": "public",
|
@@ -17,39 +17,39 @@
|
|
17
17
|
"url": "https://github.com/CrispCode/shimmer/issues"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"@pixi/
|
21
|
-
"@pixi/canvas-
|
22
|
-
"@pixi/canvas-
|
23
|
-
"@pixi/canvas-
|
24
|
-
"@pixi/canvas-
|
25
|
-
"@pixi/canvas-
|
26
|
-
"@pixi/canvas-
|
27
|
-
"@pixi/canvas-
|
28
|
-
"@pixi/canvas-sprite
|
29
|
-
"@pixi/canvas-
|
30
|
-
"@pixi/
|
31
|
-
"@pixi/
|
32
|
-
"@pixi/
|
33
|
-
"@pixi/
|
34
|
-
"@pixi/
|
35
|
-
"@pixi/
|
36
|
-
"@pixi/
|
37
|
-
"@pixi/
|
38
|
-
"@pixi/mesh
|
39
|
-
"@pixi/
|
40
|
-
"@pixi/
|
41
|
-
"@pixi/
|
42
|
-
"@pixi/
|
43
|
-
"@pixi/
|
44
|
-
"@pixi/sprite
|
45
|
-
"@pixi/sprite-
|
46
|
-
"@pixi/
|
47
|
-
"@pixi/
|
48
|
-
"@pixi/
|
49
|
-
"
|
20
|
+
"@pixi/assets": "^6.5.1",
|
21
|
+
"@pixi/canvas-display": "^6.5.1",
|
22
|
+
"@pixi/canvas-extract": "^6.5.1",
|
23
|
+
"@pixi/canvas-graphics": "^6.5.1",
|
24
|
+
"@pixi/canvas-mesh": "^6.5.1",
|
25
|
+
"@pixi/canvas-particle-container": "^6.5.1",
|
26
|
+
"@pixi/canvas-prepare": "^6.5.1",
|
27
|
+
"@pixi/canvas-renderer": "^6.5.1",
|
28
|
+
"@pixi/canvas-sprite": "^6.5.1",
|
29
|
+
"@pixi/canvas-sprite-tiling": "^6.5.1",
|
30
|
+
"@pixi/canvas-text": "^6.5.1",
|
31
|
+
"@pixi/constants": "^6.5.1",
|
32
|
+
"@pixi/core": "^6.5.1",
|
33
|
+
"@pixi/display": "^6.5.1",
|
34
|
+
"@pixi/extensions": "^6.5.1",
|
35
|
+
"@pixi/graphics": "^6.5.1",
|
36
|
+
"@pixi/interaction": "^6.5.1",
|
37
|
+
"@pixi/math": "^6.5.1",
|
38
|
+
"@pixi/mesh": "^6.5.1",
|
39
|
+
"@pixi/mesh-extras": "^6.5.1",
|
40
|
+
"@pixi/particle-container": "^6.5.1",
|
41
|
+
"@pixi/prepare": "^6.5.1",
|
42
|
+
"@pixi/runner": "^6.5.1",
|
43
|
+
"@pixi/settings": "^6.5.1",
|
44
|
+
"@pixi/sprite": "^6.5.1",
|
45
|
+
"@pixi/sprite-animated": "^6.5.1",
|
46
|
+
"@pixi/sprite-tiling": "^6.5.1",
|
47
|
+
"@pixi/text": "^6.5.1",
|
48
|
+
"@pixi/ticker": "^6.5.1",
|
49
|
+
"@pixi/utils": "^6.5.1"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
52
|
-
"@crispcode/modux": "
|
52
|
+
"@crispcode/modux": "^5.1.1"
|
53
53
|
},
|
54
54
|
"devDependencies": {
|
55
55
|
"esdoc": "^1.1.0",
|
package/scripts/shimmer.js
CHANGED
@@ -4,11 +4,12 @@
|
|
4
4
|
|
5
5
|
import { Component, extend, loop, logger } from '@crispcode/modux'
|
6
6
|
|
7
|
-
import { autoDetectRenderer,
|
8
|
-
import {
|
7
|
+
import { autoDetectRenderer, BatchRenderer } from '@pixi/core'
|
8
|
+
import { Assets } from '@pixi/assets'
|
9
9
|
import { Ticker } from '@pixi/ticker'
|
10
10
|
import { InteractionManager } from '@pixi/interaction'
|
11
11
|
import { skipHello, isWebGLSupported } from '@pixi/utils'
|
12
|
+
import { extensions } from '@pixi/extensions'
|
12
13
|
|
13
14
|
// Canvas support
|
14
15
|
import '@pixi/canvas-display'
|
@@ -25,15 +26,8 @@ import '@pixi/canvas-text'
|
|
25
26
|
import { Element } from './element.js'
|
26
27
|
import { Controls } from './controls.js'
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
CanvasRenderer.registerPlugin( 'interaction', InteractionManager )
|
32
|
-
CanvasRenderer.registerPlugin( 'extract', CanvasExtract )
|
33
|
-
CanvasRenderer.registerPlugin( 'graphics', CanvasGraphicsRenderer )
|
34
|
-
CanvasRenderer.registerPlugin( 'mesh', CanvasMeshRenderer )
|
35
|
-
CanvasRenderer.registerPlugin( 'prepare', CanvasPrepare )
|
36
|
-
CanvasRenderer.registerPlugin( 'sprite', CanvasSpriteRenderer )
|
29
|
+
extensions.add( InteractionManager )
|
30
|
+
extensions.add( BatchRenderer )
|
37
31
|
|
38
32
|
/**
|
39
33
|
* This class is used to create the shimmer component
|
@@ -66,19 +60,12 @@ export class Shimmer extends Component {
|
|
66
60
|
|
67
61
|
/**
|
68
62
|
* This method preloads a colection of assets
|
69
|
-
* @param {Object}
|
63
|
+
* @param {Object} bundle A collection of assets
|
70
64
|
* @return {Promise} A promise which is resolved upon loading the assets. It resolves the loaded resources.
|
71
65
|
*/
|
72
|
-
preload (
|
73
|
-
|
74
|
-
return
|
75
|
-
loop( assets, ( data, name ) => {
|
76
|
-
loader.add( name, data )
|
77
|
-
} )
|
78
|
-
loader.load( ( loader, resources ) => {
|
79
|
-
resolve( resources )
|
80
|
-
} )
|
81
|
-
} )
|
66
|
+
preload ( bundle ) {
|
67
|
+
Assets.addBundle( 'bundle', bundle )
|
68
|
+
return Assets.loadBundle( 'bundle' )
|
82
69
|
}
|
83
70
|
|
84
71
|
/**
|
@@ -163,7 +150,17 @@ export class Shimmer extends Component {
|
|
163
150
|
* Stores the renderer
|
164
151
|
* @type {Renderer}
|
165
152
|
*/
|
166
|
-
this.renderer =
|
153
|
+
this.renderer = null
|
154
|
+
if ( isWebGLSupported() && !this.settings.forceCanvas ) {
|
155
|
+
this.renderer = autoDetectRenderer( rendererSettings )
|
156
|
+
} else {
|
157
|
+
extensions.add( CanvasExtract )
|
158
|
+
extensions.add( CanvasGraphicsRenderer )
|
159
|
+
extensions.add( CanvasMeshRenderer )
|
160
|
+
extensions.add( CanvasPrepare )
|
161
|
+
extensions.add( CanvasSpriteRenderer )
|
162
|
+
this.renderer = new CanvasRenderer( rendererSettings )
|
163
|
+
}
|
167
164
|
|
168
165
|
this.renderer.resize( this.element.clientWidth, this.element.clientHeight )
|
169
166
|
|
package/test/app.js
CHANGED
@@ -37,13 +37,13 @@ export class ShimmerComponent extends Shimmer {
|
|
37
37
|
'image2': '/image2.png'
|
38
38
|
} )
|
39
39
|
.then( ( resources ) => {
|
40
|
-
this.__button = new ButtonMain( resources[ 'image1' ]
|
40
|
+
this.__button = new ButtonMain( resources[ 'image1' ] )
|
41
41
|
this.stage.addElementChild( 'button', this.__button )
|
42
42
|
|
43
43
|
this.__moons = {}
|
44
44
|
|
45
45
|
for ( let i = 0; i < 20; i++ ) {
|
46
|
-
let moon = new Moon( resources[ 'image2' ]
|
46
|
+
let moon = new Moon( resources[ 'image2' ] )
|
47
47
|
moon.setAngle( rnd( 0, 359 ) )
|
48
48
|
moon.setRadius( rnd( 200, 500 ) )
|
49
49
|
moon.setSpeed( rnd( 10, 50 ) / 10 )
|
package/test/scripts/index.js
CHANGED
@@ -7,6 +7,8 @@ import { Module, logger } from '@crispcode/modux'
|
|
7
7
|
import { LayoutComponent } from './components/layout'
|
8
8
|
import { ShimmerComponent } from './components/shimmer'
|
9
9
|
|
10
|
+
import './../styles/index.scss'
|
11
|
+
|
10
12
|
let initialize = () => {
|
11
13
|
// Create application
|
12
14
|
let app = new Module( 'app' )
|