@urso/core 0.7.93-dev → 0.7.93

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.
@@ -149,10 +149,10 @@ object-assign
149
149
  */
150
150
 
151
151
  /*!
152
- * GSAP 3.12.5
152
+ * GSAP 3.12.7
153
153
  * https://gsap.com
154
154
  *
155
- * @license Copyright 2008-2024, GreenSock. All rights reserved.
155
+ * @license Copyright 2008-2025, GreenSock. All rights reserved.
156
156
  * Subject to the terms at https://gsap.com/standard-license or for
157
157
  * Club GSAP members, the agreement issued with that membership.
158
158
  * @author: Jack Doyle, jack@greensock.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.93-dev",
3
+ "version": "0.7.93",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -30,7 +30,8 @@
30
30
  "pixi-scrollbox": "^2.3.1",
31
31
  "pixi-spine": "^3.1.2",
32
32
  "pixi-viewport": "^4.34.0",
33
- "pixi.js": "^6.2.0"
33
+ "pixi.js": "^6.2.0",
34
+ "pixi-text-input": "^1.2.1"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@babel/core": "^7.12.10",
@@ -1,10 +1,12 @@
1
1
  import * as PIXI from 'pixi.js';
2
+ import TextInput from 'pixi-text-input';
2
3
  window.PIXI = PIXI;
3
4
  window.PIXI.particles = require('pixi-particles');
4
5
 
5
6
  window.PIXI.particlesFx = require('@urso/revolt-fx');
6
7
 
7
8
  window.PIXI.spine = require("pixi-spine");
9
+ window.PIXI.TextInput = TextInput;
8
10
 
9
11
  import { AtlasAttachmentLoader, SkeletonJson } from "@pixi-spine/runtime-3.8";
10
12
  window.PIXI.spine.AtlasAttachmentLoader = AtlasAttachmentLoader;
@@ -1,9 +1,11 @@
1
1
  const ModulesObjectsBaseModel = require('./../baseModel');
2
2
 
3
3
  class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
4
+
4
5
  constructor(params) {
5
6
  super(params);
6
7
  this._isDisabled = false;
8
+ this._isDown = false;
7
9
 
8
10
  this.type = Urso.types.objects.HITAREA;
9
11
 
@@ -24,6 +26,17 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
24
26
  this.onOverCallback = Urso.helper.recursiveGet('onOverCallback', params, false);
25
27
  this.onOutCallback = Urso.helper.recursiveGet('onOutCallback', params, false);
26
28
  this.onTouchMoveCallback = Urso.helper.recursiveGet('onTouchMoveCallback', params, false);
29
+
30
+ /**
31
+ * customInteractionArea object ex:
32
+ * Circle: { "type": "circle", "params": [0, 0, 100] }
33
+ * Rectangle: { "type": "rectangle", "params": [0, 0, 100, 100] }
34
+ * Polygon: {
35
+ * "type": "polygon",
36
+ * "params": [ 0, 0, 100, 0, 100, 100, 50, 150, 0, 100 ];
37
+ * }
38
+ * */
39
+ this.customInteractionArea = Urso.helper.recursiveGet('customInteractionArea', params, null);
27
40
  }
28
41
 
29
42
  enable() {
@@ -56,11 +69,14 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
56
69
  this._baseObject
57
70
  .on('pointerdown', this._onPressDown.bind(this))
58
71
  .on('pointerup', this._onPressUp.bind(this))
59
- .on('pointerupoutside', this._onPressUp.bind(this))
72
+ .on('pointerupoutside', this._onPressUpOutside.bind(this))
60
73
  .on('pointerover', this._onOver.bind(this))
61
74
  .on('pointerout', this._onOut.bind(this))
62
75
  .on('touchmove', this._onTouchmove.bind(this));
63
- };
76
+
77
+ if (this.customInteractionArea)
78
+ this._baseObject.hitArea = this._getHitAreaObject(this.customInteractionArea);
79
+ }
64
80
 
65
81
  _onTouchmove(event) {
66
82
  const position = this._getEventLocalPosition(event);
@@ -73,6 +89,11 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
73
89
  if (this._isDisabled)
74
90
  return false;
75
91
 
92
+ if (this._isDown)
93
+ return false;
94
+
95
+ this._isDown = true;
96
+
76
97
  if (this.keyDownAction) {
77
98
  const position = this._getEventLocalPosition(event);
78
99
  this.keyDownAction(position);
@@ -83,12 +104,24 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
83
104
  if (this._isDisabled)
84
105
  return false;
85
106
 
107
+ if (!this._isDown)
108
+ return false;
109
+
110
+ this._isDown = false;
111
+
86
112
  if (this.action) {
87
113
  const position = this._getEventLocalPosition(event);
88
114
  this.action(position);
89
115
  }
90
116
  }
91
117
 
118
+ _onPressUpOutside() {
119
+ if (this._isDisabled)
120
+ return false;
121
+
122
+ this._isDown = false;
123
+ }
124
+
92
125
  _onOver() {
93
126
  if (this._isDisabled)
94
127
  return false;
@@ -114,6 +147,24 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
114
147
 
115
148
  return { x, y };
116
149
  }
150
+
151
+ _getHitAreaObject({ type, params }) {
152
+ if (!type) {
153
+ return null;
154
+ }
155
+
156
+ const objects = {
157
+ 'rectangle': PIXI.Rectangle,
158
+ 'circle': PIXI.Circle,
159
+ 'polygon': PIXI.Polygon
160
+ }
161
+
162
+ if (!objects[type]) {
163
+ return null;
164
+ }
165
+
166
+ return new objects[type](...params);
167
+ }
117
168
  }
118
169
 
119
170
  module.exports = ModulesObjectsModelsHitArea;
@@ -323,7 +323,7 @@ class PropertyAdapter {
323
323
  case 'left':
324
324
  return 0;
325
325
  case 'right':
326
- return object.parent ? this._getWidthAsNumber(object.parent) - this._getWidthAsNumber(object) : 0; //parentWidth-objectWidth
326
+ return object.parent ? this._getWidthAsNumber(object.parent) : 0; //parentWidth
327
327
  case 'center':
328
328
  const parentWidth = object.parent ? this._getWidthAsNumber(object.parent) : 0;
329
329
  return parentWidth / 2;
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_urso_core=self.webpackChunk_urso_core||[]).push([[162],{88058:(d,a,r)=>{var O=r(8507),X=r(36697),e=r(46719);O.XO.add(X.U),O.XO.add(e.y)},42162:(d,a,r)=>{r.r(a),r(88058),r(26197),r(17801),r(25361),r(28849),r(28299),r(15311),r(4241),r(11981),r(51437),r(95902)},95902:(d,a,r)=>{var O=r(8507),X=r(69430),e=r(90825);O.XO.add(e.u),O.XO.add(X.L)},25361:(d,a,r)=>{var O=r(8507),X=r(40378),e=r(49260);O.XO.add(e.S),O.XO.add(X.GH)},28849:(d,a,r)=>{var O=r(8507),X=r(41892);O.XO.add(X.G)},51437:(d,a,r)=>{var O=r(8507),X=r(56880);O.XO.add(X.e)},11981:(d,a,r)=>{var O=r(8507),X=r(75773);O.XO.add(X.x)},15311:(d,a,r)=>{var O=r(8507),X=r(70661);O.XO.add(X.n)},4241:(d,a,r)=>{var O=r(8507),X=r(76829),e=r(47602);O.XO.add(e.Q),O.XO.add(X.n)},28299:(d,a,r)=>{var O=r(8507),X=r(45369),e=r(87278);O.XO.add(e.p),O.XO.add(X.e)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_urso_core=self.webpackChunk_urso_core||[]).push([[24],{88058:(d,a,r)=>{var O=r(8507),X=r(36697),v=r(46719);O.XO.add(X.U),O.XO.add(v.y)},22024:(d,a,r)=>{r.r(a);var O=r(8507),X=r(44980),v=r(83946),e=r(74302);O.XO.add(v.a),X.mc.mixin(e.K),r(88058);var c=r(60809),s=r(90317);O.XO.add(c.C),X.mc.mixin(s.e),r(26197),r(17801),r(25361),r(28849),r(28299),r(15311),r(4241),r(11981),r(51437),r(95902)},95902:(d,a,r)=>{var O=r(8507),X=r(69430),v=r(90825);O.XO.add(v.u),O.XO.add(X.L)},25361:(d,a,r)=>{var O=r(8507),X=r(40378),v=r(49260);O.XO.add(v.S),O.XO.add(X.GH)},28849:(d,a,r)=>{var O=r(8507),X=r(41892);O.XO.add(X.G)},51437:(d,a,r)=>{var O=r(8507),X=r(56880);O.XO.add(X.e)},11981:(d,a,r)=>{var O=r(8507),X=r(75773);O.XO.add(X.x)},15311:(d,a,r)=>{var O=r(8507),X=r(70661);O.XO.add(X.n)},4241:(d,a,r)=>{var O=r(8507),X=r(76829),v=r(47602);O.XO.add(v.Q),O.XO.add(X.n)},28299:(d,a,r)=>{var O=r(8507),X=r(45369),v=r(87278);O.XO.add(v.p),O.XO.add(X.e)}}]);