@woosh/meep-engine 2.36.1 → 2.36.2

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.
@@ -3,4 +3,14 @@ import {Color} from "../../../../core/color/Color";
3
3
  export class HighlightDefinition {
4
4
  color: Color
5
5
  opacity: number
6
+
7
+ static rgba(r: number, g: number, b: number, a?: number): HighlightDefinition
8
+
9
+ equals(other: HighlightDefinition): boolean
10
+
11
+ hash(): number
12
+
13
+ fromJSON(json: any): void
14
+
15
+ toJSON(): any
6
16
  }
@@ -1,6 +1,5 @@
1
1
  import { Color } from "../../../../core/color/Color.js";
2
2
  import { assert } from "../../../../core/assert.js";
3
- import { COMPONENT_SERIALIZATION_TRANSIENT_FIELD } from "../../../ecs/storage/COMPONENT_SERIALIZATION_TRANSIENT_FIELD.js";
4
3
  import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
5
4
  import { computeHashFloat } from "../../../../core/math/hash/computeHashFloat.js";
6
5
 
@@ -8,7 +7,7 @@ export class HighlightDefinition {
8
7
  constructor() {
9
8
 
10
9
  /**
11
- *
10
+ * @readonly
12
11
  * @type {Color}
13
12
  */
14
13
  this.color = new Color();
@@ -18,12 +17,6 @@ export class HighlightDefinition {
18
17
  * @type {number}
19
18
  */
20
19
  this.opacity = 1;
21
-
22
- /**
23
- *
24
- * @type {boolean}
25
- */
26
- this[COMPONENT_SERIALIZATION_TRANSIENT_FIELD] = false;
27
20
  }
28
21
 
29
22
  /**
@@ -73,4 +66,21 @@ export class HighlightDefinition {
73
66
 
74
67
  return r;
75
68
  }
69
+
70
+ /**
71
+ *
72
+ * @param {number} r
73
+ * @param {number} g
74
+ * @param {number} b
75
+ * @param {number} [a]
76
+ * @return {HighlightDefinition}
77
+ */
78
+ static rgba(r, g, b, a = 1) {
79
+ const result = new HighlightDefinition();
80
+
81
+ result.color.setRGB(r, g, b);
82
+ result.opacity = a;
83
+
84
+ return result;
85
+ }
76
86
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.36.1",
8
+ "version": "2.36.2",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",