@urso/core 0.4.24 → 0.4.25

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.4.24",
3
+ "version": "0.4.25",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -98,6 +98,9 @@ class ModulesObjectsCreate {
98
98
  case Urso.types.objects.TEXTINPUT:
99
99
  model = this.getInstance('Models.TextInput', object);
100
100
  break;
101
+ case Urso.types.objects.NINESLICEPLANE:
102
+ model = this.getInstance('Models.NineSlicePlane', object);
103
+ break;
101
104
 
102
105
  default:
103
106
  const objectName = Urso.helper.capitaliseFirstLetter(
@@ -3,6 +3,7 @@ Urso.Core.Modules.Objects.Models = {
3
3
  BitmapText: require('./bitmapText.js'),
4
4
  Button: require('./button.js'),
5
5
  ButtonComposite: require('./buttonComposite.js'),
6
+ Checkbox: require('./checkbox.js'),
6
7
  Collection: require('./collection.js'),
7
8
  Component: require('./component.js'),
8
9
  Container: require('./container.js'),
@@ -13,12 +14,12 @@ Urso.Core.Modules.Objects.Models = {
13
14
  Image: require('./image.js'),
14
15
  ImagesAnimation: require('./imagesAnimation.js'),
15
16
  Mask: require('./mask.js'),
17
+ NineSlicePlane: require('./nineSlicePlane.js'),
18
+ Scrollbox: require('./scrollbox.js'),
19
+ Slider: require('./slider.js'),
16
20
  Spine: require('./spine.js'),
17
21
  Text: require('./text.js'),
18
- Slider: require('./slider.js'),
19
- Toggle: require('./toggle.js'),
20
- Checkbox: require('./checkbox.js'),
21
- Scrollbox: require('./scrollbox.js'),
22
22
  TextInput: require('./textInput.js'),
23
- World: require('./world.js')
23
+ Toggle: require('./toggle.js'),
24
+ World: require('./world.js')
24
25
  };
@@ -0,0 +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;
@@ -31,21 +31,22 @@ class PropertyAdapter {
31
31
  Urso.types.objects.COMPONENT,
32
32
  Urso.types.objects.CONTAINER,
33
33
  Urso.types.objects.GROUP,
34
- Urso.types.objects.WORLD,
35
- Urso.types.objects.SLIDER,
36
34
  Urso.types.objects.SCROLLBOX,
35
+ Urso.types.objects.SLIDER,
36
+ Urso.types.objects.WORLD
37
37
  ];
38
38
 
39
39
  this._typesWithoutAnchor = [
40
+ Urso.types.objects.CHECKBOX,
40
41
  Urso.types.objects.EMITTER,
41
42
  Urso.types.objects.GRAPHICS,
42
43
  Urso.types.objects.HITAREA,
43
44
  Urso.types.objects.MASK,
44
- Urso.types.objects.SPINE,
45
+ Urso.types.objects.NINESLICEPLANE,
45
46
  Urso.types.objects.SLIDER,
47
+ Urso.types.objects.SPINE,
46
48
  Urso.types.objects.TEXTINPUT,
47
- Urso.types.objects.CHECKBOX,
48
- Urso.types.objects.WORLD,
49
+ Urso.types.objects.WORLD
49
50
  ];
50
51
  }
51
52
 
@@ -35,7 +35,9 @@ class ModulesTemplateTypes {
35
35
  TOGGLE: 19,
36
36
  CHECKBOX: 20,
37
37
  SCROLLBOX: 21,
38
- TEXTINPUT: 22
38
+ TEXTINPUT: 22,
39
+ TEXTINPUT: 22,
40
+ NINESLICEPLANE: 23
39
41
  }
40
42
  }
41
43
  }