bard-legends-framework 1.6.0 → 1.7.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/dist/index.d.mts +290 -191
- package/dist/index.d.ts +290 -191
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +20 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as actions_lib from 'actions-lib';
|
|
2
|
-
import { IDAttachable, Attachable, AttachmentID, IdleSingleEvent, IdleSequence, Sequence, SingleNotifier, Notifier, SingleEvent,
|
|
3
|
-
import { Vector,
|
|
2
|
+
import { IDAttachable, Attachable, AttachmentID, IdleSingleEvent, IdleSequence, Variable, Reducer, Sequence, SingleNotifier, Notifier, SingleEvent, Action, ClassID, NotifierCallbackFunction, IAttachment } from 'actions-lib';
|
|
3
|
+
import { Vector, DynamicID, Vec2, RGBColor, Radian, Rectangle, Grid, GridNeighborType, Line } from 'helpers-lib';
|
|
4
4
|
import p2$1 from 'p2';
|
|
5
5
|
import * as Pixi from 'pixi.js';
|
|
6
6
|
|
|
@@ -96,7 +96,6 @@ declare abstract class Scene<InputType, OutputType> extends IDAttachable {
|
|
|
96
96
|
readonly onClose: actions_lib.PersistentSingleNotifier<OutputType>;
|
|
97
97
|
constructor();
|
|
98
98
|
close(...args: void extends OutputType ? (OutputType extends void ? [] : [OutputType]) : [OutputType]): IdleSingleEvent<OutputType>;
|
|
99
|
-
private animateAndClose;
|
|
100
99
|
protected abstract init(input: InputType): IdleSingleEvent;
|
|
101
100
|
protected abstract update(time: number, delta: number): void;
|
|
102
101
|
protected abstract prepareToClose(): IdleSingleEvent;
|
|
@@ -144,6 +143,250 @@ declare abstract class View extends IDAttachable {
|
|
|
144
143
|
update(time: number, delta: number): void;
|
|
145
144
|
}
|
|
146
145
|
|
|
146
|
+
type AudioAppearTransitionType = 'ease' | 'instant';
|
|
147
|
+
declare const SOUND_TRANSITION_DURATION = 800;
|
|
148
|
+
declare class Audio {
|
|
149
|
+
private constructor();
|
|
150
|
+
setVolumes(volumes: {
|
|
151
|
+
master: number;
|
|
152
|
+
music: number;
|
|
153
|
+
sound: number;
|
|
154
|
+
}): void;
|
|
155
|
+
appear(on: boolean, type?: AudioAppearTransitionType): IdleSingleEvent;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface FocusingNewTargetInfo {
|
|
159
|
+
time: number;
|
|
160
|
+
duration: number;
|
|
161
|
+
position: Vector;
|
|
162
|
+
roundPosition: boolean;
|
|
163
|
+
roundPositionThreshold: number;
|
|
164
|
+
focusingAnimation: FocusingAnimation;
|
|
165
|
+
}
|
|
166
|
+
declare class CameraEntity extends SingletonEntity {
|
|
167
|
+
readonly position: Variable<Vector>;
|
|
168
|
+
readonly offset: Variable<Vector>;
|
|
169
|
+
readonly targetPosition: Variable<Vector | undefined>;
|
|
170
|
+
readonly focusingNewTargetInfo: Variable<FocusingNewTargetInfo | undefined>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
declare class CameraService {
|
|
174
|
+
createCamera(): CameraEntity;
|
|
175
|
+
getCameraPosition(): Vector;
|
|
176
|
+
setPosition(position: Vector): void;
|
|
177
|
+
setTransition(options: FocusingOptions): void;
|
|
178
|
+
update(time: number, delta: number): void;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare enum CameraLayer {
|
|
182
|
+
BackgroundScreen = "backgroundScreen",
|
|
183
|
+
Background = "background",
|
|
184
|
+
Main = "main",
|
|
185
|
+
Foreground = "foreground",
|
|
186
|
+
ForegroundScreen = "foregroundScreen"
|
|
187
|
+
}
|
|
188
|
+
declare enum FocusingAnimation {
|
|
189
|
+
Instant = 1,
|
|
190
|
+
EaseInOut = 2,
|
|
191
|
+
EaseOut = 3
|
|
192
|
+
}
|
|
193
|
+
interface FocusingOptions {
|
|
194
|
+
duration?: number;
|
|
195
|
+
animation?: FocusingAnimation;
|
|
196
|
+
roundPosition?: boolean;
|
|
197
|
+
roundPositionThreshold?: number;
|
|
198
|
+
}
|
|
199
|
+
type CameraAppearTransitionType = 'alpha' | 'pureBlack' | 'instant';
|
|
200
|
+
|
|
201
|
+
declare class CameraController {
|
|
202
|
+
constructor(_cameraService: CameraService);
|
|
203
|
+
createCamera(): number;
|
|
204
|
+
update(time: number, delta: number): void;
|
|
205
|
+
setPosition(position: Vector): void;
|
|
206
|
+
setTransition(options: FocusingOptions): void;
|
|
207
|
+
getCameraPosition(): Vector;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare const CameraGateway_base: new () => CameraController;
|
|
211
|
+
declare class CameraGateway extends CameraGateway_base {
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare class Camera {
|
|
215
|
+
readonly layers: Record<CameraLayer, number>;
|
|
216
|
+
get position(): Vector;
|
|
217
|
+
constructor();
|
|
218
|
+
setPosition(position: Vector): void;
|
|
219
|
+
setTransition(options: FocusingOptions): void;
|
|
220
|
+
appear(on: boolean, type?: CameraAppearTransitionType, delay?: number): IdleSingleEvent;
|
|
221
|
+
screenPositonToStagePosition(screenPosition: Vector): Vector;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare const DEFAULT_SHADER_RESOLUTION = 2;
|
|
225
|
+
interface AssetDefinition<T = string> {
|
|
226
|
+
readonly id: T;
|
|
227
|
+
readonly url: string;
|
|
228
|
+
}
|
|
229
|
+
declare enum BlendMode {
|
|
230
|
+
Normal = 0,
|
|
231
|
+
Add = 1,
|
|
232
|
+
Screen = 3,
|
|
233
|
+
Luminosity = 16,
|
|
234
|
+
ColorDodge = 7
|
|
235
|
+
}
|
|
236
|
+
interface SpriteIDRegistry {
|
|
237
|
+
}
|
|
238
|
+
type SpriteID = DynamicID<SpriteIDRegistry, 'SpriteID'>;
|
|
239
|
+
interface SpriteDefinition {
|
|
240
|
+
readonly id: SpriteID;
|
|
241
|
+
readonly scale: number;
|
|
242
|
+
readonly anchor: Vec2;
|
|
243
|
+
readonly size: Vec2;
|
|
244
|
+
readonly boundingShapes?: PolygonDefinition | undefined;
|
|
245
|
+
readonly destroyAssetOnDestroy?: boolean | undefined;
|
|
246
|
+
}
|
|
247
|
+
interface GlowingShapeDefinition {
|
|
248
|
+
readonly color: RGBColor;
|
|
249
|
+
readonly shapeAlpha: number;
|
|
250
|
+
readonly glowAlpha: number;
|
|
251
|
+
readonly glowOptions: GlowOptions;
|
|
252
|
+
readonly shapes: PolygonDefinition;
|
|
253
|
+
}
|
|
254
|
+
type PolygonDefinition = readonly (readonly Vec2[])[];
|
|
255
|
+
interface GlowOptions {
|
|
256
|
+
readonly color: RGBColor;
|
|
257
|
+
readonly blurRadius: number | Vector;
|
|
258
|
+
readonly expand: number;
|
|
259
|
+
readonly blendMode: BlendMode;
|
|
260
|
+
}
|
|
261
|
+
type GlowEffectOptions = Partial<GlowOptions> & {
|
|
262
|
+
glowAlpha?: number;
|
|
263
|
+
};
|
|
264
|
+
interface SoundIDRegistry {
|
|
265
|
+
}
|
|
266
|
+
type SoundID = DynamicID<SoundIDRegistry, 'SoundID'>;
|
|
267
|
+
interface SoundDefinition {
|
|
268
|
+
readonly id: SoundID;
|
|
269
|
+
readonly duration: number;
|
|
270
|
+
readonly loop?: {
|
|
271
|
+
readonly from: number;
|
|
272
|
+
readonly to: number;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface GameConfiguration {
|
|
277
|
+
readonly screenResolution: {
|
|
278
|
+
readonly width: number;
|
|
279
|
+
readonly height: number;
|
|
280
|
+
} | undefined;
|
|
281
|
+
readonly maxScreenResolution: {
|
|
282
|
+
readonly width: number;
|
|
283
|
+
readonly height: number;
|
|
284
|
+
} | undefined;
|
|
285
|
+
readonly devMode: boolean;
|
|
286
|
+
readonly backgroundColor: RGBColor;
|
|
287
|
+
readonly antialias: boolean;
|
|
288
|
+
readonly resolution: number;
|
|
289
|
+
}
|
|
290
|
+
interface GameSetupOptions {
|
|
291
|
+
readonly spriteAssetDefinitions: readonly AssetDefinition<SpriteID>[];
|
|
292
|
+
readonly spriteDefinitions: Readonly<Record<SpriteID, SpriteDefinition>>;
|
|
293
|
+
readonly fontAssetDefinitions: readonly AssetDefinition[];
|
|
294
|
+
readonly soundAssetDefinitions: readonly AssetDefinition<SoundID>[];
|
|
295
|
+
readonly soundDefinitions: Readonly<Record<SoundID, SoundDefinition>>;
|
|
296
|
+
}
|
|
297
|
+
declare class Game {
|
|
298
|
+
static get instance(): Game;
|
|
299
|
+
static readonly pause: Reducer<boolean, boolean>;
|
|
300
|
+
static readonly freeze: Reducer<boolean, boolean>;
|
|
301
|
+
static get camera(): Camera;
|
|
302
|
+
static get audio(): Audio;
|
|
303
|
+
static appear(on: boolean, options?: {
|
|
304
|
+
camera?: CameraAppearTransitionType;
|
|
305
|
+
audio?: AudioAppearTransitionType;
|
|
306
|
+
}): IdleSingleEvent;
|
|
307
|
+
static get time(): number;
|
|
308
|
+
readonly renderer: Pixi.Renderer;
|
|
309
|
+
readonly _screenSize: Variable<Vector>;
|
|
310
|
+
readonly screenSize: actions_lib.PersistentNotifier<Vector>;
|
|
311
|
+
readonly _screenSizeCenter: Variable<Vector>;
|
|
312
|
+
readonly screenSizeCenter: actions_lib.PersistentNotifier<Vector>;
|
|
313
|
+
readonly devMode: boolean;
|
|
314
|
+
constructor(partialConfiguration?: Partial<GameConfiguration>);
|
|
315
|
+
setup(setupOptions: GameSetupOptions): Promise<void>;
|
|
316
|
+
setResolution(resolution: number): void;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
interface SoundOptions {
|
|
320
|
+
readonly offset?: number;
|
|
321
|
+
}
|
|
322
|
+
declare class Sound extends IDAttachable {
|
|
323
|
+
static createByName(soundName: SoundID, options?: SoundOptions): Sound;
|
|
324
|
+
protected _source: AudioBufferSourceNode;
|
|
325
|
+
protected _gain: GainNode;
|
|
326
|
+
protected _head: AudioNode;
|
|
327
|
+
protected _soundDefinition: SoundDefinition;
|
|
328
|
+
protected _start: number;
|
|
329
|
+
get volume(): number;
|
|
330
|
+
set volume(value: number);
|
|
331
|
+
setVolume(value: number): this;
|
|
332
|
+
constructor(soundDefinition: SoundDefinition, options?: SoundOptions);
|
|
333
|
+
destroy(): void;
|
|
334
|
+
protected _play(offset: number): void;
|
|
335
|
+
protected _stop(): void;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
interface AdvancedSoundOptions extends SoundOptions {
|
|
339
|
+
readonly fade?: number;
|
|
340
|
+
readonly muffle?: number;
|
|
341
|
+
}
|
|
342
|
+
declare class AdvancedSound extends Sound {
|
|
343
|
+
static createByName(soundName: SoundID, options?: AdvancedSoundOptions): AdvancedSound;
|
|
344
|
+
readonly time: actions_lib.PersistentNotifier<number>;
|
|
345
|
+
constructor(soundDefinition: SoundDefinition, options?: AdvancedSoundOptions);
|
|
346
|
+
close(): IdleSingleEvent;
|
|
347
|
+
/**
|
|
348
|
+
* @param time in seconds
|
|
349
|
+
* @returns IdleSingleEvent that resolves in the given time
|
|
350
|
+
*/
|
|
351
|
+
notifyOnTime(targetTime: number): IdleSingleEvent;
|
|
352
|
+
setFade(strength: number): void;
|
|
353
|
+
fade(strength: number, transitionDuration?: number): IdleSingleEvent;
|
|
354
|
+
setMuffle(strength: number): void;
|
|
355
|
+
muffle(strength: number, transitionDuration?: number): IdleSingleEvent;
|
|
356
|
+
destroy(): void;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
interface MusicOptions extends SoundOptions {
|
|
360
|
+
readonly stopPlayingOnPause: boolean;
|
|
361
|
+
}
|
|
362
|
+
declare class Music extends IDAttachable {
|
|
363
|
+
static createByName(soundName: SoundID, options?: MusicOptions): Music;
|
|
364
|
+
constructor(soundDefinition: SoundDefinition, partialOptions?: Partial<MusicOptions>);
|
|
365
|
+
/**
|
|
366
|
+
* Note: If then music time should stay synced with the game time, "stopPlayingOnPause" option has to be set true.
|
|
367
|
+
* @param time in seconds
|
|
368
|
+
* @returns IdleSingleEvent that resolves in the given time
|
|
369
|
+
*/
|
|
370
|
+
notifyOnTime(targetTime: number): IdleSingleEvent;
|
|
371
|
+
close(): IdleSingleEvent;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
interface MusicPlayerOptionsNoPause extends MusicOptions {
|
|
375
|
+
readonly stopPlayingOnPause: false;
|
|
376
|
+
readonly playWhenPaused: undefined;
|
|
377
|
+
}
|
|
378
|
+
interface MusicPlayerOptionsWithPause extends MusicOptions {
|
|
379
|
+
readonly stopPlayingOnPause: true;
|
|
380
|
+
readonly playWhenPaused: SoundID | undefined;
|
|
381
|
+
}
|
|
382
|
+
type MusicPlayerOptions = MusicPlayerOptionsNoPause | MusicPlayerOptionsWithPause;
|
|
383
|
+
declare class MusicPlayer extends IDAttachable {
|
|
384
|
+
constructor(partialOptions?: Partial<MusicPlayerOptions>);
|
|
385
|
+
play(soundID: SoundID): IdleSingleEvent<Music | undefined>;
|
|
386
|
+
stop(): IdleSingleEvent;
|
|
387
|
+
close(): IdleSingleEvent;
|
|
388
|
+
}
|
|
389
|
+
|
|
147
390
|
declare enum ContainerEventType {
|
|
148
391
|
Click = "click",
|
|
149
392
|
MouseOver = "mouseover",
|
|
@@ -260,51 +503,13 @@ declare class Filters {
|
|
|
260
503
|
removeColorFilter(): void;
|
|
261
504
|
}
|
|
262
505
|
|
|
263
|
-
declare const DEFAULT_SHADER_RESOLUTION = 2;
|
|
264
|
-
interface AssetDefinition<T extends string = string> {
|
|
265
|
-
readonly id: string;
|
|
266
|
-
readonly url: T;
|
|
267
|
-
}
|
|
268
|
-
declare enum BlendMode {
|
|
269
|
-
Normal = 0,
|
|
270
|
-
Add = 1,
|
|
271
|
-
Screen = 3,
|
|
272
|
-
Luminosity = 16,
|
|
273
|
-
ColorDodge = 7
|
|
274
|
-
}
|
|
275
|
-
interface SpriteDefinition {
|
|
276
|
-
readonly id: string;
|
|
277
|
-
readonly scale: number;
|
|
278
|
-
readonly anchor: Vec2;
|
|
279
|
-
readonly size: Vec2;
|
|
280
|
-
readonly boundingShapes?: PolygonDefinition | undefined;
|
|
281
|
-
readonly destroyAssetOnDestroy?: boolean | undefined;
|
|
282
|
-
}
|
|
283
|
-
interface GlowingShapeDefinition {
|
|
284
|
-
readonly color: RGBColor;
|
|
285
|
-
readonly shapeAlpha: number;
|
|
286
|
-
readonly glowAlpha: number;
|
|
287
|
-
readonly glowOptions: GlowOptions;
|
|
288
|
-
readonly shapes: PolygonDefinition;
|
|
289
|
-
}
|
|
290
|
-
type PolygonDefinition = readonly (readonly Vec2[])[];
|
|
291
|
-
interface GlowOptions {
|
|
292
|
-
readonly color: RGBColor;
|
|
293
|
-
readonly blurRadius: number | Vector;
|
|
294
|
-
readonly expand: number;
|
|
295
|
-
readonly blendMode: BlendMode;
|
|
296
|
-
}
|
|
297
|
-
type GlowEffectOptions = Partial<GlowOptions> & {
|
|
298
|
-
glowAlpha?: number;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
506
|
interface SpriteOptions {
|
|
302
507
|
readonly textureSize?: Vector;
|
|
303
508
|
readonly texturePosition?: Vector;
|
|
304
509
|
readonly ignoreAnchor?: boolean;
|
|
305
510
|
}
|
|
306
511
|
declare class Sprite extends Container {
|
|
307
|
-
static createByName(spriteName:
|
|
512
|
+
static createByName(spriteName: SpriteID): Sprite;
|
|
308
513
|
static createSnapshotSprite(container: Container): Sprite;
|
|
309
514
|
readonly pixiSprite: Pixi.Sprite;
|
|
310
515
|
constructor(spriteDefinition: SpriteDefinition, options?: SpriteOptions);
|
|
@@ -480,7 +685,7 @@ declare class MenuUI extends Container {
|
|
|
480
685
|
readonly onCreate: actions_lib.PersistentSingleNotifier<void>;
|
|
481
686
|
readonly onOpen: actions_lib.PersistentSingleNotifier<void>;
|
|
482
687
|
readonly onClose: actions_lib.PersistentSingleNotifier<void>;
|
|
483
|
-
constructor(windowSprite:
|
|
688
|
+
constructor(windowSprite: SpriteID, partialOptions: Partial<MenuOptions>);
|
|
484
689
|
getBoundingMask(): Sprite;
|
|
485
690
|
close(): IdleSingleEvent;
|
|
486
691
|
}
|
|
@@ -489,7 +694,7 @@ interface MenuEntityOptions {
|
|
|
489
694
|
readonly closeOnBackgroundClick: boolean;
|
|
490
695
|
}
|
|
491
696
|
declare class MenuEntity extends SingletonEntity {
|
|
492
|
-
static subscribeIsOpen():
|
|
697
|
+
static subscribeIsOpen(): Sequence<boolean>;
|
|
493
698
|
constructor(partialOptions: Partial<MenuEntityOptions>);
|
|
494
699
|
onCreate(): IdleSingleEvent;
|
|
495
700
|
onOpen(): IdleSingleEvent;
|
|
@@ -505,7 +710,7 @@ declare class MenuView extends View {
|
|
|
505
710
|
readonly onCreate: SingleNotifier<Container>;
|
|
506
711
|
readonly onOpen: SingleNotifier;
|
|
507
712
|
readonly onClose: SingleNotifier;
|
|
508
|
-
constructor(entity: MenuEntity, windowSprite:
|
|
713
|
+
constructor(entity: MenuEntity, windowSprite: SpriteID, partialOptions: Partial<MenuViewOptions>);
|
|
509
714
|
}
|
|
510
715
|
|
|
511
716
|
interface ScrollAreaUIOptions {
|
|
@@ -532,6 +737,8 @@ declare class AnimationInterpolationFunctions {
|
|
|
532
737
|
static lineer(time: number): number;
|
|
533
738
|
static easeIn(time: number): number;
|
|
534
739
|
static easeOut(time: number): number;
|
|
740
|
+
static easeInCubic(time: number): number;
|
|
741
|
+
static easeOutCubic(time: number): number;
|
|
535
742
|
static easeInOut(time: number): number;
|
|
536
743
|
static easeInOutCubic(t: number): number;
|
|
537
744
|
static blink(t: number): number;
|
|
@@ -552,6 +759,14 @@ declare class AnimationEaseInOut implements AnimatorAnimation {
|
|
|
552
759
|
start(): void;
|
|
553
760
|
multiplierFunction(t: number): number;
|
|
554
761
|
}
|
|
762
|
+
declare class AnimationEaseInCubic implements AnimatorAnimation {
|
|
763
|
+
start(): void;
|
|
764
|
+
multiplierFunction(t: number): number;
|
|
765
|
+
}
|
|
766
|
+
declare class AnimationEaseOutCubic implements AnimatorAnimation {
|
|
767
|
+
start(): void;
|
|
768
|
+
multiplierFunction(t: number): number;
|
|
769
|
+
}
|
|
555
770
|
declare class AnimationEaseInOutCubic implements AnimatorAnimation {
|
|
556
771
|
start(): void;
|
|
557
772
|
multiplierFunction(t: number): number;
|
|
@@ -569,6 +784,8 @@ declare class Animations {
|
|
|
569
784
|
static easeIn: AnimationEaseIn;
|
|
570
785
|
static easeOut: AnimationEaseOut;
|
|
571
786
|
static easeInOut: AnimationEaseInOut;
|
|
787
|
+
static easeInCubic: AnimationEaseInCubic;
|
|
788
|
+
static easeOutCubic: AnimationEaseOutCubic;
|
|
572
789
|
static easeInOutCubic: AnimationEaseInOutCubic;
|
|
573
790
|
static blink: AnimationBlink;
|
|
574
791
|
}
|
|
@@ -597,6 +814,8 @@ declare class Animator<T extends object = any, K extends NumericKeys<T> = Numeri
|
|
|
597
814
|
get animating(): boolean;
|
|
598
815
|
get target(): T;
|
|
599
816
|
get value(): Notifier<T>;
|
|
817
|
+
get paused(): boolean;
|
|
818
|
+
set paused(value: boolean);
|
|
600
819
|
constructor(target: T & Record<K, number>, animatedProperties: K | K[], partialOptions?: Partial<AnimationOptions>);
|
|
601
820
|
animate(values: Record<K, number>, partialOptions?: Partial<AnimationOptions>): SingleEvent<void>;
|
|
602
821
|
set(values: Record<K, number>): void;
|
|
@@ -621,52 +840,40 @@ interface StateAnimationOptions {
|
|
|
621
840
|
readonly duration: number;
|
|
622
841
|
readonly animation: AnimatorAnimation;
|
|
623
842
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
843
|
+
type AnimationState$2 = 'idle' | 'transitioning' | 'reverting';
|
|
844
|
+
interface StateAnimationState<T, A> {
|
|
845
|
+
readonly value: number;
|
|
846
|
+
readonly item: T | undefined;
|
|
847
|
+
readonly nextItem: T | undefined;
|
|
848
|
+
readonly queuedItem: T | undefined;
|
|
849
|
+
readonly animationState: A;
|
|
628
850
|
}
|
|
629
851
|
declare class StateAnimation<T> extends Attachable {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
animationState: AnimationState$1;
|
|
636
|
-
};
|
|
852
|
+
onStateChange(callback: (item: T, nextItem?: T) => void): this;
|
|
853
|
+
onValueChange(callback: (value: number) => void): this;
|
|
854
|
+
get state(): StateAnimationState<T, AnimationState$2>;
|
|
855
|
+
get paused(): boolean;
|
|
856
|
+
set paused(value: boolean);
|
|
637
857
|
constructor(partialOptions?: Partial<StateAnimationOptions>);
|
|
638
|
-
|
|
858
|
+
setItem(item: T, options?: {
|
|
639
859
|
instant?: boolean;
|
|
640
860
|
}): void;
|
|
641
|
-
onStateChange(callback: (state: T, nextState?: T) => void): this;
|
|
642
|
-
onValueChange(callback: (value: number) => void): this;
|
|
643
861
|
}
|
|
644
862
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
DisappearToChange = 5
|
|
651
|
-
}
|
|
652
|
-
declare class FadeInStateAnimation<T> extends Attachable {
|
|
653
|
-
get currentState(): {
|
|
654
|
-
value: number;
|
|
655
|
-
state: T | undefined;
|
|
656
|
-
queuedState: T | undefined;
|
|
657
|
-
animationState: AnimationState;
|
|
658
|
-
};
|
|
863
|
+
type AnimationState$1 = 'hidden' | 'visible' | 'appearing' | 'disappearing' | 'disappearToChange';
|
|
864
|
+
declare class ThroughEmptyStateAnimation<T> extends Attachable {
|
|
865
|
+
onStateChange(callback: (state: T | undefined) => void): this;
|
|
866
|
+
onValueChange(callback: (value: number) => void): this;
|
|
867
|
+
get state(): StateAnimationState<T, AnimationState$1>;
|
|
659
868
|
constructor(partialOptions?: Partial<StateAnimationOptions>);
|
|
660
869
|
/**
|
|
661
|
-
* @param
|
|
870
|
+
* @param item - The new item to set. Keep in mind falsy values are also considered as a new item. To set the item to "disappear" use undefined.
|
|
662
871
|
* @param options - Optional options.
|
|
663
|
-
* @param options.instant - If true, the
|
|
872
|
+
* @param options.instant - If true, the item will be set immediately.
|
|
664
873
|
*/
|
|
665
|
-
|
|
874
|
+
setItem(item: T | undefined, options?: {
|
|
666
875
|
instant?: boolean;
|
|
667
876
|
}): void;
|
|
668
|
-
onStateChange(callback: (state: T | undefined) => void): this;
|
|
669
|
-
onValueChange(callback: (value: number) => void): this;
|
|
670
877
|
}
|
|
671
878
|
|
|
672
879
|
declare enum ScrollDirection {
|
|
@@ -706,13 +913,15 @@ declare enum SlideStateAnimationState {
|
|
|
706
913
|
Appear = 1,
|
|
707
914
|
Disappear = 2
|
|
708
915
|
}
|
|
916
|
+
type AnimationState = 'idle' | 'transitionForward' | 'transitionBackward' | 'reverting';
|
|
709
917
|
declare class SlideStateAnimation extends Attachable {
|
|
918
|
+
onStateChange(callback: (state: SlideStateAnimationState, index: number) => void): this;
|
|
919
|
+
onValueChange(callback: (value: number, index: number) => void): this;
|
|
920
|
+
get state(): StateAnimationState<number, AnimationState>;
|
|
710
921
|
constructor(partialOptions?: Partial<StateAnimationOptions>);
|
|
711
922
|
setIndex(index: number, options?: {
|
|
712
923
|
instant?: boolean;
|
|
713
924
|
}): void;
|
|
714
|
-
onStateChange(callback: (state: SlideStateAnimationState, index: number) => void): this;
|
|
715
|
-
onValueChange(callback: (value: number, index: number) => void): this;
|
|
716
925
|
}
|
|
717
926
|
|
|
718
927
|
declare class VectorSet {
|
|
@@ -747,115 +956,6 @@ declare class ScrollMaskUI extends Container {
|
|
|
747
956
|
constructor(container: Container, size: Vector, padding: number, direction?: ScrollDirection);
|
|
748
957
|
}
|
|
749
958
|
|
|
750
|
-
interface FocusingNewTargetInfo {
|
|
751
|
-
time: number;
|
|
752
|
-
duration: number;
|
|
753
|
-
position: Vector;
|
|
754
|
-
roundPosition: boolean;
|
|
755
|
-
roundPositionThreshold: number;
|
|
756
|
-
focusingAnimation: FocusingAnimation;
|
|
757
|
-
}
|
|
758
|
-
declare class CameraEntity extends SingletonEntity {
|
|
759
|
-
readonly position: Variable<Vector>;
|
|
760
|
-
readonly offset: Variable<Vector>;
|
|
761
|
-
readonly targetPosition: Variable<Vector | undefined>;
|
|
762
|
-
readonly focusingNewTargetInfo: Variable<FocusingNewTargetInfo | undefined>;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
declare class CameraService {
|
|
766
|
-
createCamera(): CameraEntity;
|
|
767
|
-
getCameraPosition(): Vector;
|
|
768
|
-
setPosition(position: Vector): void;
|
|
769
|
-
setTransition(options: FocusingOptions): void;
|
|
770
|
-
update(time: number, delta: number): void;
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
declare enum CameraLayer {
|
|
774
|
-
BackgroundScreen = "backgroundScreen",
|
|
775
|
-
Background = "background",
|
|
776
|
-
Main = "main",
|
|
777
|
-
Foreground = "foreground",
|
|
778
|
-
ForegroundScreen = "foregroundScreen"
|
|
779
|
-
}
|
|
780
|
-
declare enum FocusingAnimation {
|
|
781
|
-
Instant = 1,
|
|
782
|
-
EaseInOut = 2,
|
|
783
|
-
EaseOut = 3
|
|
784
|
-
}
|
|
785
|
-
interface FocusingOptions {
|
|
786
|
-
duration?: number;
|
|
787
|
-
animation?: FocusingAnimation;
|
|
788
|
-
roundPosition?: boolean;
|
|
789
|
-
roundPositionThreshold?: number;
|
|
790
|
-
}
|
|
791
|
-
type CameraAppearTransitionType = 'alpha' | 'pureBlack' | 'instant';
|
|
792
|
-
|
|
793
|
-
declare class CameraController {
|
|
794
|
-
constructor(_cameraService: CameraService);
|
|
795
|
-
createCamera(): number;
|
|
796
|
-
update(time: number, delta: number): void;
|
|
797
|
-
setPosition(position: Vector): void;
|
|
798
|
-
setTransition(options: FocusingOptions): void;
|
|
799
|
-
getCameraPosition(): Vector;
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
declare const CameraGateway_base: new () => CameraController;
|
|
803
|
-
declare class CameraGateway extends CameraGateway_base {
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
declare class Camera {
|
|
807
|
-
readonly layers: Record<CameraLayer, number>;
|
|
808
|
-
get position(): Vector;
|
|
809
|
-
constructor();
|
|
810
|
-
setPosition(position: Vector): void;
|
|
811
|
-
setTransition(options: FocusingOptions): void;
|
|
812
|
-
appear(on: boolean, type?: CameraAppearTransitionType): IdleSingleEvent;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
interface GameConfiguration {
|
|
816
|
-
readonly screenResolution: {
|
|
817
|
-
readonly width: number;
|
|
818
|
-
readonly height: number;
|
|
819
|
-
} | undefined;
|
|
820
|
-
readonly maxScreenResolution: {
|
|
821
|
-
readonly width: number;
|
|
822
|
-
readonly height: number;
|
|
823
|
-
} | undefined;
|
|
824
|
-
readonly devMode: boolean;
|
|
825
|
-
readonly backgroundColor: RGBColor;
|
|
826
|
-
readonly antialias: boolean;
|
|
827
|
-
readonly resolution: number;
|
|
828
|
-
}
|
|
829
|
-
interface GameSetupOptions {
|
|
830
|
-
readonly assetDefinitions: readonly AssetDefinition<string>[];
|
|
831
|
-
readonly spriteDefinitions: Readonly<Record<string, SpriteDefinition>>;
|
|
832
|
-
}
|
|
833
|
-
declare class Game {
|
|
834
|
-
static get instance(): Game;
|
|
835
|
-
static readonly pause: Reducer<boolean, boolean>;
|
|
836
|
-
static get camera(): Camera;
|
|
837
|
-
static get time(): number;
|
|
838
|
-
readonly stage: Container;
|
|
839
|
-
readonly renderer: Pixi.Renderer;
|
|
840
|
-
readonly _screenSize: Variable<Vector>;
|
|
841
|
-
readonly screenSize: actions_lib.PersistentNotifier<Vector>;
|
|
842
|
-
readonly _screenSizeCenter: Variable<Vector>;
|
|
843
|
-
readonly screenSizeCenter: actions_lib.PersistentNotifier<Vector>;
|
|
844
|
-
readonly devMode: boolean;
|
|
845
|
-
constructor(partialConfiguration?: Partial<GameConfiguration>);
|
|
846
|
-
setup(setupOptions: GameSetupOptions): Promise<void>;
|
|
847
|
-
setResolution(resolution: number): void;
|
|
848
|
-
screenPositonToStagePosition(screenPosition: Vector): Vector;
|
|
849
|
-
setScreenPositionToStagePositionFunction(converterFunction: (screenPosition: Vector) => Vector): void;
|
|
850
|
-
resetScreenPositionToStagePositionFunction(): void;
|
|
851
|
-
destroyAsset(assetID: string): void;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
declare class PositionConversionHelper {
|
|
855
|
-
static includeScaleInScreenPosition(screenPosition: Vector, gameInstanceScale: number, screenSizeCenter: Vector): Vector;
|
|
856
|
-
static normalizePolygonByAnchor(polygon: PolygonDefinition, frameSize: Vector, frameAnchor: Vector): PolygonDefinition;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
959
|
interface KeyboardKeyInfo {
|
|
860
960
|
readonly key: string;
|
|
861
961
|
readonly code: string;
|
|
@@ -883,7 +983,6 @@ declare class MouseService {
|
|
|
883
983
|
* accounting for canvas offset (e.g. letterboxing when max resolution is smaller than the window)
|
|
884
984
|
* and CSS scaling of the canvas.
|
|
885
985
|
*/
|
|
886
|
-
private clientPositionToScreenPosition;
|
|
887
986
|
}
|
|
888
987
|
|
|
889
988
|
declare class MouseTargetFocusService {
|
|
@@ -1216,4 +1315,4 @@ declare const PhysicsGateway_base: new () => PhysicsController;
|
|
|
1216
1315
|
declare class PhysicsGateway extends PhysicsGateway_base {
|
|
1217
1316
|
}
|
|
1218
1317
|
|
|
1219
|
-
export { AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions,
|
|
1318
|
+
export { AdvancedSound, type AdvancedSoundOptions, AnimationFlicker, AnimationInterpolationFunctions, type AnimationOptions, Animations, AnimationsCompletionHandlingType, Animator, type AnimatorAnimation, type AssetDefinition, type AudioAppearTransitionType, BORDER_MATERIAL_NAME, BardLegendsHardReset, BlendMode, type BorderProperties, Camera, CameraGateway, type CircleShapeData, ClosestAvailableSpaceHelper, type CollisionDetails, type CollisionReport, Container, ContainerEventType, ControllerDecorator, type CreateDashedLineOptions, type CreatePhysicsWorldRequestDTO, Cursor, DEFAULT_SHADER_RESOLUTION, DeltaTime, DisplayObjectArray, type DisplayObjectArrayOptions, type DropShadowOptions, Entity, EntityDecorator, type ExplosionHit, FadeInContent, type FadeInContentOptions, FocusingAnimation, Game, Gateway, type GlowEffectOptions, type GlowOptions, type GlowingShapeDefinition, Graphics, type HitTestOptions, ImmovablePhysicsEntity, type InteractingBodyGroups, type KeyboardKeyInfo, KeyboardService, type MapSizeDTO, type MaterialContactDefinition, type MaterialDefinition, MenuEntity, type MenuOptions, MenuUI, MenuView, MouseService, MouseTargetFocusService, MovableEntity, MovablePhysicsEntity, Music, MusicPlayer, type MusicPlayerOptions, type PartialTextOptions, PathFinder, type PathFinderResult, type PhysicsBodyDTO, PhysicsEntity, type PhysicsEntityDefinition, type PhysicsExplosionOptions, PhysicsGateway, PhysicsShapeType, Placeholder, type PolygonDefinition, type PolygonShapeData, ROTATIONAL_SPEED_LIMIT, type RayCast, type RayCastHit, ReAnimateHandlingType, type RectangleShapeData, RichText, type RichTextOptions, type RichTextRectangleCut, type RichTextStyles, SOUND_TRANSITION_DURATION, SPEED_LIMIT, Scene, SceneDecorator, ScrollAreaUI, ScrollDirection, type ScrollInContentOptions, ScrollMaskUI, Service, ServiceDecorator, type SetParentOptions, type ShapeDefinition, SingletonEntity, SlideInContent, SlideInContentByIndex, SlideStateAnimation, SlideStateAnimationState, Sound, type SoundDefinition, type SoundID, type SoundIDRegistry, type SoundOptions, Sprite, type SpriteDefinition, type SpriteID, type SpriteIDRegistry, StateAnimation, type StateAnimationOptions, type StateAnimationState, Text, type TextAlignment, type TextOptions, ThroughEmptyStateAnimation, UpdatableContainer, UpdateCycle, VectorFieldPathFinder, VectorSet, View, ViewDecorator, type ViewDecoratorMeta };
|