kaplay 3001.0.16 → 3001.0.18
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/dist/doc.d.ts +33 -7
- package/dist/kaboom.js +3 -3
- package/dist/kaplay.cjs +3 -3
- package/dist/kaplay.cjs.map +2 -2
- package/dist/kaplay.js +3 -3
- package/dist/kaplay.js.map +2 -2
- package/dist/kaplay.mjs +3 -3
- package/dist/kaplay.mjs.map +2 -2
- package/dist/types.d.ts +10474 -0
- package/package.json +8 -4
package/dist/doc.d.ts
CHANGED
|
@@ -1155,7 +1155,7 @@ export declare class TexPacker {
|
|
|
1155
1155
|
private gfx;
|
|
1156
1156
|
private padding;
|
|
1157
1157
|
constructor(gfx: GfxCtx, w: number, h: number, padding: number);
|
|
1158
|
-
|
|
1158
|
+
addSingle(img: ImageSource): [
|
|
1159
1159
|
Texture,
|
|
1160
1160
|
Quad,
|
|
1161
1161
|
number
|
|
@@ -3842,7 +3842,7 @@ export interface KAPLAYCtx<TButtonDef extends ButtonsDef = {}, TButton extends s
|
|
|
3842
3842
|
*
|
|
3843
3843
|
* // .jump is provided by body()
|
|
3844
3844
|
* player.jump();
|
|
3845
|
-
|
|
3845
|
+
*
|
|
3846
3846
|
* // .moveTo is provided by pos()
|
|
3847
3847
|
* player.moveTo(300, 200);
|
|
3848
3848
|
*
|
|
@@ -3857,11 +3857,11 @@ export interface KAPLAYCtx<TButtonDef extends ButtonsDef = {}, TButton extends s
|
|
|
3857
3857
|
* destroy(player);
|
|
3858
3858
|
* });
|
|
3859
3859
|
* ```
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3860
|
+
*
|
|
3861
|
+
* @param comps - List of components to add to the game object, or a game object made with {@link make `make()`}.
|
|
3862
|
+
* @returns The added game object that contains all properties and methods each component offers.
|
|
3863
|
+
* @group Game Obj
|
|
3864
|
+
*/
|
|
3865
3865
|
add<T>(comps?: CompList<T> | GameObj<T>): GameObj<T>;
|
|
3866
3866
|
/**
|
|
3867
3867
|
* Create a game object like add(), but not adding to the scene.
|
|
@@ -5025,6 +5025,31 @@ export interface KAPLAYCtx<TButtonDef extends ButtonsDef = {}, TButton extends s
|
|
|
5025
5025
|
/**
|
|
5026
5026
|
* A patrol which can follow waypoints to a goal.
|
|
5027
5027
|
*
|
|
5028
|
+
* @param opts - Options for the patrol component. See {@link PatrolCompOpt `PatrolCompOpt`}.
|
|
5029
|
+
*
|
|
5030
|
+
* @example
|
|
5031
|
+
* ```js
|
|
5032
|
+
* const bean = add([
|
|
5033
|
+
* sprite("bean"),
|
|
5034
|
+
* pos(40, 30),
|
|
5035
|
+
* patrol({
|
|
5036
|
+
* waypoints: [
|
|
5037
|
+
* vec2(100, 100),
|
|
5038
|
+
* vec2(120, 170),
|
|
5039
|
+
* vec2(50, 50),
|
|
5040
|
+
* vec2(300, 100),
|
|
5041
|
+
* ],
|
|
5042
|
+
* }),
|
|
5043
|
+
* ]);
|
|
5044
|
+
*
|
|
5045
|
+
* bean.onPatrolFinished(gb => {
|
|
5046
|
+
* // Note that the position doesn't exactly match the last waypoint,
|
|
5047
|
+
* // this is an approximation.
|
|
5048
|
+
* debug.log(`Bean reached the end of the patrol at ${gb.pos.x}, ${gb.pos.y}`);
|
|
5049
|
+
* });
|
|
5050
|
+
* ```
|
|
5051
|
+
*
|
|
5052
|
+
* @returns The patrol comp.
|
|
5028
5053
|
* @since v3001.0
|
|
5029
5054
|
* @group Components
|
|
5030
5055
|
*/
|
|
@@ -7271,6 +7296,7 @@ export interface KAPLAYCtx<TButtonDef extends ButtonsDef = {}, TButton extends s
|
|
|
7271
7296
|
* @example
|
|
7272
7297
|
* ```js
|
|
7273
7298
|
* sky.color = rgb("#ef6360")
|
|
7299
|
+
* ```
|
|
7274
7300
|
*
|
|
7275
7301
|
* @returns The color.
|
|
7276
7302
|
* @since v2000.0
|