@idosgames/characters 0.1.2 → 0.1.4
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/{PartsManager-CAVBKvp6.d.ts → PartsManager-BpAUMQXw.d.ts} +100 -10
- package/dist/{PartsManager-Cn3MU-VS.d.cts → PartsManager-CmrzoyJR.d.cts} +100 -10
- package/dist/chunk-CMQ6UYQV.js +2 -0
- package/dist/chunk-I7UPBAMR.js +1 -0
- package/dist/chunk-JZU255IQ.js +1 -0
- package/dist/chunk-UUX4NEC2.js +2 -0
- package/dist/rig2d/editor/index.cjs +6 -2
- package/dist/rig2d/editor/index.d.cts +4 -2
- package/dist/rig2d/editor/index.d.ts +4 -2
- package/dist/rig2d/editor/index.js +6 -2
- package/dist/rig2d/index.cjs +4 -4
- package/dist/rig2d/index.d.cts +26 -4
- package/dist/rig2d/index.d.ts +26 -4
- package/dist/rig2d/index.js +4 -4
- package/dist/rig2d/phaser/index.cjs +2 -2
- package/dist/rig2d/phaser/index.d.cts +1 -1
- package/dist/rig2d/phaser/index.d.ts +1 -1
- package/dist/rig2d/phaser/index.js +1 -1
- package/dist/rig2d/three/index.cjs +1 -1
- package/dist/rig2d/three/index.d.cts +1 -1
- package/dist/rig2d/three/index.d.ts +1 -1
- package/dist/rig2d/three/index.js +1 -1
- package/dist/{thumbnail-BhGEEXux.d.cts → thumbnail-B1WjbWcW.d.cts} +1 -1
- package/dist/{thumbnail-Bp-jK70T.d.ts → thumbnail-B7wrQe1B.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2GCXXAHU.js +0 -1
- package/dist/chunk-OF4BH3JZ.js +0 -2
- package/dist/chunk-Z5I76WRJ.js +0 -1
package/dist/rig2d/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as Skeleton, d as Slot, e as Attachment, R as RigDef,
|
|
2
|
-
export {
|
|
3
|
-
export { H as HERO_PRESETS, L as LookPreset, P as PictureArt, T as ThumbnailBackdrop, a as ThumbnailRequest, b as Thumbnailer, c as createThumbnailer, v as vectorPictures } from '../thumbnail-
|
|
1
|
+
import { S as Skeleton, d as Slot, e as Attachment, f as RaceDef, R as RigDef, g as ArtPack, h as ArtDef, i as ArtStyle, P as PartsManager, a as Animator, A as ArtCatalog, C as CharacterLook, b as PlayOptions, c as AnimationEvent } from '../PartsManager-CmrzoyJR.cjs';
|
|
2
|
+
export { j as Animation, k as ArtId, B as BlinkOptions, l as BodyLook, m as Bone, n as BoneId, o as Color, p as ColorTargetDef, q as ColorTargetId, E as EditorGroup, r as ExpressionsDef, H as Hex, L as LOOK_VERSION, s as LookVersion, t as PartTypeDef, u as PartTypeId, v as PartsChange, w as PartsRule, x as RaceRegistry, y as Rng, z as RuleView, D as SkeletonData, F as Skin, W as WHITE, G as bothHands, I as colorOf, J as defineRig, K as hexToNumber, M as imageSizes, N as mergeLooks, O as numberToHex, Q as parseBody, T as parseLook, U as pick, V as raceAllowsSkin, X as raceLook, Y as raceName, Z as raceParts, _ as readSkeletonData, $ as seedOf, a0 as seededRandom, a1 as skinImages, a2 as swapUnder } from '../PartsManager-CmrzoyJR.cjs';
|
|
3
|
+
export { H as HERO_PRESETS, L as LookPreset, P as PictureArt, T as ThumbnailBackdrop, a as ThumbnailRequest, b as Thumbnailer, c as createThumbnailer, v as vectorPictures } from '../thumbnail-B1WjbWcW.cjs';
|
|
4
4
|
import '../contract-DhZuKNIf.cjs';
|
|
5
5
|
|
|
6
6
|
interface Geometry {
|
|
@@ -26,6 +26,8 @@ declare const RANGED_ANIMATIONS: {
|
|
|
26
26
|
* (the idle fight is ranged) the wave of its blow — a crescent from a swing, a spike from a stab; the
|
|
27
27
|
* game's own glowing orb for magic and bare hands. */
|
|
28
28
|
type ShotKind = "arrow" | "bolt" | "bullet" | "slash" | "thrust" | "orb";
|
|
29
|
+
/** The ranged parts held in both hands. */
|
|
30
|
+
declare const TWO_HANDED: ReadonlySet<string>;
|
|
29
31
|
|
|
30
32
|
declare const HERO_ANIMATIONS: {
|
|
31
33
|
readonly idle: "Idle";
|
|
@@ -65,6 +67,14 @@ declare const HERO_ANIMATIONS: {
|
|
|
65
67
|
*/
|
|
66
68
|
declare const GAIT_GROUND_SPEED: Readonly<Record<string, number>>;
|
|
67
69
|
|
|
70
|
+
declare const HUMAN: RaceDef;
|
|
71
|
+
declare const ELF: RaceDef;
|
|
72
|
+
declare const DWARF: RaceDef;
|
|
73
|
+
declare const ORC: RaceDef;
|
|
74
|
+
declare const UNDEAD: RaceDef;
|
|
75
|
+
/** The hero's stock races, in the order an editor offers them. */
|
|
76
|
+
declare const HERO_RACES: readonly RaceDef[];
|
|
77
|
+
|
|
68
78
|
/** The attack for what the weapon hand holds: a ranged weapon or a staff has its own (ranged.ts — a bow
|
|
69
79
|
* drawn and loosed, a crossbow, a pistol, a musket, a burst, a cast); otherwise bare hands punch, a
|
|
70
80
|
* thrusting weapon stabs, anything else — swords, axes, maces, clubs — swings. */
|
|
@@ -108,6 +118,11 @@ interface CharacterCanvasOptions {
|
|
|
108
118
|
side: number;
|
|
109
119
|
top: number;
|
|
110
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* × the art's size its images are rasterized at, live (default 3). A game that draws the same hero passes its own
|
|
123
|
+
* resolution: the pictures it already made are then reused, not made again (art/raster.ts).
|
|
124
|
+
*/
|
|
125
|
+
resolution?: number;
|
|
111
126
|
}
|
|
112
127
|
declare class CharacterCanvas {
|
|
113
128
|
private readonly options;
|
|
@@ -134,6 +149,13 @@ declare class CharacterCanvas {
|
|
|
134
149
|
/** An animation event, "end", or "*". Returns the unsubscribe. */
|
|
135
150
|
on(event: string, listener: (e: AnimationEvent) => void): () => void;
|
|
136
151
|
setLook(look: CharacterLook): void;
|
|
152
|
+
/**
|
|
153
|
+
* Puts the canvas into a host (moved out of the one it was in). A screen that closes and opens again keeps one
|
|
154
|
+
* view this way: its WebGL context and its textures stay, and the hero is there at once, not drawn anew.
|
|
155
|
+
*/
|
|
156
|
+
attach(host: HTMLElement): void;
|
|
157
|
+
/** Takes the canvas off the page; it stops drawing until `attach`. */
|
|
158
|
+
detach(): void;
|
|
137
159
|
destroy(): void;
|
|
138
160
|
private stanceOf;
|
|
139
161
|
private resize;
|
|
@@ -187,4 +209,4 @@ declare function picturesOf(rig: RigDef, skin: string): string[];
|
|
|
187
209
|
/** Каталог всех пакетов рисунка; `extra` — пакеты игры или проекта поверх стандартных. */
|
|
188
210
|
declare function createCatalog(extra?: readonly ArtPack[]): ArtCatalog;
|
|
189
211
|
|
|
190
|
-
export { AnimationEvent, Animator, ArtCatalog, ArtDef, ArtPack, Attachment, CharacterCanvas, type CharacterCanvasOptions, CharacterLook, GAIT_GROUND_SPEED, HERO_ANIMATIONS, PartsManager, PlayOptions, RANGED_ANIMATIONS, RIG2D_RECIPE_LIMITS, type Rig2dRecipe, type Rig2dRecipeResult, RigDef, type ShotKind, Skeleton, Slot, allPacks, basePack, catalogFor, createCatalog, heroAttack, heroIsMelee, heroRig, heroShot, parseRig2dRecipe, picturesOf, rig2dRecipeBrief, sanitizeSvg, svgDocument, worldGeometry };
|
|
212
|
+
export { AnimationEvent, Animator, ArtCatalog, ArtDef, ArtPack, Attachment, CharacterCanvas, type CharacterCanvasOptions, CharacterLook, DWARF, ELF, GAIT_GROUND_SPEED, HERO_ANIMATIONS, HERO_RACES, HUMAN, ORC, PartsManager, PlayOptions, RANGED_ANIMATIONS, RIG2D_RECIPE_LIMITS, RaceDef, type Rig2dRecipe, type Rig2dRecipeResult, RigDef, type ShotKind, Skeleton, Slot, TWO_HANDED, UNDEAD, allPacks, basePack, catalogFor, createCatalog, heroAttack, heroIsMelee, heroRig, heroShot, parseRig2dRecipe, picturesOf, rig2dRecipeBrief, sanitizeSvg, svgDocument, worldGeometry };
|
package/dist/rig2d/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as Skeleton, d as Slot, e as Attachment, R as RigDef,
|
|
2
|
-
export {
|
|
3
|
-
export { H as HERO_PRESETS, L as LookPreset, P as PictureArt, T as ThumbnailBackdrop, a as ThumbnailRequest, b as Thumbnailer, c as createThumbnailer, v as vectorPictures } from '../thumbnail-
|
|
1
|
+
import { S as Skeleton, d as Slot, e as Attachment, f as RaceDef, R as RigDef, g as ArtPack, h as ArtDef, i as ArtStyle, P as PartsManager, a as Animator, A as ArtCatalog, C as CharacterLook, b as PlayOptions, c as AnimationEvent } from '../PartsManager-BpAUMQXw.js';
|
|
2
|
+
export { j as Animation, k as ArtId, B as BlinkOptions, l as BodyLook, m as Bone, n as BoneId, o as Color, p as ColorTargetDef, q as ColorTargetId, E as EditorGroup, r as ExpressionsDef, H as Hex, L as LOOK_VERSION, s as LookVersion, t as PartTypeDef, u as PartTypeId, v as PartsChange, w as PartsRule, x as RaceRegistry, y as Rng, z as RuleView, D as SkeletonData, F as Skin, W as WHITE, G as bothHands, I as colorOf, J as defineRig, K as hexToNumber, M as imageSizes, N as mergeLooks, O as numberToHex, Q as parseBody, T as parseLook, U as pick, V as raceAllowsSkin, X as raceLook, Y as raceName, Z as raceParts, _ as readSkeletonData, $ as seedOf, a0 as seededRandom, a1 as skinImages, a2 as swapUnder } from '../PartsManager-BpAUMQXw.js';
|
|
3
|
+
export { H as HERO_PRESETS, L as LookPreset, P as PictureArt, T as ThumbnailBackdrop, a as ThumbnailRequest, b as Thumbnailer, c as createThumbnailer, v as vectorPictures } from '../thumbnail-B7wrQe1B.js';
|
|
4
4
|
import '../contract-DhZuKNIf.js';
|
|
5
5
|
|
|
6
6
|
interface Geometry {
|
|
@@ -26,6 +26,8 @@ declare const RANGED_ANIMATIONS: {
|
|
|
26
26
|
* (the idle fight is ranged) the wave of its blow — a crescent from a swing, a spike from a stab; the
|
|
27
27
|
* game's own glowing orb for magic and bare hands. */
|
|
28
28
|
type ShotKind = "arrow" | "bolt" | "bullet" | "slash" | "thrust" | "orb";
|
|
29
|
+
/** The ranged parts held in both hands. */
|
|
30
|
+
declare const TWO_HANDED: ReadonlySet<string>;
|
|
29
31
|
|
|
30
32
|
declare const HERO_ANIMATIONS: {
|
|
31
33
|
readonly idle: "Idle";
|
|
@@ -65,6 +67,14 @@ declare const HERO_ANIMATIONS: {
|
|
|
65
67
|
*/
|
|
66
68
|
declare const GAIT_GROUND_SPEED: Readonly<Record<string, number>>;
|
|
67
69
|
|
|
70
|
+
declare const HUMAN: RaceDef;
|
|
71
|
+
declare const ELF: RaceDef;
|
|
72
|
+
declare const DWARF: RaceDef;
|
|
73
|
+
declare const ORC: RaceDef;
|
|
74
|
+
declare const UNDEAD: RaceDef;
|
|
75
|
+
/** The hero's stock races, in the order an editor offers them. */
|
|
76
|
+
declare const HERO_RACES: readonly RaceDef[];
|
|
77
|
+
|
|
68
78
|
/** The attack for what the weapon hand holds: a ranged weapon or a staff has its own (ranged.ts — a bow
|
|
69
79
|
* drawn and loosed, a crossbow, a pistol, a musket, a burst, a cast); otherwise bare hands punch, a
|
|
70
80
|
* thrusting weapon stabs, anything else — swords, axes, maces, clubs — swings. */
|
|
@@ -108,6 +118,11 @@ interface CharacterCanvasOptions {
|
|
|
108
118
|
side: number;
|
|
109
119
|
top: number;
|
|
110
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* × the art's size its images are rasterized at, live (default 3). A game that draws the same hero passes its own
|
|
123
|
+
* resolution: the pictures it already made are then reused, not made again (art/raster.ts).
|
|
124
|
+
*/
|
|
125
|
+
resolution?: number;
|
|
111
126
|
}
|
|
112
127
|
declare class CharacterCanvas {
|
|
113
128
|
private readonly options;
|
|
@@ -134,6 +149,13 @@ declare class CharacterCanvas {
|
|
|
134
149
|
/** An animation event, "end", or "*". Returns the unsubscribe. */
|
|
135
150
|
on(event: string, listener: (e: AnimationEvent) => void): () => void;
|
|
136
151
|
setLook(look: CharacterLook): void;
|
|
152
|
+
/**
|
|
153
|
+
* Puts the canvas into a host (moved out of the one it was in). A screen that closes and opens again keeps one
|
|
154
|
+
* view this way: its WebGL context and its textures stay, and the hero is there at once, not drawn anew.
|
|
155
|
+
*/
|
|
156
|
+
attach(host: HTMLElement): void;
|
|
157
|
+
/** Takes the canvas off the page; it stops drawing until `attach`. */
|
|
158
|
+
detach(): void;
|
|
137
159
|
destroy(): void;
|
|
138
160
|
private stanceOf;
|
|
139
161
|
private resize;
|
|
@@ -187,4 +209,4 @@ declare function picturesOf(rig: RigDef, skin: string): string[];
|
|
|
187
209
|
/** Каталог всех пакетов рисунка; `extra` — пакеты игры или проекта поверх стандартных. */
|
|
188
210
|
declare function createCatalog(extra?: readonly ArtPack[]): ArtCatalog;
|
|
189
211
|
|
|
190
|
-
export { AnimationEvent, Animator, ArtCatalog, ArtDef, ArtPack, Attachment, CharacterCanvas, type CharacterCanvasOptions, CharacterLook, GAIT_GROUND_SPEED, HERO_ANIMATIONS, PartsManager, PlayOptions, RANGED_ANIMATIONS, RIG2D_RECIPE_LIMITS, type Rig2dRecipe, type Rig2dRecipeResult, RigDef, type ShotKind, Skeleton, Slot, allPacks, basePack, catalogFor, createCatalog, heroAttack, heroIsMelee, heroRig, heroShot, parseRig2dRecipe, picturesOf, rig2dRecipeBrief, sanitizeSvg, svgDocument, worldGeometry };
|
|
212
|
+
export { AnimationEvent, Animator, ArtCatalog, ArtDef, ArtPack, Attachment, CharacterCanvas, type CharacterCanvasOptions, CharacterLook, DWARF, ELF, GAIT_GROUND_SPEED, HERO_ANIMATIONS, HERO_RACES, HUMAN, ORC, PartsManager, PlayOptions, RANGED_ANIMATIONS, RIG2D_RECIPE_LIMITS, RaceDef, type Rig2dRecipe, type Rig2dRecipeResult, RigDef, type ShotKind, Skeleton, Slot, TWO_HANDED, UNDEAD, allPacks, basePack, catalogFor, createCatalog, heroAttack, heroIsMelee, heroRig, heroShot, parseRig2dRecipe, picturesOf, rig2dRecipeBrief, sanitizeSvg, svgDocument, worldGeometry };
|