point-click-components 0.2.1 → 0.2.3

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.
@@ -1,9 +1,11 @@
1
1
  import { ActorData } from 'point-click-lib';
2
+ import { AspectRatio } from 'point-click-lib';
2
3
  import { BoardFont } from 'point-click-lib';
3
4
  import { CellMatrix } from 'point-click-lib';
4
5
  import { Command } from 'point-click-lib';
5
6
  import { CommandTarget } from 'point-click-lib';
6
7
  import { Context } from 'react';
8
+ import { ConversationBranch } from 'point-click-lib';
7
9
  import { ConversationChoice } from 'point-click-lib';
8
10
  import { Direction } from 'point-click-lib';
9
11
  import { Dispatch } from 'react';
@@ -13,6 +15,7 @@ import { GameDesign } from 'point-click-lib';
13
15
  import { GameRuntimeOptions } from 'point-click-lib';
14
16
  import { HotspotZone } from 'point-click-lib';
15
17
  import { InGameEventReporter } from 'point-click-lib';
18
+ import { ItemData } from 'point-click-lib';
16
19
  import { LogToDebug } from 'point-click-lib';
17
20
  import { Order } from 'point-click-lib';
18
21
  import { Provider } from 'react';
@@ -22,6 +25,7 @@ import { Reducer } from 'react';
22
25
  import { RoomData } from 'point-click-lib';
23
26
  import { SoundValue } from 'point-click-lib';
24
27
  import { SpriteData } from 'point-click-lib';
28
+ import { StaticFrameParamsS } from 'point-click-lib';
25
29
  import { StoryBoard } from 'point-click-lib';
26
30
  import { StoryBoardPage } from 'point-click-lib';
27
31
  import { Zone } from 'point-click-lib';
@@ -57,7 +61,18 @@ export declare const CameraPointProvider: Provider< {
57
61
  cameraPoint?: XY;
58
62
  }>;
59
63
 
60
- export declare const ContextualGameRoom: () => JSX.Element;
64
+ export declare const CharacterSwitchButtons: () => JSX.Element | null;
65
+
66
+ export declare function CommandLine(): JSX.Element;
67
+
68
+ export declare const ContextualGameRoom: ({ handleTargetContextClick, handleRoomContextClick, }: {
69
+ handleTargetContextClick?: HandleClickFunction<CommandTarget>;
70
+ handleRoomContextClick?: {
71
+ (x: number, y: number): void;
72
+ };
73
+ }) => JSX.Element;
74
+
75
+ export declare const ConversationChoices: () => JSX.Element | null;
61
76
 
62
77
  export declare const DefaultLayout: () => JSX.Element;
63
78
 
@@ -112,11 +127,14 @@ getImageAsset: GetImageAsset;
112
127
  getSoundAsset: GetSoundAsset;
113
128
  SoundHandler?: SoundPlayerComponent;
114
129
  allowLocalSaves?: boolean;
130
+ SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
115
131
  }>;
116
132
 
133
+ export declare const GameMetaControls: () => JSX.Element;
134
+
117
135
  export declare const GameRoom: FunctionComponent<Props_2>;
118
136
 
119
- export declare const GameRunner: ({ gameDesign, Layout, getImageAsset, getSoundAsset, SoundHandler, initialRoomSize, options }: Props_3) => JSX.Element;
137
+ export declare const GameRunner: ({ gameDesign, Layout, getImageAsset, getSoundAsset, SoundHandler, initialRoomSize, options, SpeechBubbleComponent, }: Props_3) => JSX.Element;
120
138
 
121
139
  declare type GameRunnerOptions = Partial<GameRuntimeOptions> & {
122
140
  eventReporter?: InGameEventReporter;
@@ -169,11 +187,30 @@ declare type ImageAsset = FileAsset & {
169
187
 
170
188
  declare type ImageAssetCategory = 'background' | 'item' | 'spriteSheet' | 'any';
171
189
 
190
+ /**
191
+ * Renders a figure with the aspect ratio scaled to be contained by its parent, with the sprite
192
+ * frame as its image background.
193
+ *
194
+ * If the frame has no row and col specified, the image background will display at the image's
195
+ * natural aspect ratio, not be stretch to fill the figure.
196
+ */
197
+ export declare const ImageBlock: React.FunctionComponent<{
198
+ frame: StaticFrameParamsS;
199
+ aspectRatio?: AspectRatio;
200
+ filter?: string;
201
+ fitHeight?: boolean;
202
+ getImageAsset: GetImageAsset;
203
+ }>;
204
+
205
+ export declare const ItemMenu: () => JSX.Element;
206
+
172
207
  export declare function locateClickInWorld(clickXPosition: number, clickYposition: number, viewAngleX: number, viewAngleY: number, roomData: RoomData): {
173
208
  x: number;
174
209
  y: number;
175
210
  };
176
211
 
212
+ export declare function locateRoomXOnFrame(roomX: number, viewAngleX: number, roomData: RoomData): number;
213
+
177
214
  export declare const makeReducer: (gameDesign: GameDesign, options?: GameRunnerOptions) => Reducer<GameData, GameAction>;
178
215
 
179
216
  export declare const makeUiReducer: () => Reducer<UiState, UiAction>;
@@ -208,12 +245,16 @@ declare type Props_2 = {
208
245
  gameState: GameData;
209
246
  handleTargetClick: HandleClickFunction<CommandTarget>;
210
247
  handleTargetContextClick?: HandleClickFunction<CommandTarget>;
248
+ handleRoomContextClick?: {
249
+ (x: number, y: number): void;
250
+ };
211
251
  placeholder?: ReactElement;
212
252
  } & Omit<RoomProps, 'data' | 'viewAngleX' | 'viewAngleY' | 'orderedActors'>;
213
253
 
214
254
  declare interface Props_3 {
215
255
  gameDesign: GameDesign;
216
256
  Layout?: FunctionComponent;
257
+ SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
217
258
  getImageAsset: GetImageAsset;
218
259
  getSoundAsset: GetSoundAsset;
219
260
  SoundHandler?: SoundPlayerComponent;
@@ -298,7 +339,6 @@ export declare interface RoomProps {
298
339
  orderedActors?: ActorWithOrdersAndClickHandlers[];
299
340
  noSound?: boolean;
300
341
  noMargin?: boolean;
301
- fontFamily?: string;
302
342
  parallaxContent?: ReactNode;
303
343
  surfaceContent?: ReactNode;
304
344
  orderSpeed?: number;
@@ -306,6 +346,7 @@ export declare interface RoomProps {
306
346
  getImageAsset: GetImageAsset;
307
347
  getSoundAsset: GetSoundAsset;
308
348
  SoundHandler?: SoundPlayerComponent;
349
+ SpeechBubbleComponent?: FunctionComponent<SpeechBubbleProps>;
309
350
  }
310
351
 
311
352
  export declare const RoomRenderContext: Context< {
@@ -329,6 +370,15 @@ declare type SoundPlayerComponent = FunctionComponent<{
329
370
  getSoundAsset: GetSoundAsset;
330
371
  }>;
331
372
 
373
+ declare type SpeechBubbleProps = {
374
+ actorData: ActorData;
375
+ text: string;
376
+ fromTextBoxLeftToActor: number;
377
+ fontSize: number;
378
+ atLeftEdge: boolean;
379
+ atRightEdge: boolean;
380
+ };
381
+
332
382
  export declare const StoryBoardPlayer: React.FunctionComponent<Props_8>;
333
383
 
334
384
  export declare const StoryPageDisplay: FunctionComponent<Props_9>;
@@ -383,6 +433,8 @@ export declare const useCameraPoint: () => {
383
433
  cameraPoint?: XY;
384
434
  };
385
435
 
436
+ export declare const useConversationBranch: () => ConversationBranch | undefined;
437
+
386
438
  export declare const useLocalSavedGame: () => {
387
439
  saveGame: (fileName?: string) => void;
388
440
  loadGame: (fileName?: string) => void;
@@ -391,6 +443,8 @@ export declare const useLocalSavedGame: () => {
391
443
  restart: () => void;
392
444
  };
393
445
 
446
+ export declare const usePlayerInventory: () => ItemData[];
447
+
394
448
  export declare const useRoomRender: () => {
395
449
  roomData: {
396
450
  id: string;
@@ -471,6 +525,8 @@ export declare const useRoomRender: () => {
471
525
  orderSpeed: number;
472
526
  };
473
527
 
528
+ export declare const VerbRadioButton: () => JSX.Element;
529
+
474
530
  export declare const WalkableOrObstacle: ({ zone, markVertices, zoneType, zoneOptions }: Props_7) => JSX.Element;
475
531
 
476
532
  declare type XY = {