react-simple-game-engine 0.2.117 → 0.2.119
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/lib/classes/p5.d.ts +8 -0
- package/lib/classes/p5.d.ts.map +1 -1
- package/lib/classes/p5.js +10 -2
- package/package.json +1 -1
package/lib/classes/p5.d.ts
CHANGED
@@ -9,7 +9,15 @@ export declare class P5 extends p5 {
|
|
9
9
|
scaler: Scaler;
|
10
10
|
simpleCamera: SimpleCamera;
|
11
11
|
constructor(sketch: (p5: P5) => void);
|
12
|
+
/**
|
13
|
+
* Use this instead of mouseX
|
14
|
+
* @number
|
15
|
+
*/
|
12
16
|
get realMouseX(): number;
|
17
|
+
/**
|
18
|
+
* Use this instead of mouseY
|
19
|
+
* @number
|
20
|
+
*/
|
13
21
|
get realMouseY(): number;
|
14
22
|
get isForeground(): boolean;
|
15
23
|
constrainMax(value: number, max: number): number;
|
package/lib/classes/p5.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"p5.d.ts","sourceRoot":"","sources":["../../src/classes/p5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,aAAK,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACtC,aAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEvB,oBAAY,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE,qBAAa,EAAG,SAAQ,EAAE;IACxB,OAAO,UAAQ;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;gBAEf,MAAM,EAAE,C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EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;CA+B9C"}
|
package/lib/classes/p5.js
CHANGED
@@ -22,15 +22,23 @@ var P5 = /** @class */ (function (_super) {
|
|
22
22
|
return _this;
|
23
23
|
}
|
24
24
|
Object.defineProperty(P5.prototype, "realMouseX", {
|
25
|
+
/**
|
26
|
+
* Use this instead of mouseX
|
27
|
+
* @number
|
28
|
+
*/
|
25
29
|
get: function () {
|
26
|
-
return (this.mouseX / this.scaler.value - this.width / 2
|
30
|
+
return (this.mouseX / this.scaler.value - this.width / 2 + this.simpleCamera.x);
|
27
31
|
},
|
28
32
|
enumerable: false,
|
29
33
|
configurable: true
|
30
34
|
});
|
31
35
|
Object.defineProperty(P5.prototype, "realMouseY", {
|
36
|
+
/**
|
37
|
+
* Use this instead of mouseY
|
38
|
+
* @number
|
39
|
+
*/
|
32
40
|
get: function () {
|
33
|
-
return (this.mouseY / this.scaler.value - this.height / 2
|
41
|
+
return (this.mouseY / this.scaler.value - this.height / 2 + this.simpleCamera.y);
|
34
42
|
},
|
35
43
|
enumerable: false,
|
36
44
|
configurable: true
|