@bardway/trpg-pixi 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/NOTICE +10 -0
- package/NOTICE.md +1 -0
- package/README.md +25 -2
- package/dist/AnimationMilestones.d.ts +17 -0
- package/dist/BattleActionMotionMath.d.ts +24 -0
- package/dist/BattleActionPresentationRecipes.d.ts +11 -0
- package/dist/BattleFxLibrary.d.ts +16 -0
- package/dist/BattlePresentationEngine.d.ts +26 -0
- package/dist/BattlePresentationPoseRegistry.d.ts +25 -0
- package/dist/BattlePresentationRecipe.d.ts +48 -0
- package/dist/BattleSequenceScheduler.d.ts +11 -0
- package/dist/DisplayEventQueue.d.ts +24 -0
- package/dist/PixiAnimationActivity.d.ts +7 -0
- package/dist/PixiAnimationDirector.d.ts +21 -0
- package/dist/PixiApplicationFactory.d.ts +17 -0
- package/dist/PixiAssetManager.d.ts +70 -0
- package/dist/PixiBattleActionRecipes.d.ts +75 -0
- package/dist/PixiBattleCinematicSurface.d.ts +23 -0
- package/dist/PixiBattleEntryTransition.d.ts +87 -0
- package/dist/PixiBattleFieldSurface.d.ts +125 -0
- package/dist/PixiBattleFxResources.d.ts +154 -0
- package/dist/PixiBattleGrid.d.ts +13 -0
- package/dist/PixiBattleHudPorts.d.ts +192 -0
- package/dist/PixiBattleHudSurface.d.ts +159 -0
- package/dist/PixiBattleLightningResources.d.ts +57 -0
- package/dist/PixiBattleMapDissolve.d.ts +38 -0
- package/dist/PixiBattleSceneTransition.d.ts +30 -0
- package/dist/PixiBattleTokenLifecycleCoordinator.d.ts +44 -0
- package/dist/PixiBattleVisualLayout.d.ts +284 -0
- package/dist/PixiBattleWhipGeometry.d.ts +18 -0
- package/dist/PixiBattleWhipMotion.d.ts +63 -0
- package/dist/PixiBattleWhipResources.d.ts +53 -0
- package/dist/PixiCameraFocusController.d.ts +40 -0
- package/dist/PixiCombatMotion.d.ts +223 -0
- package/dist/PixiCurrentActorCardGlow.d.ts +37 -0
- package/dist/PixiCurrentActorHalo.d.ts +55 -0
- package/dist/PixiDirectionalMotionBlur.d.ts +12 -0
- package/dist/PixiDisplayRenderer.d.ts +85 -0
- package/dist/PixiEffectPlugin.d.ts +25 -0
- package/dist/PixiEndingSurface.d.ts +104 -0
- package/dist/PixiInvestigatorDossierInsanityFilter.d.ts +14 -0
- package/dist/PixiLocalGlowMesh.d.ts +38 -0
- package/dist/PixiMapEdgeShadow.d.ts +36 -0
- package/dist/PixiMapMediaSurface.d.ts +71 -0
- package/dist/PixiMapWorldUtils.d.ts +24 -0
- package/dist/PixiMediaBreathRuntime.d.ts +69 -0
- package/dist/PixiMotion.d.ts +42 -0
- package/dist/PixiObjectiveBreathingGlow.d.ts +39 -0
- package/dist/PixiPartyHudSurface.d.ts +58 -0
- package/dist/PixiPersistentEffectTransition.d.ts +23 -0
- package/dist/PixiPortraitResourceCard.d.ts +147 -0
- package/dist/PixiPreludeStoryTransition.d.ts +35 -0
- package/dist/PixiPreludeSurface.d.ts +203 -0
- package/dist/PixiProgressCinematic.d.ts +65 -0
- package/dist/PixiResultEffectSurface.d.ts +101 -0
- package/dist/PixiRetainedMeterAnimator.d.ts +44 -0
- package/dist/PixiRuntimeContext.d.ts +21 -0
- package/dist/PixiSceneGraph.d.ts +42 -0
- package/dist/PixiSceneMotion.d.ts +41 -0
- package/dist/PixiSceneMotionPorts.d.ts +83 -0
- package/dist/PixiScenePresentationDirector.d.ts +118 -0
- package/dist/PixiSessionLayout.d.ts +61 -0
- package/dist/PixiSessionSkin.d.ts +30 -0
- package/dist/PixiShaderRuntime.d.ts +191 -0
- package/dist/PixiStageFontLoader.d.ts +2 -0
- package/dist/PixiStageMetrics.d.ts +25 -0
- package/dist/PixiStageTheme.d.ts +26 -0
- package/dist/PixiStoryArchiveMotion.d.ts +19 -0
- package/dist/PixiStoryCardCut.d.ts +58 -0
- package/dist/PixiStorySurface.d.ts +285 -0
- package/dist/PixiStoryWorkspaceSurface.d.ts +64 -0
- package/dist/PixiSummaryBoardSurface.d.ts +112 -0
- package/dist/PixiSystemHudSurface.d.ts +73 -0
- package/dist/PixiTeamCheckCinematic.d.ts +34 -0
- package/dist/PixiTextTransitionEffect.d.ts +54 -0
- package/dist/PixiTokenPersistentStatus.d.ts +101 -0
- package/dist/PixiTokenWorld.d.ts +170 -0
- package/dist/PixiTypography.d.ts +96 -0
- package/dist/PixiVideoRuntime.d.ts +61 -0
- package/dist/PixiViewportController.d.ts +25 -0
- package/dist/ResultEffectTuning.d.ts +57 -0
- package/dist/RetainedStageSurface.d.ts +50 -0
- package/dist/SessionFieldEffectRuntime.d.ts +45 -0
- package/dist/SessionSceneHistory.d.ts +10 -0
- package/dist/SessionSceneRegistry.d.ts +31 -0
- package/dist/StoryEventCoordinator.d.ts +61 -0
- package/dist/effects/PixiEffectLayerRegistry.d.ts +54 -0
- package/dist/effects/PixiEffectScope.d.ts +20 -0
- package/dist/effects/PixiStableRandom.d.ts +2 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +24184 -0
- package/dist/index.js.map +7 -0
- package/dist/recipes/EffectPrimitiveRuntimeRegistry.d.ts +28 -0
- package/dist/recipes/EffectRecipeExecutor.d.ts +73 -0
- package/dist/recipes/primitives.d.ts +39 -0
- package/dist/recipes/registry.d.ts +57 -0
- package/dist/recipes/schema.d.ts +93 -0
- package/dist/recipes.d.ts +5 -0
- package/dist/recipes.js +1384 -0
- package/dist/recipes.js.map +7 -0
- package/dist/story/PixiStoryPresentationEngine.d.ts +90 -0
- package/dist/story/StoryContentSurface.d.ts +34 -0
- package/dist/story/StoryImageFilter.d.ts +15 -0
- package/dist/story/StoryTimelineClock.d.ts +22 -0
- package/dist/story/StoryVisualMath.d.ts +6 -0
- package/dist/tuning/SessionTuningResolver.d.ts +1 -0
- package/dist/tuning/SessionTuningTypes.d.ts +1 -0
- package/dist/ui/PixiStagePrimitives.d.ts +36 -0
- package/dist/uniforms.d.ts +1 -0
- package/package.json +44 -4
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Container } from 'pixi.js';
|
|
2
|
+
import type { RuntimeLogger } from '@bardway/trpg-media';
|
|
3
|
+
import type { PixiAnimationDirector } from './PixiAnimationDirector.js';
|
|
4
|
+
import type { PixiAssetManager } from './PixiAssetManager.js';
|
|
5
|
+
import type { SessionTuningResolver } from './tuning/SessionTuningResolver.js';
|
|
6
|
+
declare const BATTLE_PERSISTENT_STATUSES: readonly ["burning", "poisoned", "bleeding"];
|
|
7
|
+
export type TokenPersistentStatus = (typeof BATTLE_PERSISTENT_STATUSES)[number];
|
|
8
|
+
export interface TokenPersistentStatusConstructors {
|
|
9
|
+
Container: typeof import('pixi.js').Container;
|
|
10
|
+
Sprite: typeof import('pixi.js').Sprite;
|
|
11
|
+
Graphics?: typeof import('pixi.js').Graphics;
|
|
12
|
+
Mesh?: typeof import('pixi.js').Mesh;
|
|
13
|
+
MeshGeometry?: typeof import('pixi.js').MeshGeometry;
|
|
14
|
+
Shader?: typeof import('pixi.js').Shader;
|
|
15
|
+
UniformGroup?: typeof import('pixi.js').UniformGroup;
|
|
16
|
+
}
|
|
17
|
+
export interface TokenPersistentStatusInput {
|
|
18
|
+
flags: Readonly<Partial<Record<TokenPersistentStatus, boolean>>>;
|
|
19
|
+
suppressed?: boolean;
|
|
20
|
+
diameter: number;
|
|
21
|
+
reducedMotion: boolean;
|
|
22
|
+
animate?: boolean;
|
|
23
|
+
director?: PixiAnimationDirector;
|
|
24
|
+
}
|
|
25
|
+
export declare const TOKEN_BURNING_FRAGMENT = "\nprecision highp float;\nvarying vec2 vUV;\nvarying float vWorldAlpha;\nuniform float uTime;\nuniform float uSeed;\nuniform float uAlpha;\nuniform vec3 uPrimary;\nuniform vec3 uSecondary;\nuniform vec4 uTokenClip;\nfloat hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7)) + uSeed * 71.0) * 43758.5453); }\nfloat noise(vec2 p) {\n vec2 i = floor(p); vec2 f = fract(p); f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0)), f.x), f.y);\n}\nfloat fbm(vec2 p) { return noise(p) * 0.62 + noise(p * 2.03) * 0.27 + noise(p * 4.11) * 0.11; }\nfloat quadEdge(vec2 uv) {\n return smoothstep(0.0, 0.09, uv.x) * smoothstep(0.0, 0.09, 1.0 - uv.x)\n * smoothstep(0.0, 0.09, uv.y) * smoothstep(0.0, 0.09, 1.0 - uv.y);\n}\nfloat tokenAperture(vec2 uv) {\n vec2 tokenLocal = (uv * 2.0 - 1.0) * uTokenClip.xy + uTokenClip.zw;\n return 1.0 - smoothstep(0.94, 1.0, length(tokenLocal));\n}\n\nvoid main(void) {\n vec2 p = vec2(vUV.x * 2.0 - 1.0, 1.0 - vUV.y);\n float flow = fbm(vec2(p.x * 3.4, p.y * 4.5 - uTime * 1.8));\n float tongue = p.x + (flow - 0.5) * (0.23 + p.y * 0.46);\n float width = mix(0.78, 0.035, p.y);\n float body = 1.0 - smoothstep(width * 0.4, width + 0.1, abs(tongue));\n float tip = 1.0 - smoothstep(0.38 + flow * 0.38, 0.96, p.y);\n float alpha = body * tip * quadEdge(vUV) * tokenAperture(vUV) * uAlpha * vWorldAlpha;\n vec3 color = mix(uPrimary, uSecondary, body * (1.0 - p.y) * 0.75);\n gl_FragColor = vec4(color * alpha, alpha);\n}\n";
|
|
26
|
+
export declare const TOKEN_POISONED_FRAGMENT = "\nprecision highp float;\nvarying vec2 vUV;\nvarying float vWorldAlpha;\nuniform float uTime;\nuniform float uSeed;\nuniform float uAlpha;\nuniform vec3 uPrimary;\nuniform vec3 uSecondary;\nuniform vec4 uTokenClip;\nfloat hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7)) + uSeed * 71.0) * 43758.5453); }\nfloat noise(vec2 p) {\n vec2 i = floor(p); vec2 f = fract(p); f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0)), f.x), f.y);\n}\nfloat fbm(vec2 p) { return noise(p) * 0.62 + noise(p * 2.03) * 0.27 + noise(p * 4.11) * 0.11; }\nfloat quadEdge(vec2 uv) {\n return smoothstep(0.0, 0.09, uv.x) * smoothstep(0.0, 0.09, 1.0 - uv.x)\n * smoothstep(0.0, 0.09, uv.y) * smoothstep(0.0, 0.09, 1.0 - uv.y);\n}\nfloat tokenAperture(vec2 uv) {\n vec2 tokenLocal = (uv * 2.0 - 1.0) * uTokenClip.xy + uTokenClip.zw;\n return 1.0 - smoothstep(0.94, 1.0, length(tokenLocal));\n}\n\nvoid main(void) {\n vec2 p = vUV * 2.0 - 1.0;\n float drift = fbm(p * 2.3 + vec2(uTime * 0.32, -uTime * 0.22));\n float wisps = fbm(p * 4.0 - vec2(uTime * 0.18, uTime * 0.36));\n float cloud = smoothstep(0.23, 0.72, drift * 0.7 + wisps * 0.3);\n float envelope = 1.0 - smoothstep(0.3, 1.0, length(p * vec2(0.9, 0.8)));\n float alpha = cloud * envelope * quadEdge(vUV) * tokenAperture(vUV) * uAlpha * vWorldAlpha;\n vec3 color = mix(uPrimary, uSecondary, wisps * 0.6);\n gl_FragColor = vec4(color * alpha, alpha);\n}\n";
|
|
27
|
+
export interface NumericSettings {
|
|
28
|
+
iconXRatio: number;
|
|
29
|
+
iconYRatio: number;
|
|
30
|
+
effectXRatio: number;
|
|
31
|
+
effectYRatio: number;
|
|
32
|
+
effectWidthRatio: number;
|
|
33
|
+
effectHeightRatio: number;
|
|
34
|
+
effectAlpha: number;
|
|
35
|
+
particleSizeRatio: number;
|
|
36
|
+
particleSpreadRatio: number;
|
|
37
|
+
particleTravelRatio: number;
|
|
38
|
+
particleAlpha: number;
|
|
39
|
+
periodMs: number;
|
|
40
|
+
speed: number;
|
|
41
|
+
iconPulseRatio: number;
|
|
42
|
+
particlePeriodMs: number;
|
|
43
|
+
}
|
|
44
|
+
export interface StatusSettings extends NumericSettings {
|
|
45
|
+
color: string;
|
|
46
|
+
secondaryColor: string;
|
|
47
|
+
iconTint: string;
|
|
48
|
+
}
|
|
49
|
+
/** Retained local status surfaces. The owning World supplies the only animation clock. */
|
|
50
|
+
export declare class PixiTokenPersistentStatus {
|
|
51
|
+
private readonly constructors;
|
|
52
|
+
private readonly assets;
|
|
53
|
+
private readonly ports;
|
|
54
|
+
private tuning?;
|
|
55
|
+
private readonly requestRender?;
|
|
56
|
+
private readonly onActivityChange?;
|
|
57
|
+
readonly root: Container;
|
|
58
|
+
private readonly nodes;
|
|
59
|
+
private readonly scope;
|
|
60
|
+
private readonly phase;
|
|
61
|
+
private input;
|
|
62
|
+
private elapsedMs;
|
|
63
|
+
private destroyed;
|
|
64
|
+
private iconLayer;
|
|
65
|
+
private iconMask;
|
|
66
|
+
private iconMaskDiameter;
|
|
67
|
+
private iconSizeRatio;
|
|
68
|
+
private iconAlpha;
|
|
69
|
+
private reducedMotionAlpha;
|
|
70
|
+
constructor(id: string, constructors: TokenPersistentStatusConstructors, assets: Pick<PixiAssetManager, 'loadTexture' | 'releaseScope'>, ports: {
|
|
71
|
+
style: Record<TokenPersistentStatus, StatusSettings> & {
|
|
72
|
+
persistent: {
|
|
73
|
+
iconSizeRatio: number;
|
|
74
|
+
iconAlpha: number;
|
|
75
|
+
reducedMotionAlpha: number;
|
|
76
|
+
fadeInDurationMs: number;
|
|
77
|
+
fadeOutDurationMs: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
iconUrl: (status: TokenPersistentStatus) => string;
|
|
81
|
+
logger: RuntimeLogger;
|
|
82
|
+
}, tuning?: SessionTuningResolver | undefined, requestRender?: (() => void) | undefined, onActivityChange?: (() => void) | undefined);
|
|
83
|
+
sync(input: TokenPersistentStatusInput): void;
|
|
84
|
+
hasAmbientMotion(): boolean;
|
|
85
|
+
update(elapsedMs: number): void;
|
|
86
|
+
updateTuning(tuning: SessionTuningResolver): void;
|
|
87
|
+
destroy(): void;
|
|
88
|
+
private createStatus;
|
|
89
|
+
private createMesh;
|
|
90
|
+
private loadSprites;
|
|
91
|
+
private setVisibility;
|
|
92
|
+
private layout;
|
|
93
|
+
private ensureIconMask;
|
|
94
|
+
private ensureIconLayer;
|
|
95
|
+
private syncIconPresentation;
|
|
96
|
+
private readCommonSettings;
|
|
97
|
+
private readSettings;
|
|
98
|
+
private number;
|
|
99
|
+
private color;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { Container, TextStyleOptions } from 'pixi.js';
|
|
2
|
+
import type { RuntimeLogger } from '@bardway/trpg-media';
|
|
3
|
+
import type { TokenAvatarCrop } from './PixiMapWorldUtils.js';
|
|
4
|
+
import type { BattleViewportGridLayout } from './PixiSessionLayout.js';
|
|
5
|
+
import type { PixiAnimationDirector } from './PixiAnimationDirector.js';
|
|
6
|
+
import type { PixiAssetManager } from './PixiAssetManager.js';
|
|
7
|
+
import type { PixiSceneGraph } from './PixiSceneGraph.js';
|
|
8
|
+
import type { SessionTuningResolver } from '@bardway/trpg-media/tuning';
|
|
9
|
+
export interface TokenWorldInput {
|
|
10
|
+
id: string;
|
|
11
|
+
gridPosition: {
|
|
12
|
+
col: number;
|
|
13
|
+
row: number;
|
|
14
|
+
};
|
|
15
|
+
label?: string;
|
|
16
|
+
avatarUrl?: string;
|
|
17
|
+
avatarCrop?: TokenAvatarCrop;
|
|
18
|
+
avatarOverrideUrl?: string;
|
|
19
|
+
bodyColor: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TokenFocusTransitionOptions {
|
|
22
|
+
director: PixiAnimationDirector;
|
|
23
|
+
signal: AbortSignal;
|
|
24
|
+
duration: number;
|
|
25
|
+
}
|
|
26
|
+
export interface TokenWorldDependencies {
|
|
27
|
+
Container: typeof import('pixi.js').Container;
|
|
28
|
+
Graphics: typeof import('pixi.js').Graphics;
|
|
29
|
+
Sprite: typeof import('pixi.js').Sprite;
|
|
30
|
+
Text?: typeof import('pixi.js').Text;
|
|
31
|
+
BlurFilter?: typeof import('pixi.js').BlurFilter;
|
|
32
|
+
ColorMatrixFilter?: typeof import('pixi.js').ColorMatrixFilter;
|
|
33
|
+
Rectangle?: typeof import('pixi.js').Rectangle;
|
|
34
|
+
director: PixiAnimationDirector;
|
|
35
|
+
requestRender(): void;
|
|
36
|
+
logger: RuntimeLogger;
|
|
37
|
+
maskColor: string;
|
|
38
|
+
exitSmokeColor: string;
|
|
39
|
+
vignetteColor: string;
|
|
40
|
+
labelStyle: TextStyleOptions;
|
|
41
|
+
updateDecoration?(node: Container, label: Container, input: TokenWorldInput): void;
|
|
42
|
+
}
|
|
43
|
+
/** Retained neutral world extracted from PixiBattleWorld's node, avatar, motion, focus and lease mechanisms. */
|
|
44
|
+
export declare class PixiTokenWorld {
|
|
45
|
+
private readonly scene;
|
|
46
|
+
private readonly assets;
|
|
47
|
+
private readonly dependencies;
|
|
48
|
+
private readonly tuning?;
|
|
49
|
+
private readonly tokenNodes;
|
|
50
|
+
private readonly tokenAvatarLayers;
|
|
51
|
+
private readonly tokenLabelNodes;
|
|
52
|
+
private readonly tokenBodies;
|
|
53
|
+
private readonly tokenNames;
|
|
54
|
+
private readonly tokenAvatarKeys;
|
|
55
|
+
private readonly tokenAvatarVersions;
|
|
56
|
+
private readonly tokenAvatarMaskSizes;
|
|
57
|
+
private readonly tokenAvatarNodes;
|
|
58
|
+
private readonly tokenAvatarMasks;
|
|
59
|
+
private readonly tokenFallbackNodes;
|
|
60
|
+
private readonly presentationHolds;
|
|
61
|
+
private readonly pendingDeathTransitions;
|
|
62
|
+
private readonly settledActionPositions;
|
|
63
|
+
private readonly lifecycle;
|
|
64
|
+
private readonly poses;
|
|
65
|
+
private readonly ownedMotionBlurFilters;
|
|
66
|
+
private readonly availableMotionBlurFilters;
|
|
67
|
+
private layout;
|
|
68
|
+
private activeResourceScope;
|
|
69
|
+
private owner;
|
|
70
|
+
private generation;
|
|
71
|
+
private readonly focusVignette;
|
|
72
|
+
private focusedTokenIds;
|
|
73
|
+
private unfocusedTokenAlpha;
|
|
74
|
+
private labelsSuppressed;
|
|
75
|
+
private reducedMotion;
|
|
76
|
+
private destroyed;
|
|
77
|
+
private lifetime;
|
|
78
|
+
constructor(scene: PixiSceneGraph, assets: PixiAssetManager, dependencies: TokenWorldDependencies, tuning?: SessionTuningResolver | undefined);
|
|
79
|
+
sync(input: {
|
|
80
|
+
owner: string;
|
|
81
|
+
revision: number;
|
|
82
|
+
layout: BattleViewportGridLayout;
|
|
83
|
+
tokens: readonly TokenWorldInput[];
|
|
84
|
+
hydrate?: boolean;
|
|
85
|
+
animateMoves?: boolean;
|
|
86
|
+
}): void;
|
|
87
|
+
gridToPoint(position: {
|
|
88
|
+
col: number;
|
|
89
|
+
row: number;
|
|
90
|
+
}): {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
} | null;
|
|
94
|
+
setReducedMotion(value: boolean): void;
|
|
95
|
+
isReducedMotionEnabled(): boolean;
|
|
96
|
+
reset(): void;
|
|
97
|
+
destroy(): void;
|
|
98
|
+
private destroyTokenNode;
|
|
99
|
+
private resolveTuningNumber;
|
|
100
|
+
playTokenMotion(tokenId: string, from: {
|
|
101
|
+
col: number;
|
|
102
|
+
row: number;
|
|
103
|
+
}, to: {
|
|
104
|
+
col: number;
|
|
105
|
+
row: number;
|
|
106
|
+
}, director: PixiAnimationDirector, signal: AbortSignal, options?: {
|
|
107
|
+
duration?: number;
|
|
108
|
+
motionBlurStrength?: number;
|
|
109
|
+
settleAtDestination?: boolean;
|
|
110
|
+
startFromCurrent?: boolean;
|
|
111
|
+
holdPresentation?: boolean;
|
|
112
|
+
ease?: string;
|
|
113
|
+
rampMotionBlur?: boolean;
|
|
114
|
+
onProgress?: (progress: number, point: {
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
}) => void;
|
|
118
|
+
}): Promise<void>;
|
|
119
|
+
playTokenNudge(tokenId: string, offset: {
|
|
120
|
+
x: number;
|
|
121
|
+
y: number;
|
|
122
|
+
}, director: PixiAnimationDirector, signal: AbortSignal, durations?: {
|
|
123
|
+
out?: number;
|
|
124
|
+
hold?: number;
|
|
125
|
+
back?: number;
|
|
126
|
+
motionBlurStrength?: number;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
playTokenDodgeExchange(attackerId: string, targetId: string, attackerOffset: {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
}, targetOffset: {
|
|
132
|
+
x: number;
|
|
133
|
+
y: number;
|
|
134
|
+
}, director: PixiAnimationDirector, signal: AbortSignal, options?: {
|
|
135
|
+
attackerBlurStrength?: number;
|
|
136
|
+
}): Promise<void>;
|
|
137
|
+
playCoverTransition(tokenId: string, texture: import('pixi.js').Texture, director: PixiAnimationDirector, signal: AbortSignal, options: {
|
|
138
|
+
coverHold: number;
|
|
139
|
+
entryShake: number;
|
|
140
|
+
grayDuration: number;
|
|
141
|
+
skullScale: number;
|
|
142
|
+
entryScale: number;
|
|
143
|
+
}): Promise<void>;
|
|
144
|
+
getPresentationNode(tokenId: string): Container | null;
|
|
145
|
+
getPresentationLabelNode(tokenId: string): Container | null;
|
|
146
|
+
beginTokenPresentation(tokenId: string): void;
|
|
147
|
+
holdTokenPresentation(tokenId: string): () => void;
|
|
148
|
+
finishTokenPresentation(tokenId: string): void;
|
|
149
|
+
setFocusTokens(tokenIds: readonly string[], transition?: TokenFocusTransitionOptions): Promise<void>;
|
|
150
|
+
clearFocusTokens(transition?: TokenFocusTransitionOptions): Promise<void>;
|
|
151
|
+
getCellSize(): {
|
|
152
|
+
width: number;
|
|
153
|
+
height: number;
|
|
154
|
+
} | null;
|
|
155
|
+
private resolveFocusedAlpha;
|
|
156
|
+
private acquireMotionBlur;
|
|
157
|
+
private releaseMotionBlur;
|
|
158
|
+
private createTokenNode;
|
|
159
|
+
private playTokenEnter;
|
|
160
|
+
private playTokenExit;
|
|
161
|
+
private playSnapshotMovement;
|
|
162
|
+
private finishLifecyclePose;
|
|
163
|
+
private ensureTokenAvatarLayer;
|
|
164
|
+
private syncTokenAvatar;
|
|
165
|
+
private resizeTokenAvatar;
|
|
166
|
+
private removeTokenAvatar;
|
|
167
|
+
private getCellCenter;
|
|
168
|
+
private reconcilePresentationNode;
|
|
169
|
+
private beginMotionLease;
|
|
170
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { PixiStageTheme } from './PixiStageTheme.js';
|
|
2
|
+
export declare const createPixiTypography: (pixiStageTheme: PixiStageTheme, fonts: {
|
|
3
|
+
body: string;
|
|
4
|
+
data: string;
|
|
5
|
+
display: string;
|
|
6
|
+
}) => {
|
|
7
|
+
readonly displayTitle: {
|
|
8
|
+
readonly fill: string;
|
|
9
|
+
readonly fontFamily: string;
|
|
10
|
+
readonly fontSize: 48;
|
|
11
|
+
readonly fontWeight: "700";
|
|
12
|
+
};
|
|
13
|
+
readonly sceneTitle: {
|
|
14
|
+
readonly fill: string;
|
|
15
|
+
readonly fontFamily: string;
|
|
16
|
+
readonly fontSize: 36;
|
|
17
|
+
readonly fontWeight: "700";
|
|
18
|
+
};
|
|
19
|
+
readonly sectionTitle: {
|
|
20
|
+
readonly fill: string;
|
|
21
|
+
readonly fontFamily: string;
|
|
22
|
+
readonly fontSize: 30;
|
|
23
|
+
readonly fontWeight: "700";
|
|
24
|
+
};
|
|
25
|
+
readonly hudPrimary: {
|
|
26
|
+
readonly fill: string;
|
|
27
|
+
readonly fontFamily: string;
|
|
28
|
+
readonly fontSize: 20;
|
|
29
|
+
readonly fontWeight: "700";
|
|
30
|
+
readonly letterSpacing: 3;
|
|
31
|
+
};
|
|
32
|
+
readonly battleRound: {
|
|
33
|
+
readonly fill: string;
|
|
34
|
+
readonly fontFamily: string;
|
|
35
|
+
readonly fontSize: 29;
|
|
36
|
+
readonly fontWeight: "700";
|
|
37
|
+
readonly letterSpacing: 0;
|
|
38
|
+
};
|
|
39
|
+
readonly battleOrder: {
|
|
40
|
+
readonly fill: string;
|
|
41
|
+
readonly fontFamily: string;
|
|
42
|
+
readonly fontSize: 30;
|
|
43
|
+
readonly fontWeight: "700";
|
|
44
|
+
readonly letterSpacing: 0;
|
|
45
|
+
};
|
|
46
|
+
readonly battleToken: {
|
|
47
|
+
readonly fill: string;
|
|
48
|
+
readonly fontFamily: string;
|
|
49
|
+
readonly fontSize: 29;
|
|
50
|
+
readonly fontWeight: "700";
|
|
51
|
+
readonly letterSpacing: 0;
|
|
52
|
+
};
|
|
53
|
+
readonly hudSecondary: {
|
|
54
|
+
readonly fill: string;
|
|
55
|
+
readonly fontFamily: string;
|
|
56
|
+
readonly fontSize: 24;
|
|
57
|
+
readonly fontWeight: "600";
|
|
58
|
+
};
|
|
59
|
+
readonly caption: {
|
|
60
|
+
readonly fill: string;
|
|
61
|
+
readonly fontFamily: string;
|
|
62
|
+
readonly fontSize: 20;
|
|
63
|
+
readonly fontWeight: "500";
|
|
64
|
+
};
|
|
65
|
+
readonly data: {
|
|
66
|
+
readonly fill: string;
|
|
67
|
+
readonly fontFamily: string;
|
|
68
|
+
readonly fontSize: 22;
|
|
69
|
+
readonly fontWeight: "600";
|
|
70
|
+
};
|
|
71
|
+
readonly damage: {
|
|
72
|
+
readonly fill: string;
|
|
73
|
+
readonly fontFamily: string;
|
|
74
|
+
readonly fontSize: 40;
|
|
75
|
+
readonly fontWeight: "700";
|
|
76
|
+
};
|
|
77
|
+
readonly resourceDelta: {
|
|
78
|
+
readonly fill: string;
|
|
79
|
+
readonly fontFamily: string;
|
|
80
|
+
readonly fontSize: 28;
|
|
81
|
+
readonly fontWeight: "700";
|
|
82
|
+
};
|
|
83
|
+
readonly modalTitle: {
|
|
84
|
+
readonly fill: string;
|
|
85
|
+
readonly fontFamily: string;
|
|
86
|
+
readonly fontSize: 48;
|
|
87
|
+
readonly fontWeight: "700";
|
|
88
|
+
};
|
|
89
|
+
readonly clueTitle: {
|
|
90
|
+
readonly fill: string;
|
|
91
|
+
readonly fontFamily: string;
|
|
92
|
+
readonly fontSize: 30;
|
|
93
|
+
readonly fontWeight: "700";
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export type PixiTypographyToken = keyof ReturnType<typeof createPixiTypography>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Texture, Ticker } from 'pixi.js';
|
|
2
|
+
import type { RuntimeLogger } from '@bardway/trpg-media';
|
|
3
|
+
import type { PixiAnimationActivity } from './PixiAnimationActivity.js';
|
|
4
|
+
import type { PixiAssetManager, PixiAssetScope } from './PixiAssetManager.js';
|
|
5
|
+
export interface PixiVideoBinding {
|
|
6
|
+
readonly texture: Texture;
|
|
7
|
+
activate(restart?: boolean): Promise<boolean>;
|
|
8
|
+
playOnce(): Promise<boolean>;
|
|
9
|
+
deactivate(reset?: boolean): void;
|
|
10
|
+
release(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface PixiVideoRuntimeDiagnostics {
|
|
13
|
+
bindings: number;
|
|
14
|
+
activeBindings: number;
|
|
15
|
+
textureUpdates: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class PixiVideoRuntime {
|
|
18
|
+
private readonly ticker;
|
|
19
|
+
private readonly activity;
|
|
20
|
+
private readonly assets;
|
|
21
|
+
private readonly requestRender;
|
|
22
|
+
private readonly logger;
|
|
23
|
+
private readonly bindings;
|
|
24
|
+
private releaseActivity;
|
|
25
|
+
private elapsedSinceUpdateMs;
|
|
26
|
+
private textureUpdates;
|
|
27
|
+
private paused;
|
|
28
|
+
private reducedMotion;
|
|
29
|
+
private contextLost;
|
|
30
|
+
private destroyed;
|
|
31
|
+
private bindingSequence;
|
|
32
|
+
constructor(ticker: Ticker, activity: PixiAnimationActivity, assets: PixiAssetManager, requestRender: () => void, logger: RuntimeLogger);
|
|
33
|
+
loadBinding(input: {
|
|
34
|
+
alias: string;
|
|
35
|
+
videoUrl: string;
|
|
36
|
+
scope: PixiAssetScope | string;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
muted?: boolean;
|
|
39
|
+
onPlaybackFailure?: () => void;
|
|
40
|
+
}): Promise<PixiVideoBinding>;
|
|
41
|
+
setPaused(paused: boolean): void;
|
|
42
|
+
setReducedMotion(reducedMotion: boolean): void;
|
|
43
|
+
handleContextLost(): void;
|
|
44
|
+
handleContextRestored(): void;
|
|
45
|
+
reset(): void;
|
|
46
|
+
diagnostics(): PixiVideoRuntimeDiagnostics;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
private readonly update;
|
|
49
|
+
private playOnce;
|
|
50
|
+
private finishPlayback;
|
|
51
|
+
private activate;
|
|
52
|
+
private play;
|
|
53
|
+
private deactivate;
|
|
54
|
+
private release;
|
|
55
|
+
private interruptPlayback;
|
|
56
|
+
private releaseVideoTexture;
|
|
57
|
+
private seekToStart;
|
|
58
|
+
private failPlayback;
|
|
59
|
+
private resumeActiveBindings;
|
|
60
|
+
private syncActivity;
|
|
61
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Application, Container } from 'pixi.js';
|
|
2
|
+
export interface PixiViewport {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const resolvePixiStageViewport: ({ width, height }: PixiViewport, stage?: PixiViewport) => {
|
|
7
|
+
scale: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export declare class PixiViewportController {
|
|
12
|
+
private readonly app;
|
|
13
|
+
private readonly root;
|
|
14
|
+
private readonly onResize?;
|
|
15
|
+
private readonly stage;
|
|
16
|
+
private readonly observer;
|
|
17
|
+
private pendingViewport;
|
|
18
|
+
private resizeQueued;
|
|
19
|
+
private destroyed;
|
|
20
|
+
constructor(app: Application, root: Container, host: HTMLElement, onResize?: ((viewport: PixiViewport) => void) | undefined, stage?: PixiViewport);
|
|
21
|
+
resize(viewport: PixiViewport): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
private queueResize;
|
|
24
|
+
private isValidViewport;
|
|
25
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type VisualResultEffect = 'noiseEdge' | 'lightEdge' | 'pulseEdge' | 'radialBurst' | 'imageBurst';
|
|
2
|
+
export interface ResultEffectTuning {
|
|
3
|
+
readonly layout: {
|
|
4
|
+
readonly fallbackCenterX: number;
|
|
5
|
+
readonly fallbackCenterY: number;
|
|
6
|
+
readonly fallbackSpacingPx: number;
|
|
7
|
+
readonly imageBurst: {
|
|
8
|
+
readonly diameterPx: number;
|
|
9
|
+
readonly offsetX: number;
|
|
10
|
+
readonly offsetY: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly visual: {
|
|
14
|
+
readonly edge: Readonly<Record<'noiseEdge' | 'lightEdge' | 'pulseEdge', {
|
|
15
|
+
readonly color: string;
|
|
16
|
+
readonly intensity: number;
|
|
17
|
+
readonly edgeDepthPx: number;
|
|
18
|
+
readonly softnessPx: number;
|
|
19
|
+
}>>;
|
|
20
|
+
readonly noiseEdge: {
|
|
21
|
+
readonly noiseScale: number;
|
|
22
|
+
readonly distortion: number;
|
|
23
|
+
};
|
|
24
|
+
readonly pulseEdge: {
|
|
25
|
+
readonly breathAmplitude: number;
|
|
26
|
+
};
|
|
27
|
+
readonly imageBurst: {
|
|
28
|
+
readonly peakAlpha: number;
|
|
29
|
+
};
|
|
30
|
+
readonly radialBurst: {
|
|
31
|
+
readonly color: string;
|
|
32
|
+
readonly coreRadiusPx: number;
|
|
33
|
+
readonly haloRadiusPx: number;
|
|
34
|
+
readonly rayCount: number;
|
|
35
|
+
readonly intensity: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly motion: {
|
|
39
|
+
readonly edge: Readonly<Record<'noiseEdge' | 'lightEdge' | 'pulseEdge', {
|
|
40
|
+
readonly enterMs: number;
|
|
41
|
+
readonly holdMs: number;
|
|
42
|
+
readonly exitMs: number;
|
|
43
|
+
readonly driftSpeed: number;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly imageBurst: {
|
|
46
|
+
readonly revealMs: number;
|
|
47
|
+
readonly expandMs: number;
|
|
48
|
+
readonly endScale: number;
|
|
49
|
+
};
|
|
50
|
+
readonly radialBurst: {
|
|
51
|
+
readonly enterMs: number;
|
|
52
|
+
readonly holdMs: number;
|
|
53
|
+
readonly exitMs: number;
|
|
54
|
+
readonly rotationSpeed: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Container } from 'pixi.js';
|
|
2
|
+
import type { DisplayEntity, DisplaySnapshot, PresentationEvent } from '@bardway/trpg-display';
|
|
3
|
+
import type { PixiDisplayContext, PixiDisplaySurface } from './PixiDisplayRenderer.js';
|
|
4
|
+
import type { PixiStageTheme } from './PixiStageTheme.js';
|
|
5
|
+
export interface RetainedStageSurfaceOptions {
|
|
6
|
+
readonly theme: PixiStageTheme;
|
|
7
|
+
readonly fonts: {
|
|
8
|
+
body: string;
|
|
9
|
+
data: string;
|
|
10
|
+
display: string;
|
|
11
|
+
};
|
|
12
|
+
readonly resourceColor: (entity: DisplayEntity, resourceId: string) => string;
|
|
13
|
+
readonly play: (event: PresentationEvent, context: PixiDisplayContext, signal: AbortSignal) => Promise<void>;
|
|
14
|
+
readonly layout?: {
|
|
15
|
+
cardWidth: number;
|
|
16
|
+
cardGap: number;
|
|
17
|
+
rosterHeight: number;
|
|
18
|
+
avatarSize: number;
|
|
19
|
+
resourceHeight: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Neutral composition of the extracted retained portrait/meter/media primitives.
|
|
24
|
+
* Scene kind, titles, resources, statuses and action ordering are supplied by the host.
|
|
25
|
+
* Product Prelude/Story/Battle/Ending artwork and rule conditions stay outside the package.
|
|
26
|
+
*/
|
|
27
|
+
export declare class RetainedStageSurface implements PixiDisplaySurface {
|
|
28
|
+
private readonly context;
|
|
29
|
+
private readonly options;
|
|
30
|
+
readonly node: Container;
|
|
31
|
+
private readonly title;
|
|
32
|
+
private readonly image;
|
|
33
|
+
private readonly cards;
|
|
34
|
+
private readonly typography;
|
|
35
|
+
private readonly layout;
|
|
36
|
+
private generation;
|
|
37
|
+
private scope;
|
|
38
|
+
private video;
|
|
39
|
+
private reducedMotion;
|
|
40
|
+
private destroyed;
|
|
41
|
+
constructor(context: PixiDisplayContext, options: RetainedStageSurfaceOptions);
|
|
42
|
+
applySnapshot(snapshot: DisplaySnapshot, signal: AbortSignal): Promise<void>;
|
|
43
|
+
play(event: PresentationEvent, signal: AbortSignal): Promise<void>;
|
|
44
|
+
setReducedMotion(reduced: boolean): void;
|
|
45
|
+
reset(): void;
|
|
46
|
+
destroy(): void;
|
|
47
|
+
private createCard;
|
|
48
|
+
private syncCard;
|
|
49
|
+
private removeCard;
|
|
50
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Neutral input replacing the source's product snapshot/story/battle wrappers. */
|
|
2
|
+
export interface FieldEffectState<TEffect extends string, TProfile extends string> {
|
|
3
|
+
owner: string;
|
|
4
|
+
profile: TProfile;
|
|
5
|
+
effectId: TEffect | null;
|
|
6
|
+
hydrate?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldEffectSurface<TEffect extends string, TProfile extends string> {
|
|
9
|
+
setProfile(profile: TProfile): void;
|
|
10
|
+
replace(effect: TEffect | null, signal: AbortSignal, onCommitted: () => void): Promise<void>;
|
|
11
|
+
hydrate(effect: TEffect | null): void;
|
|
12
|
+
setPaused(paused: boolean): void;
|
|
13
|
+
setSuspended(suspended: boolean): void;
|
|
14
|
+
reset(): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface FieldEffectAudio<TEffect extends string> {
|
|
18
|
+
play(effect: TEffect): void;
|
|
19
|
+
pause(): void;
|
|
20
|
+
resume(effect: TEffect): void;
|
|
21
|
+
stop(): void;
|
|
22
|
+
}
|
|
23
|
+
/** Retains source owner/request isolation, silent hydration and audio suspension. */
|
|
24
|
+
export declare class SessionFieldEffectRuntime<TEffect extends string, TProfile extends string> {
|
|
25
|
+
private readonly surface;
|
|
26
|
+
private readonly getAudio;
|
|
27
|
+
private readonly onChanged?;
|
|
28
|
+
private desired;
|
|
29
|
+
private mounted;
|
|
30
|
+
private controller;
|
|
31
|
+
private version;
|
|
32
|
+
private paused;
|
|
33
|
+
private suspended;
|
|
34
|
+
private audioEffect;
|
|
35
|
+
private destroyed;
|
|
36
|
+
constructor(surface: FieldEffectSurface<TEffect, TProfile>, getAudio: () => FieldEffectAudio<TEffect> | null, onChanged?: ((effect: TEffect | null) => void) | undefined);
|
|
37
|
+
sync(state: FieldEffectState<TEffect, TProfile>, externalSignal?: AbortSignal): Promise<void>;
|
|
38
|
+
getEffectId(): TEffect | null;
|
|
39
|
+
setPaused(paused: boolean): void;
|
|
40
|
+
setGlobalSuspended(suspended: boolean): void;
|
|
41
|
+
syncAudio(): void;
|
|
42
|
+
reset(): void;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
private syncSuspension;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Retains the last eligible scene; the host chooses transient scene kinds and the initial scene. */
|
|
2
|
+
export declare class SessionSceneHistory<TScene extends string> {
|
|
3
|
+
private readonly initial;
|
|
4
|
+
private readonly transientScenes;
|
|
5
|
+
private previous;
|
|
6
|
+
constructor(initial: TScene, transientScenes: ReadonlySet<TScene>);
|
|
7
|
+
record(scene: TScene): void;
|
|
8
|
+
getPreviousScene(): TScene;
|
|
9
|
+
reset(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type SessionDisplayScene = string;
|
|
2
|
+
export type SceneDefinitionTarget = {
|
|
3
|
+
kind: 'visualVariant';
|
|
4
|
+
semanticScene: SessionDisplayScene;
|
|
5
|
+
visualVariant: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'semanticSceneDraft';
|
|
8
|
+
requestedSceneId: string;
|
|
9
|
+
};
|
|
10
|
+
export interface SessionSceneDescriptor {
|
|
11
|
+
id: string;
|
|
12
|
+
semanticScene: SessionDisplayScene;
|
|
13
|
+
structure: 'locked';
|
|
14
|
+
editorSlots: readonly string[];
|
|
15
|
+
requiredBindings: readonly string[];
|
|
16
|
+
transitions: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface SessionVisualVariantDescriptor {
|
|
19
|
+
id: string;
|
|
20
|
+
target: Extract<SceneDefinitionTarget, {
|
|
21
|
+
kind: 'visualVariant';
|
|
22
|
+
}>;
|
|
23
|
+
source: 'core' | 'composed';
|
|
24
|
+
requiredBindings: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export declare const createSessionSceneRegistry: (scenes: readonly SessionSceneDescriptor[]) => {
|
|
27
|
+
all: () => readonly SessionSceneDescriptor[];
|
|
28
|
+
get: (scene: SessionDisplayScene) => SessionSceneDescriptor;
|
|
29
|
+
canEnterProductionFlow: (target: SceneDefinitionTarget) => boolean;
|
|
30
|
+
};
|
|
31
|
+
export {};
|