react-simple-game-engine 0.1.0 → 0.1.1
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
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
import p5 from "p5";
|
2
|
-
import { Camera } from "./camera";
|
3
2
|
declare type ItemWithPercent<I> = [I, number];
|
4
3
|
declare type LastItem<I> = [I];
|
5
4
|
export declare type Collection<I> = [...ItemWithPercent<I>[], LastItem<I>];
|
6
5
|
export declare class P5 extends p5 {
|
7
|
-
private _simpleCamera;
|
8
6
|
constructor(sketch: (p5: P5) => void, width: number, height: number);
|
9
|
-
get simpleCamera(): Camera;
|
10
7
|
choose<I = any>(collection: Collection<I>): I;
|
11
8
|
}
|
12
9
|
export {};
|
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;
|
1
|
+
{"version":3,"file":"p5.d.ts","sourceRoot":"","sources":["../../src/classes/p5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,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;gBACZ,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMnE,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;CAgC9C"}
|
package/lib/classes/p5.js
CHANGED
@@ -20,16 +20,9 @@ var P5 = /** @class */ (function (_super) {
|
|
20
20
|
function P5(sketch, width, height) {
|
21
21
|
var _this = _super.call(this, sketch) || this;
|
22
22
|
window.Renderer = _this;
|
23
|
-
|
23
|
+
window.camera = new Camera(width, height);
|
24
24
|
return _this;
|
25
25
|
}
|
26
|
-
Object.defineProperty(P5.prototype, "simpleCamera", {
|
27
|
-
get: function () {
|
28
|
-
return this._simpleCamera;
|
29
|
-
},
|
30
|
-
enumerable: false,
|
31
|
-
configurable: true
|
32
|
-
});
|
33
26
|
P5.prototype.choose = function (collection) {
|
34
27
|
var lastItem = collection[collection.length - 1];
|
35
28
|
var restItems = collection.slice(0, collection.length - 1);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Sketch.d.ts","sourceRoot":"","sources":["../../src/ui-components/Sketch.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,aAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,WAAW,
|
1
|
+
{"version":3,"file":"Sketch.d.ts","sourceRoot":"","sources":["../../src/ui-components/Sketch.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,aAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,WAAW,eA4Bb"}
|
@@ -11,10 +11,9 @@ export function Sketch(_a) {
|
|
11
11
|
};
|
12
12
|
s.setup = function () {
|
13
13
|
s.createCanvas(width, height).parent(refContainer.current);
|
14
|
-
onSetup(
|
14
|
+
onSetup(camera);
|
15
15
|
};
|
16
16
|
s.draw = function () {
|
17
|
-
var camera = s.simpleCamera;
|
18
17
|
s.scale(camera.scaleX, camera.scaleY);
|
19
18
|
s.background(0);
|
20
19
|
s.imageMode(s.CENTER);
|