@urso/core 0.6.16-dev → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/.babelrc +11 -11
  2. package/LICENSE +20 -20
  3. package/README.md +227 -227
  4. package/build/js/index.js +1 -1
  5. package/build/js/index.js.LICENSE.txt +38 -270
  6. package/package.json +52 -52
  7. package/src/js/app.js +79 -79
  8. package/src/js/components/_info.js +11 -11
  9. package/src/js/components/base/_info.js +3 -3
  10. package/src/js/components/base/controller.js +78 -78
  11. package/src/js/components/debug/_info.js +7 -7
  12. package/src/js/components/debug/controller.js +38 -38
  13. package/src/js/components/debug/coords.js +23 -23
  14. package/src/js/components/debug/fps.js +36 -36
  15. package/src/js/components/debug/template.js +55 -55
  16. package/src/js/components/debug/timescale.js +60 -60
  17. package/src/js/components/deviceRotate/_info.js +3 -3
  18. package/src/js/components/deviceRotate/controller.js +86 -86
  19. package/src/js/components/fullscreen/_info.js +6 -6
  20. package/src/js/components/fullscreen/android.js +104 -104
  21. package/src/js/components/fullscreen/controller.js +76 -76
  22. package/src/js/components/fullscreen/desktop.js +49 -49
  23. package/src/js/components/fullscreen/ios.js +115 -115
  24. package/src/js/components/layersSwitcher/_info.js +4 -4
  25. package/src/js/components/layersSwitcher/config.js +26 -26
  26. package/src/js/components/layersSwitcher/controller.js +34 -34
  27. package/src/js/components/loader/_info.js +4 -4
  28. package/src/js/components/loader/controller.js +65 -65
  29. package/src/js/components/loader/template.js +70 -70
  30. package/src/js/components/soundInitialPopup/_info.js +3 -3
  31. package/src/js/components/soundInitialPopup/controller.js +42 -42
  32. package/src/js/components/soundInitialPopup/template.js +109 -109
  33. package/src/js/components/stateDriven/_info.js +3 -3
  34. package/src/js/components/stateDriven/controller.js +118 -118
  35. package/src/js/config/load.js +5 -5
  36. package/src/js/config/main.js +16 -16
  37. package/src/js/extra/_info.js +26 -26
  38. package/src/js/extra/browserEvents.js +51 -51
  39. package/src/js/extra/pixiPatch.js +150 -150
  40. package/src/js/extra/setTimeout.js +7 -7
  41. package/src/js/index.js +8 -8
  42. package/src/js/lib/_info.js +13 -13
  43. package/src/js/lib/cache.js +105 -105
  44. package/src/js/lib/composition.js +85 -85
  45. package/src/js/lib/device.js +1286 -1286
  46. package/src/js/lib/helper.js +556 -556
  47. package/src/js/lib/loader.js +136 -136
  48. package/src/js/lib/localData.js +15 -15
  49. package/src/js/lib/logger.js +69 -69
  50. package/src/js/lib/math.js +35 -35
  51. package/src/js/lib/objectPool.js +203 -203
  52. package/src/js/lib/time.js +18 -18
  53. package/src/js/lib/tween.js +147 -147
  54. package/src/js/modules/_info.js +12 -12
  55. package/src/js/modules/assets/_info.js +7 -7
  56. package/src/js/modules/assets/baseModel.js +20 -20
  57. package/src/js/modules/assets/config.js +37 -37
  58. package/src/js/modules/assets/controller.js +46 -46
  59. package/src/js/modules/assets/models/_info.js +11 -11
  60. package/src/js/modules/assets/models/atlas.js +8 -8
  61. package/src/js/modules/assets/models/audiosprite.js +27 -27
  62. package/src/js/modules/assets/models/bitmapFont.js +8 -8
  63. package/src/js/modules/assets/models/container.js +16 -16
  64. package/src/js/modules/assets/models/font.js +8 -8
  65. package/src/js/modules/assets/models/image.js +15 -15
  66. package/src/js/modules/assets/models/json.js +8 -8
  67. package/src/js/modules/assets/models/sound.js +14 -14
  68. package/src/js/modules/assets/models/spine.js +14 -14
  69. package/src/js/modules/assets/service.js +366 -366
  70. package/src/js/modules/i18n/_info.js +4 -4
  71. package/src/js/modules/i18n/config.js +17 -17
  72. package/src/js/modules/i18n/controller.js +79 -79
  73. package/src/js/modules/instances/_info.js +3 -3
  74. package/src/js/modules/instances/controller.js +357 -357
  75. package/src/js/modules/logic/_info.js +4 -4
  76. package/src/js/modules/logic/config/_info.js +2 -2
  77. package/src/js/modules/logic/config/sounds.js +23 -23
  78. package/src/js/modules/logic/controller.js +48 -48
  79. package/src/js/modules/logic/sounds.js +103 -103
  80. package/src/js/modules/objects/_info.js +13 -13
  81. package/src/js/modules/objects/baseModel.js +200 -200
  82. package/src/js/modules/objects/cache.js +99 -99
  83. package/src/js/modules/objects/controller.js +131 -131
  84. package/src/js/modules/objects/find.js +58 -58
  85. package/src/js/modules/objects/models/_info.js +27 -27
  86. package/src/js/modules/objects/models/atlasImage.js +50 -50
  87. package/src/js/modules/objects/models/bitmapText.js +37 -37
  88. package/src/js/modules/objects/models/button.js +189 -189
  89. package/src/js/modules/objects/models/buttonComposite.js +35 -35
  90. package/src/js/modules/objects/models/checkbox.js +96 -96
  91. package/src/js/modules/objects/models/collection.js +54 -54
  92. package/src/js/modules/objects/models/component.js +46 -46
  93. package/src/js/modules/objects/models/container.js +19 -19
  94. package/src/js/modules/objects/models/dragContainer.js +667 -667
  95. package/src/js/modules/objects/models/emitter.js +67 -67
  96. package/src/js/modules/objects/models/emitterFx.js +99 -99
  97. package/src/js/modules/objects/models/graphics.js +38 -38
  98. package/src/js/modules/objects/models/group.js +19 -19
  99. package/src/js/modules/objects/models/hitArea.js +104 -104
  100. package/src/js/modules/objects/models/image.js +34 -34
  101. package/src/js/modules/objects/models/imagesAnimation.js +113 -113
  102. package/src/js/modules/objects/models/mask.js +38 -38
  103. package/src/js/modules/objects/models/nineSlicePlane.js +30 -30
  104. package/src/js/modules/objects/models/scrollbox.js +64 -64
  105. package/src/js/modules/objects/models/slider.js +253 -253
  106. package/src/js/modules/objects/models/spine.js +296 -287
  107. package/src/js/modules/objects/models/text.js +59 -59
  108. package/src/js/modules/objects/models/textInput.js +66 -66
  109. package/src/js/modules/objects/models/toggle.js +180 -180
  110. package/src/js/modules/objects/models/world.js +19 -19
  111. package/src/js/modules/objects/propertyAdapter.js +588 -587
  112. package/src/js/modules/objects/proxy.js +294 -294
  113. package/src/js/modules/objects/selector.js +136 -136
  114. package/src/js/modules/objects/service.js +242 -242
  115. package/src/js/modules/objects/styles.js +210 -210
  116. package/src/js/modules/observer/_info.js +4 -4
  117. package/src/js/modules/observer/controller.js +99 -99
  118. package/src/js/modules/observer/events.js +52 -52
  119. package/src/js/modules/scenes/_info.js +8 -8
  120. package/src/js/modules/scenes/controller.js +119 -119
  121. package/src/js/modules/scenes/model.js +28 -28
  122. package/src/js/modules/scenes/pixiWrapper.js +336 -336
  123. package/src/js/modules/scenes/resolutions.js +173 -173
  124. package/src/js/modules/scenes/resolutionsConfig.js +73 -73
  125. package/src/js/modules/scenes/service.js +142 -142
  126. package/src/js/modules/soundManager/_info.js +3 -3
  127. package/src/js/modules/soundManager/controller.js +100 -100
  128. package/src/js/modules/soundManager/soundSprite.js +251 -251
  129. package/src/js/modules/statesManager/_info.js +12 -12
  130. package/src/js/modules/statesManager/action.js +68 -68
  131. package/src/js/modules/statesManager/actions/_info.js +3 -3
  132. package/src/js/modules/statesManager/all.js +23 -23
  133. package/src/js/modules/statesManager/configStates.js +71 -71
  134. package/src/js/modules/statesManager/controller.js +170 -170
  135. package/src/js/modules/statesManager/functionsStorage.js +82 -82
  136. package/src/js/modules/statesManager/helper.js +27 -27
  137. package/src/js/modules/statesManager/race.js +75 -75
  138. package/src/js/modules/statesManager/sequence.js +47 -47
  139. package/src/js/modules/template/_info.js +6 -6
  140. package/src/js/modules/template/controller.js +28 -28
  141. package/src/js/modules/template/model.js +11 -11
  142. package/src/js/modules/template/service.js +137 -137
  143. package/src/js/modules/template/types.js +46 -46
  144. package/src/js/modules/transport/_info.js +8 -8
  145. package/src/js/modules/transport/baseConnectionType.js +24 -24
  146. package/src/js/modules/transport/config.js +13 -13
  147. package/src/js/modules/transport/connectionTypes/_info.js +3 -3
  148. package/src/js/modules/transport/connectionTypes/websocket.js +74 -74
  149. package/src/js/modules/transport/connectionTypes/xhr.js +44 -44
  150. package/src/js/modules/transport/controller.js +48 -48
  151. package/src/js/modules/transport/decorator.js +17 -17
  152. package/src/js/modules/transport/service.js +153 -153
  153. package/src/js/templates/_info.js +4 -4
  154. package/src/js/templates/groups/_info.js +1 -1
  155. package/src/js/templates/scenes/_info.js +1 -1
  156. package/webpack.config.js +47 -47
@@ -1,34 +1,34 @@
1
- class ModulesObjectsModelsImage extends Urso.Core.Modules.Objects.BaseModel {
2
- constructor(params) {
3
- super(params);
4
-
5
- this.type = Urso.types.objects.IMAGE;
6
- this._addBaseObject();
7
- }
8
-
9
- setupParams(params) {
10
- super.setupParams(params);
11
-
12
- this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
13
- }
14
-
15
- changeTexture(assetKey) {
16
- this.assetKey = assetKey;
17
-
18
- this._addBaseObject();
19
- }
20
-
21
- _addBaseObject() {
22
- let texture = Urso.cache.getTexture(this.assetKey)
23
-
24
- if (!texture)
25
- Urso.logger.error('ModulesObjectsModelsImage assets error: no image with key: ' + this.assetKey);
26
-
27
- if (!this._baseObject)
28
- this._baseObject = new PIXI.Sprite(texture);
29
- else
30
- this._baseObject.texture = texture;
31
- };
32
- }
33
-
34
- module.exports = ModulesObjectsModelsImage;
1
+ class ModulesObjectsModelsImage extends Urso.Core.Modules.Objects.BaseModel {
2
+ constructor(params) {
3
+ super(params);
4
+
5
+ this.type = Urso.types.objects.IMAGE;
6
+ this._addBaseObject();
7
+ }
8
+
9
+ setupParams(params) {
10
+ super.setupParams(params);
11
+
12
+ this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
13
+ }
14
+
15
+ changeTexture(assetKey) {
16
+ this.assetKey = assetKey;
17
+
18
+ this._addBaseObject();
19
+ }
20
+
21
+ _addBaseObject() {
22
+ let texture = Urso.cache.getTexture(this.assetKey)
23
+
24
+ if (!texture)
25
+ Urso.logger.error('ModulesObjectsModelsImage assets error: no image with key: ' + this.assetKey);
26
+
27
+ if (!this._baseObject)
28
+ this._baseObject = new PIXI.Sprite(texture);
29
+ else
30
+ this._baseObject.texture = texture;
31
+ };
32
+ }
33
+
34
+ module.exports = ModulesObjectsModelsImage;
@@ -1,113 +1,113 @@
1
- class ModulesObjectsModelsImagesAnimation extends Urso.Core.Modules.Objects.BaseModel {
2
- constructor(params) {
3
- super(params);
4
-
5
- this.type = Urso.types.objects.IMAGESANIMATION;
6
-
7
- //sys
8
- this._tween = null;
9
- this._currentFrame = -1;
10
- this._defaultTexture;
11
- this._animationTextures = {};
12
-
13
- this._addBaseObject();
14
- }
15
-
16
- setupParams(params) {
17
- super.setupParams(params);
18
-
19
- this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
20
-
21
- this.duration = Urso.helper.recursiveGet('duration', params, 0);
22
- this.animationKeys = Urso.helper.recursiveGet('animationKeys', params, []);
23
- this.loop = Urso.helper.recursiveGet('loop', params, false);
24
- this.autostart = Urso.helper.recursiveGet('autostart', params, false);
25
- this.onComplete = Urso.helper.recursiveGet('onComplete', params, false);
26
- }
27
-
28
- _addBaseObject() {
29
- let texture = Urso.cache.getTexture(this.assetKey)
30
-
31
- if (!texture)
32
- Urso.logger.error('ModulesObjectsModelsImage assets error: no image ' + this.assetKey);
33
-
34
- this._defaultTexture = texture;
35
- this._baseObject = new PIXI.Sprite(this._defaultTexture);
36
-
37
- this._createAnimationTextures();
38
-
39
- if (this.autostart)
40
- this.start();
41
- };
42
-
43
- start() {
44
- this._createTween();
45
- };
46
-
47
- stop() {
48
- if (!this._tween)
49
- return false;
50
-
51
- this._stopAnimation();
52
- };
53
-
54
- _createAnimationTextures() {
55
- for (let key in this.animationKeys) {
56
- let texture = Urso.cache.getTexture(this.animationKeys[key]);
57
-
58
- if (!texture)
59
- continue;
60
-
61
- this._animationTextures[key] = texture;
62
- }
63
-
64
- return this._animationTextures;
65
- }
66
-
67
- _createTween() {
68
- const totalFrames = this.animationKeys.length;
69
- const tweenParams = { x: totalFrames, duration: this.duration / 1000, ease: "none" };
70
-
71
- if (this.loop)
72
- tweenParams.repeat = -1;
73
-
74
- this._tween = gsap.to({ x: 0 }, tweenParams);
75
-
76
- this._tween.eventCallback("onUpdate", this._onUpdate.bind(this));
77
-
78
- this._tween.eventCallback("onComplete", () => {
79
- this._baseObject.texture = this._defaultTexture;
80
- this._onComplete();
81
- });
82
- }
83
-
84
- _onUpdate() {
85
- if (!this._tween)
86
- return;
87
-
88
- let frameIndex = ~~this._tween.targets()[0].x;
89
- const totalFrames = this.animationKeys.length;
90
-
91
- const frameKey = this.animationKeys[frameIndex];
92
-
93
- if (this._currentFrame !== frameKey) {
94
- this._baseObject.texture = this._animationTextures[frameIndex];
95
- this._currentFrame = frameKey;
96
- }
97
- }
98
-
99
- _onComplete() {
100
- if (this.onComplete)
101
- this.onComplete();
102
- };
103
-
104
- _stopAnimation() {
105
- this._tween.kill();
106
- this._baseObject.texture = this._defaultTexture;
107
-
108
- this._onComplete();
109
- }
110
-
111
- }
112
-
113
- module.exports = ModulesObjectsModelsImagesAnimation;
1
+ class ModulesObjectsModelsImagesAnimation extends Urso.Core.Modules.Objects.BaseModel {
2
+ constructor(params) {
3
+ super(params);
4
+
5
+ this.type = Urso.types.objects.IMAGESANIMATION;
6
+
7
+ //sys
8
+ this._tween = null;
9
+ this._currentFrame = -1;
10
+ this._defaultTexture;
11
+ this._animationTextures = {};
12
+
13
+ this._addBaseObject();
14
+ }
15
+
16
+ setupParams(params) {
17
+ super.setupParams(params);
18
+
19
+ this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
20
+
21
+ this.duration = Urso.helper.recursiveGet('duration', params, 0);
22
+ this.animationKeys = Urso.helper.recursiveGet('animationKeys', params, []);
23
+ this.loop = Urso.helper.recursiveGet('loop', params, false);
24
+ this.autostart = Urso.helper.recursiveGet('autostart', params, false);
25
+ this.onComplete = Urso.helper.recursiveGet('onComplete', params, false);
26
+ }
27
+
28
+ _addBaseObject() {
29
+ let texture = Urso.cache.getTexture(this.assetKey)
30
+
31
+ if (!texture)
32
+ Urso.logger.error('ModulesObjectsModelsImage assets error: no image ' + this.assetKey);
33
+
34
+ this._defaultTexture = texture;
35
+ this._baseObject = new PIXI.Sprite(this._defaultTexture);
36
+
37
+ this._createAnimationTextures();
38
+
39
+ if (this.autostart)
40
+ this.start();
41
+ };
42
+
43
+ start() {
44
+ this._createTween();
45
+ };
46
+
47
+ stop() {
48
+ if (!this._tween)
49
+ return false;
50
+
51
+ this._stopAnimation();
52
+ };
53
+
54
+ _createAnimationTextures() {
55
+ for (let key in this.animationKeys) {
56
+ let texture = Urso.cache.getTexture(this.animationKeys[key]);
57
+
58
+ if (!texture)
59
+ continue;
60
+
61
+ this._animationTextures[key] = texture;
62
+ }
63
+
64
+ return this._animationTextures;
65
+ }
66
+
67
+ _createTween() {
68
+ const totalFrames = this.animationKeys.length;
69
+ const tweenParams = { x: totalFrames, duration: this.duration / 1000, ease: "none" };
70
+
71
+ if (this.loop)
72
+ tweenParams.repeat = -1;
73
+
74
+ this._tween = gsap.to({ x: 0 }, tweenParams);
75
+
76
+ this._tween.eventCallback("onUpdate", this._onUpdate.bind(this));
77
+
78
+ this._tween.eventCallback("onComplete", () => {
79
+ this._baseObject.texture = this._defaultTexture;
80
+ this._onComplete();
81
+ });
82
+ }
83
+
84
+ _onUpdate() {
85
+ if (!this._tween)
86
+ return;
87
+
88
+ let frameIndex = ~~this._tween.targets()[0].x;
89
+ const totalFrames = this.animationKeys.length;
90
+
91
+ const frameKey = this.animationKeys[frameIndex];
92
+
93
+ if (this._currentFrame !== frameKey) {
94
+ this._baseObject.texture = this._animationTextures[frameIndex];
95
+ this._currentFrame = frameKey;
96
+ }
97
+ }
98
+
99
+ _onComplete() {
100
+ if (this.onComplete)
101
+ this.onComplete();
102
+ };
103
+
104
+ _stopAnimation() {
105
+ this._tween.kill();
106
+ this._baseObject.texture = this._defaultTexture;
107
+
108
+ this._onComplete();
109
+ }
110
+
111
+ }
112
+
113
+ module.exports = ModulesObjectsModelsImagesAnimation;
@@ -1,38 +1,38 @@
1
- class ModulesObjectsModelsMask extends Urso.Core.Modules.Objects.BaseModel {
2
- constructor(params) {
3
- super(params);
4
-
5
- this.type = Urso.types.objects.MASK;
6
- this._addBaseObject();
7
- }
8
-
9
- setupParams(params) {
10
- super.setupParams(params);
11
-
12
- //NOTE: you can use just one key: rectangle or rectangles
13
- this.rectangle = Urso.helper.recursiveGet('rectangle', params, false); // [50, 50, 100, 100]
14
- this.rectangles = Urso.helper.recursiveGet('rectangles', params, false); //array of rectangles
15
- }
16
-
17
- _addBaseObject() {
18
- let mask = new PIXI.Graphics();
19
- mask.lineStyle(0);
20
- mask.beginFill(0xffffff);
21
-
22
- if (this.rectangle)
23
- this._drawRect(mask, this.rectangle);
24
- else if (this.rectangles)
25
- for (let rectangle of this.rectangles)
26
- this._drawRect(mask, rectangle);
27
-
28
- mask.endFill();
29
-
30
- this._baseObject = mask;
31
- };
32
-
33
- _drawRect(maskObject, rectangle) {
34
- maskObject.drawRect(rectangle[0], rectangle[1], rectangle[2], rectangle[3]);
35
- }
36
- }
37
-
38
- module.exports = ModulesObjectsModelsMask;
1
+ class ModulesObjectsModelsMask extends Urso.Core.Modules.Objects.BaseModel {
2
+ constructor(params) {
3
+ super(params);
4
+
5
+ this.type = Urso.types.objects.MASK;
6
+ this._addBaseObject();
7
+ }
8
+
9
+ setupParams(params) {
10
+ super.setupParams(params);
11
+
12
+ //NOTE: you can use just one key: rectangle or rectangles
13
+ this.rectangle = Urso.helper.recursiveGet('rectangle', params, false); // [50, 50, 100, 100]
14
+ this.rectangles = Urso.helper.recursiveGet('rectangles', params, false); //array of rectangles
15
+ }
16
+
17
+ _addBaseObject() {
18
+ let mask = new PIXI.Graphics();
19
+ mask.lineStyle(0);
20
+ mask.beginFill(0xffffff);
21
+
22
+ if (this.rectangle)
23
+ this._drawRect(mask, this.rectangle);
24
+ else if (this.rectangles)
25
+ for (let rectangle of this.rectangles)
26
+ this._drawRect(mask, rectangle);
27
+
28
+ mask.endFill();
29
+
30
+ this._baseObject = mask;
31
+ };
32
+
33
+ _drawRect(maskObject, rectangle) {
34
+ maskObject.drawRect(rectangle[0], rectangle[1], rectangle[2], rectangle[3]);
35
+ }
36
+ }
37
+
38
+ module.exports = ModulesObjectsModelsMask;
@@ -1,30 +1,30 @@
1
- class ModulesObjectsModelsNineSlicePlane extends Urso.Core.Modules.Objects.BaseModel {
2
- constructor(params) {
3
- super(params);
4
-
5
- this.type = Urso.types.objects.NINESLICEPLANE;
6
- this._addBaseObject();
7
- }
8
-
9
- setupParams(params) {
10
- super.setupParams(params);
11
-
12
- this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
13
- this.leftWidth = Urso.helper.recursiveGet('leftWidth', params, false);
14
- this.topHeight = Urso.helper.recursiveGet('topHeight', params, false);
15
- this.rightWidth = Urso.helper.recursiveGet('rightWidth', params, false);
16
- this.bottomHeight = Urso.helper.recursiveGet('bottomHeight', params, false);
17
- }
18
-
19
-
20
- _addBaseObject() {
21
- let texture = Urso.cache.getTexture(this.assetKey)
22
-
23
- if (!texture)
24
- Urso.logger.error('ModulesObjectsModelsImage assets error: no image with key: ' + this.assetKey);
25
-
26
- this._baseObject = new PIXI.NineSlicePlane(texture, this.leftWidth, this.topHeight, this.rightWidth, this.bottomHeight);
27
- };
28
- }
29
-
30
- module.exports = ModulesObjectsModelsNineSlicePlane;
1
+ class ModulesObjectsModelsNineSlicePlane extends Urso.Core.Modules.Objects.BaseModel {
2
+ constructor(params) {
3
+ super(params);
4
+
5
+ this.type = Urso.types.objects.NINESLICEPLANE;
6
+ this._addBaseObject();
7
+ }
8
+
9
+ setupParams(params) {
10
+ super.setupParams(params);
11
+
12
+ this.assetKey = Urso.helper.recursiveGet('assetKey', params, false);
13
+ this.leftWidth = Urso.helper.recursiveGet('leftWidth', params, false);
14
+ this.topHeight = Urso.helper.recursiveGet('topHeight', params, false);
15
+ this.rightWidth = Urso.helper.recursiveGet('rightWidth', params, false);
16
+ this.bottomHeight = Urso.helper.recursiveGet('bottomHeight', params, false);
17
+ }
18
+
19
+
20
+ _addBaseObject() {
21
+ let texture = Urso.cache.getTexture(this.assetKey)
22
+
23
+ if (!texture)
24
+ Urso.logger.error('ModulesObjectsModelsImage assets error: no image with key: ' + this.assetKey);
25
+
26
+ this._baseObject = new PIXI.NineSlicePlane(texture, this.leftWidth, this.topHeight, this.rightWidth, this.bottomHeight);
27
+ };
28
+ }
29
+
30
+ module.exports = ModulesObjectsModelsNineSlicePlane;
@@ -1,65 +1,65 @@
1
- class ModulesObjectsModelsScrollbox extends Urso.Core.Modules.Objects.BaseModel {
2
- constructor(params) {
3
- super(params);
4
-
5
- this.type = Urso.types.objects.SCROLLBOX;
6
- this._addBaseObject();
7
- this._createScrollContent();
8
- }
9
-
10
- setupParams(params) {
11
- super.setupParams(params);
12
-
13
- this.scrollContent = Urso.helper.recursiveGet('scrollContent', params, []);
14
- this.dragScroll = Urso.helper.recursiveGet('dragScroll', params, true);
15
- this.scrollType = Urso.helper.recursiveGet('scrollType', params, 'auto'); // hidden / hiddenVertical / hiddenHorizontal / auto
16
-
17
- this.width = Urso.helper.recursiveGet('width', params, false); //number format
18
- this.height = Urso.helper.recursiveGet('height', params, false); //number format
19
- }
20
-
21
- _getScrollboxParams() {
22
- return {
23
- boxWidth: this.width,
24
- boxHeight: this.height,
25
- dragScroll: this.dragScroll,
26
- fade: true,
27
- fadeScrollbarTime: 300
28
- }
29
- }
30
-
31
- _setScrollWidth() {
32
- if (this.scrollType === 'hiddenHorizontal' || this.scrollType === 'hidden') {
33
- this._baseObject.scrollWidth = this.width;
34
- this._baseObject.overflowX = 'hidden';
35
- }
36
- }
37
-
38
- _setScrollHeight() {
39
- if (this.scrollType === 'hiddenVertical' || this.scrollType === 'hidden') {
40
- this._baseObject.scrollHeight = this.height;
41
- this._baseObject.overflowY = 'hidden';
42
- }
43
- }
44
-
45
- _createScrollContent() {
46
- this.scrollContent.forEach(child => {
47
- let object = Urso.objects.create(child);
48
- this._baseObject.content.addChild(object._baseObject);
49
- });
50
-
51
- this._baseObject.update();
52
- }
53
-
54
- _addBaseObject() {
55
- const params = this._getScrollboxParams();
56
-
57
- const Scrollbox = require('pixi-scrollbox').Scrollbox;
58
- this._baseObject = new Scrollbox(params);
59
-
60
- this._setScrollHeight();
61
- this._setScrollWidth();
62
- };
63
- }
64
-
1
+ class ModulesObjectsModelsScrollbox extends Urso.Core.Modules.Objects.BaseModel {
2
+ constructor(params) {
3
+ super(params);
4
+
5
+ this.type = Urso.types.objects.SCROLLBOX;
6
+ this._addBaseObject();
7
+ this._createScrollContent();
8
+ }
9
+
10
+ setupParams(params) {
11
+ super.setupParams(params);
12
+
13
+ this.scrollContent = Urso.helper.recursiveGet('scrollContent', params, []);
14
+ this.dragScroll = Urso.helper.recursiveGet('dragScroll', params, true);
15
+ this.scrollType = Urso.helper.recursiveGet('scrollType', params, 'auto'); // hidden / hiddenVertical / hiddenHorizontal / auto
16
+
17
+ this.width = Urso.helper.recursiveGet('width', params, false); //number format
18
+ this.height = Urso.helper.recursiveGet('height', params, false); //number format
19
+ }
20
+
21
+ _getScrollboxParams() {
22
+ return {
23
+ boxWidth: this.width,
24
+ boxHeight: this.height,
25
+ dragScroll: this.dragScroll,
26
+ fade: true,
27
+ fadeScrollbarTime: 300
28
+ }
29
+ }
30
+
31
+ _setScrollWidth() {
32
+ if (this.scrollType === 'hiddenHorizontal' || this.scrollType === 'hidden') {
33
+ this._baseObject.scrollWidth = this.width;
34
+ this._baseObject.overflowX = 'hidden';
35
+ }
36
+ }
37
+
38
+ _setScrollHeight() {
39
+ if (this.scrollType === 'hiddenVertical' || this.scrollType === 'hidden') {
40
+ this._baseObject.scrollHeight = this.height;
41
+ this._baseObject.overflowY = 'hidden';
42
+ }
43
+ }
44
+
45
+ _createScrollContent() {
46
+ this.scrollContent.forEach(child => {
47
+ let object = Urso.objects.create(child);
48
+ this._baseObject.content.addChild(object._baseObject);
49
+ });
50
+
51
+ this._baseObject.update();
52
+ }
53
+
54
+ _addBaseObject() {
55
+ const params = this._getScrollboxParams();
56
+
57
+ const Scrollbox = require('pixi-scrollbox').Scrollbox;
58
+ this._baseObject = new Scrollbox(params);
59
+
60
+ this._setScrollHeight();
61
+ this._setScrollWidth();
62
+ };
63
+ }
64
+
65
65
  module.exports = ModulesObjectsModelsScrollbox