Skip to content

Commit 8f4005f

Browse files
committed
feat: captions api
1 parent 9cab4a4 commit 8f4005f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

p2ce/caption.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @packageDocumentation
3+
* Captioning Interface
4+
*/
5+
6+
interface Caption {
7+
bLowPriority: boolean;
8+
bSFX: boolean;
9+
nNoRepeat: number;
10+
nDelay: number;
11+
flLifetimeOverride: number;
12+
text: string;
13+
options: Map<string, string>;
14+
}
15+
16+
interface GlobalEventNameMap {
17+
BadCaptionRequest: (token: string, lifetime: number) => void;
18+
DisplayCaptionRequest: (token: string, caption: Caption, lifetime: number) => void;
19+
DisplayRawCaptionRequest: (text: string, lifetime: number) => void;
20+
CaptionTick: (time: number) => void;
21+
}

shared/panels.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,12 @@ declare interface Label extends AbstractPanel<'Label'> {
451451
SetLocalizationString(text: string): void;
452452

453453
SetProceduralTextThatIPromiseIsLocalizedAndEscaped(text: string, allowDialogVariables: boolean): void;
454+
455+
/**
456+
* Approximates the height this label would have
457+
* if the passed in text was set, given a pre-determined width.
458+
*/
459+
GetHeightForText(width: number, text: string): number;
454460
}
455461

456462
declare interface Movie extends AbstractPanel<'Movie'> {

0 commit comments

Comments
 (0)