@rpgjs/server 4.2.2 → 5.0.0-alpha.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.
Files changed (219) hide show
  1. package/{lib → dist}/Gui/DialogGui.d.ts +1 -2
  2. package/{lib → dist}/Gui/Gui.d.ts +1 -2
  3. package/dist/Player/BattleManager.d.ts +22 -0
  4. package/dist/Player/ClassManager.d.ts +18 -0
  5. package/dist/Player/Event.d.ts +0 -0
  6. package/dist/Player/ItemManager.d.ts +17 -0
  7. package/dist/Player/MoveManager.d.ts +177 -0
  8. package/dist/Player/ParameterManager.d.ts +42 -0
  9. package/dist/Player/Player.d.ts +73 -0
  10. package/dist/Player/SkillManager.d.ts +23 -0
  11. package/dist/Player/StateManager.d.ts +39 -0
  12. package/{lib → dist}/RpgServer.d.ts +34 -17
  13. package/dist/RpgServerEngine.d.ts +5 -0
  14. package/dist/core/context.d.ts +2 -0
  15. package/dist/core/inject.d.ts +5 -0
  16. package/dist/core/setup.d.ts +6 -0
  17. package/dist/index.d.ts +9 -0
  18. package/dist/index.js +29673 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/module.d.ts +2 -0
  21. package/dist/rooms/lobby.d.ts +6 -0
  22. package/dist/rooms/map.d.ts +110 -0
  23. package/package.json +16 -38
  24. package/src/Gui/DialogGui.ts +3 -4
  25. package/src/Gui/Gui.ts +4 -6
  26. package/src/Player/BattleManager.ts +108 -99
  27. package/src/Player/ClassManager.ts +47 -46
  28. package/src/Player/ComponentManager.ts +26 -535
  29. package/src/Player/EffectManager.ts +44 -59
  30. package/src/Player/ElementManager.ts +70 -72
  31. package/src/Player/Event.ts +0 -0
  32. package/src/Player/GoldManager.ts +24 -6
  33. package/src/Player/GuiManager.ts +106 -97
  34. package/src/Player/ItemFixture.ts +22 -17
  35. package/src/Player/ItemManager.ts +234 -225
  36. package/src/Player/MoveManager.ts +1047 -457
  37. package/src/Player/ParameterManager.ts +59 -37
  38. package/src/Player/Player.ts +272 -1058
  39. package/src/Player/SkillManager.ts +146 -137
  40. package/src/Player/StateManager.ts +124 -98
  41. package/src/Player/VariableManager.ts +23 -3
  42. package/src/RpgServer.ts +38 -14
  43. package/src/RpgServerEngine.ts +7 -0
  44. package/src/core/context.ts +3 -0
  45. package/src/core/inject.ts +17 -0
  46. package/src/core/setup.ts +20 -0
  47. package/src/index.ts +9 -31
  48. package/src/module.ts +32 -0
  49. package/src/presets/index.ts +1 -3
  50. package/src/rooms/lobby.ts +24 -0
  51. package/src/rooms/map.ts +311 -0
  52. package/tsconfig.json +26 -23
  53. package/vite.config.ts +21 -0
  54. package/CHANGELOG.md +0 -163
  55. package/LICENSE +0 -19
  56. package/browser/manifest.json +0 -7
  57. package/browser/rpg.server.js +0 -22372
  58. package/browser/rpg.server.umd.cjs +0 -22403
  59. package/lib/Game/EventManager.d.ts +0 -54
  60. package/lib/Game/EventManager.js +0 -107
  61. package/lib/Game/EventManager.js.map +0 -1
  62. package/lib/Game/Map.d.ts +0 -191
  63. package/lib/Game/Map.js +0 -414
  64. package/lib/Game/Map.js.map +0 -1
  65. package/lib/Game/WorldMaps.d.ts +0 -17
  66. package/lib/Game/WorldMaps.js +0 -28
  67. package/lib/Game/WorldMaps.js.map +0 -1
  68. package/lib/Gui/DialogGui.js +0 -57
  69. package/lib/Gui/DialogGui.js.map +0 -1
  70. package/lib/Gui/Gui.js +0 -37
  71. package/lib/Gui/Gui.js.map +0 -1
  72. package/lib/Gui/MenuGui.js +0 -23
  73. package/lib/Gui/MenuGui.js.map +0 -1
  74. package/lib/Gui/NotificationGui.js +0 -8
  75. package/lib/Gui/NotificationGui.js.map +0 -1
  76. package/lib/Gui/ShopGui.js +0 -40
  77. package/lib/Gui/ShopGui.js.map +0 -1
  78. package/lib/Gui/index.js +0 -7
  79. package/lib/Gui/index.js.map +0 -1
  80. package/lib/Interfaces/Gui.d.ts +0 -4
  81. package/lib/Interfaces/Gui.js +0 -2
  82. package/lib/Interfaces/Gui.js.map +0 -1
  83. package/lib/Interfaces/StateStore.d.ts +0 -5
  84. package/lib/Interfaces/StateStore.js +0 -2
  85. package/lib/Interfaces/StateStore.js.map +0 -1
  86. package/lib/MatchMaker.d.ts +0 -24
  87. package/lib/MatchMaker.js +0 -42
  88. package/lib/MatchMaker.js.map +0 -1
  89. package/lib/Monitor/index.d.ts +0 -17
  90. package/lib/Monitor/index.js +0 -72
  91. package/lib/Monitor/index.js.map +0 -1
  92. package/lib/Player/BattleManager.d.ts +0 -36
  93. package/lib/Player/BattleManager.js +0 -101
  94. package/lib/Player/BattleManager.js.map +0 -1
  95. package/lib/Player/ClassManager.d.ts +0 -47
  96. package/lib/Player/ClassManager.js +0 -65
  97. package/lib/Player/ClassManager.js.map +0 -1
  98. package/lib/Player/ComponentManager.d.ts +0 -397
  99. package/lib/Player/ComponentManager.js +0 -505
  100. package/lib/Player/ComponentManager.js.map +0 -1
  101. package/lib/Player/EffectManager.d.ts +0 -46
  102. package/lib/Player/EffectManager.js +0 -75
  103. package/lib/Player/EffectManager.js.map +0 -1
  104. package/lib/Player/ElementManager.d.ts +0 -108
  105. package/lib/Player/ElementManager.js +0 -120
  106. package/lib/Player/ElementManager.js.map +0 -1
  107. package/lib/Player/GoldManager.d.ts +0 -17
  108. package/lib/Player/GoldManager.js +0 -27
  109. package/lib/Player/GoldManager.js.map +0 -1
  110. package/lib/Player/GuiManager.d.ts +0 -247
  111. package/lib/Player/GuiManager.js +0 -291
  112. package/lib/Player/GuiManager.js.map +0 -1
  113. package/lib/Player/ItemFixture.d.ts +0 -7
  114. package/lib/Player/ItemFixture.js +0 -19
  115. package/lib/Player/ItemFixture.js.map +0 -1
  116. package/lib/Player/ItemManager.d.ts +0 -331
  117. package/lib/Player/ItemManager.js +0 -475
  118. package/lib/Player/ItemManager.js.map +0 -1
  119. package/lib/Player/MoveManager.d.ts +0 -333
  120. package/lib/Player/MoveManager.js +0 -450
  121. package/lib/Player/MoveManager.js.map +0 -1
  122. package/lib/Player/ParameterManager.d.ts +0 -316
  123. package/lib/Player/ParameterManager.js +0 -408
  124. package/lib/Player/ParameterManager.js.map +0 -1
  125. package/lib/Player/Player.d.ts +0 -828
  126. package/lib/Player/Player.js +0 -927
  127. package/lib/Player/Player.js.map +0 -1
  128. package/lib/Player/SkillManager.d.ts +0 -163
  129. package/lib/Player/SkillManager.js +0 -223
  130. package/lib/Player/SkillManager.js.map +0 -1
  131. package/lib/Player/StateManager.d.ts +0 -185
  132. package/lib/Player/StateManager.js +0 -228
  133. package/lib/Player/StateManager.js.map +0 -1
  134. package/lib/Player/VariableManager.d.ts +0 -46
  135. package/lib/Player/VariableManager.js +0 -52
  136. package/lib/Player/VariableManager.js.map +0 -1
  137. package/lib/Query.d.ts +0 -127
  138. package/lib/Query.js +0 -159
  139. package/lib/Query.js.map +0 -1
  140. package/lib/RpgServer.js +0 -2
  141. package/lib/RpgServer.js.map +0 -1
  142. package/lib/Scenes/Map.d.ts +0 -136
  143. package/lib/Scenes/Map.js +0 -273
  144. package/lib/Scenes/Map.js.map +0 -1
  145. package/lib/decorators/event.d.ts +0 -43
  146. package/lib/decorators/event.js +0 -13
  147. package/lib/decorators/event.js.map +0 -1
  148. package/lib/decorators/map.d.ts +0 -178
  149. package/lib/decorators/map.js +0 -43
  150. package/lib/decorators/map.js.map +0 -1
  151. package/lib/entry-point.d.ts +0 -34
  152. package/lib/entry-point.js +0 -70
  153. package/lib/entry-point.js.map +0 -1
  154. package/lib/express/api.d.ts +0 -3
  155. package/lib/express/api.js +0 -105
  156. package/lib/express/api.js.map +0 -1
  157. package/lib/express/errors/NotAuthorized.d.ts +0 -4
  158. package/lib/express/errors/NotAuthorized.js +0 -7
  159. package/lib/express/errors/NotAuthorized.js.map +0 -1
  160. package/lib/express/errors/NotFound.d.ts +0 -4
  161. package/lib/express/errors/NotFound.js +0 -7
  162. package/lib/express/errors/NotFound.js.map +0 -1
  163. package/lib/express/server.d.ts +0 -16
  164. package/lib/express/server.js +0 -65
  165. package/lib/express/server.js.map +0 -1
  166. package/lib/index.d.ts +0 -20
  167. package/lib/index.js +0 -19
  168. package/lib/index.js.map +0 -1
  169. package/lib/inject.d.ts +0 -22
  170. package/lib/inject.js +0 -29
  171. package/lib/inject.js.map +0 -1
  172. package/lib/logs/index.js +0 -6
  173. package/lib/logs/index.js.map +0 -1
  174. package/lib/logs/item.js +0 -34
  175. package/lib/logs/item.js.map +0 -1
  176. package/lib/logs/log.js +0 -7
  177. package/lib/logs/log.js.map +0 -1
  178. package/lib/logs/skill.js +0 -19
  179. package/lib/logs/skill.js.map +0 -1
  180. package/lib/logs/state.js +0 -13
  181. package/lib/logs/state.js.map +0 -1
  182. package/lib/models/Item.d.ts +0 -10
  183. package/lib/models/Item.js +0 -2
  184. package/lib/models/Item.js.map +0 -1
  185. package/lib/presets/index.js +0 -65
  186. package/lib/presets/index.js.map +0 -1
  187. package/lib/server.d.ts +0 -137
  188. package/lib/server.js +0 -443
  189. package/lib/server.js.map +0 -1
  190. package/rpg.toml +0 -14
  191. package/src/Game/EventManager.ts +0 -125
  192. package/src/Game/Map.ts +0 -495
  193. package/src/Game/WorldMaps.ts +0 -45
  194. package/src/Interfaces/Gui.ts +0 -4
  195. package/src/Interfaces/StateStore.ts +0 -5
  196. package/src/MatchMaker.ts +0 -65
  197. package/src/Monitor/index.ts +0 -78
  198. package/src/Query.ts +0 -172
  199. package/src/Scenes/Map.ts +0 -310
  200. package/src/decorators/event.ts +0 -58
  201. package/src/decorators/map.ts +0 -226
  202. package/src/entry-point.ts +0 -111
  203. package/src/express/api.ts +0 -118
  204. package/src/express/errors/NotAuthorized.ts +0 -6
  205. package/src/express/errors/NotFound.ts +0 -6
  206. package/src/express/server.ts +0 -87
  207. package/src/inject.ts +0 -33
  208. package/src/models/Item.ts +0 -11
  209. package/src/server.ts +0 -459
  210. /package/{lib → dist}/Gui/MenuGui.d.ts +0 -0
  211. /package/{lib → dist}/Gui/NotificationGui.d.ts +0 -0
  212. /package/{lib → dist}/Gui/ShopGui.d.ts +0 -0
  213. /package/{lib → dist}/Gui/index.d.ts +0 -0
  214. /package/{lib → dist}/logs/index.d.ts +0 -0
  215. /package/{lib → dist}/logs/item.d.ts +0 -0
  216. /package/{lib → dist}/logs/log.d.ts +0 -0
  217. /package/{lib → dist}/logs/skill.d.ts +0 -0
  218. /package/{lib → dist}/logs/state.d.ts +0 -0
  219. /package/{lib → dist}/presets/index.d.ts +0 -0
@@ -1,397 +0,0 @@
1
- import { BarComponentObject, ComponentObject, LayoutObject, LayoutOptions, TextComponentObject, LayoutPositionEnum, ShapeComponentObject, ImageComponentObject, TileComponentObject, DebugComponentObject, TextComponentStyleObject } from '@rpgjs/types';
2
- export declare const Components: {
3
- /**
4
- * Displays a bar
5
- *
6
- * Example:
7
- *
8
- * ```ts
9
- * import { Components } from '@rpgjs/server'
10
- * Components.bar('hp', 'param.maxHp', {
11
- * bgColor: '#ab0606'
12
- * })
13
- * ```
14
- *
15
- * For text, you can use the following variables:
16
- * - {$current} current value
17
- * - {$max} maximum value
18
- * - {$percent} percentage
19
- *
20
- * Example:
21
- *
22
- * ```ts
23
- * import { Components } from '@rpgjs/server'
24
- * Components.bar('hp', 'param.maxHp', {
25
- * bgColor: '#ab0606'
26
- * }, 'HP: {$current}/{$max}')
27
- * ```
28
- *
29
- * and you can also use the variables of player:
30
- *
31
- * ```ts
32
- * import { Components } from '@rpgjs/server'
33
- * Components.bar('hp', 'param.maxHp', {
34
- * bgColor: '#ab0606'
35
- * }, 'HP: {$current}/{$max} - {name}') // HP: 100/100 - John
36
- * ```
37
- *
38
- * @title Bar Component
39
- * @param {string} current Parameter that corresponds to the current value
40
- * @param {string} max Parameter that corresponds to the maximum value
41
- * @param {object} [style] style
42
- * @param {string} [style.bgColor] background color. Hexadecimal format.
43
- * @param {string} [style.fillColor] fill color. Hexadecimal format.
44
- * @param {string} [style.borderColor] border color. Hexadecimal format.
45
- * @param {number} [style.borderWidth] border width
46
- * @param {number} [style.height] height
47
- * @param {number} [style.width] width
48
- * @param {number} [style.borderRadius] border radius
49
- * @param {number} [style.opacity] opacity
50
- * @param {string | null} [text] text above bar. if null, no text will be displayed. You can use the variables
51
- * @returns {BarComponentObject}
52
- * @memberof Components
53
- * @since 3.3.0
54
- */
55
- bar: (current: string, max: string, style?: BarComponentObject['value']['style'], text?: string | null) => BarComponentObject;
56
- /**
57
- * Displays a life bar
58
- *
59
- * @title HP Bar Component
60
- * @param {object} [style] style. See bar style (Components.bar())
61
- * @param {string | null} [text] test above bar (Components.bar())
62
- * @returns {BarComponentObject}
63
- * @memberof Components
64
- * @since 3.3.0
65
- */
66
- hpBar(style?: BarComponentObject['value']['style'], text?: string | null): BarComponentObject;
67
- /**
68
- * Displays a SP bar
69
- *
70
- * @title SP Bar Component
71
- * @param {object} [style] style. See bar style (Components.bar())
72
- * @param {string | null} [text] test above bar (Components.bar())
73
- * @returns {BarComponentObject}
74
- * @memberof Components
75
- * @since 3.3.0
76
- */
77
- spBar(style?: BarComponentObject['value']['style'], text?: string | null): BarComponentObject;
78
- /**
79
- * Put on the text. You can read the content of a variable with {} format (see example below)
80
- *
81
- * Example:
82
- *
83
- * ```ts
84
- * import { Components } from '@rpgjs/server'
85
- * Components.text('Hello World')
86
- * ```
87
- *
88
- * Example with variable:
89
- *
90
- * ```ts
91
- * import { Components } from '@rpgjs/server'
92
- * Components.text('{name}')
93
- * ```
94
- *
95
- * Other example with position:
96
- *
97
- * ```ts
98
- * import { Components } from '@rpgjs/server'
99
- * Components.text('X: {position.x} Y: {position.y}')
100
- * ```
101
- *
102
- * With style:
103
- *
104
- * ```ts
105
- * import { Components } from '@rpgjs/server'
106
- * Components.text('Hello World', {
107
- * fill: '#ffffff',
108
- * fontSize: 20,
109
- * fontFamily: 'Arial',
110
- * stroke: '#000000',
111
- * fontStyle: 'italic',
112
- * fontWeight: 'bold'
113
- * })
114
- * ```
115
- *
116
- * @title Text Component
117
- * @param {string} value source
118
- * @param {object} [style] style
119
- * @param {string} [style.fill] color. Hexadecimal format.
120
- * @param {number} [style.fontSize] font size
121
- * @param {string} [style.fontFamily] font family
122
- * @param {string} [style.stroke] stroke color. Hexadecimal format.
123
- * @param {'normal' | 'italic' | 'oblique'} [style.fontStyle] font style
124
- * @param {'normal' | 'bold' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'} [style.fontWeight] font weight
125
- * @param {number} [style.opacity] opacity. Between 0 and 1
126
- * @param {boolean} [style.wordWrap] word wrap
127
- * @param {'left' | 'center' | 'right' | 'justify'} [style.align] align
128
- * @returns {TextComponentObject}
129
- * @memberof Components
130
- * @since 3.3.0
131
- */
132
- text(value: string, style?: TextComponentStyleObject): TextComponentObject;
133
- /**
134
- * Add a shape
135
- *
136
- * Example:
137
- *
138
- * ```ts
139
- * import { Components } from '@rpgjs/server'
140
- * Components.shape({
141
- * fill: '#ffffff',
142
- * type: 'circle',
143
- * radius: 10
144
- * })
145
- * ```
146
- *
147
- * You can use parameters:
148
- *
149
- * ```ts
150
- * import { Components } from '@rpgjs/server'
151
- * Components.shape({
152
- * fill: '#ffffff',
153
- * type: 'circle',
154
- * radius: 'hp'
155
- * })
156
- * ```
157
- *
158
- * Here, the radius will be the same as the hp value
159
- *
160
- * @title Shape Component
161
- * @param {object} value
162
- * @param {string} value.fill color. Hexadecimal format.
163
- * @param {number | string} [value.opacity] opacity. Between 0 and 1
164
- * @param {string} value.type type of shape. Can be 'circle' or 'rectangle', 'ellipse' or 'polygon', 'line' or 'rounded-rectangle'
165
- * @param {number | string} [value.radius] if type is circle, radius of the circle
166
- * @param {number | string} [value.width] if type is rectangle or ellipse, width of the rectangle
167
- * @param {number | string} [value.height] if type is rectangle or ellipse, height of the rectangle
168
- * @param {number | string} [value.x1] if type is line, x1 position of the line
169
- * @param {number | string} [value.y1] if type is line, y1 position of the line
170
- * @param {number | string} [value.x2] if type is line, x2 position of the line
171
- * @param {number | string} [value.y2] if type is line, y2 position of the line
172
- * @param {number[]} [value.points] if type is polygon, points of the polygon
173
- * @param {object} [value.line] border style
174
- * @param {string} [value.line.color] border color. Hexadecimal format.
175
- * @param {number} [value.line.width] border width
176
- * @param {number} [value.line.alpha] border opacity. Between 0 and 1
177
- * @returns {ShapeComponentObject}
178
- * @memberof Components
179
- * @since 3.3.0
180
- */
181
- shape(value: ShapeComponentObject['value']): ShapeComponentObject;
182
- /**
183
- * Put the link to an image or the identifier of an image (if the spritesheet exists)
184
- *
185
- * Example:
186
- *
187
- * ```ts
188
- * import { Components } from '@rpgjs/server'
189
- * Components.image('mygraphic.png')
190
- * ```
191
- *
192
- * @title Image Component
193
- * @param {string} value source
194
- * @returns {ImageComponentObject}
195
- * @memberof Components
196
- * @since 3.3.0
197
- */
198
- image(value: string): ImageComponentObject;
199
- /**
200
- * Indicates the tile ID
201
- *
202
- * Example:
203
- *
204
- * ```ts
205
- * import { Components } from '@rpgjs/server'
206
- * Components.tile(3)
207
- * ```
208
- *
209
- * @title Tile Component
210
- * @param {number} value tile ID
211
- * @returns {TileComponentObject}
212
- * @memberof Components
213
- * @since 3.3.0
214
- */
215
- tile(value: number): TileComponentObject;
216
- debug(): DebugComponentObject;
217
- };
218
- export declare class ComponentManager {
219
- layout: LayoutObject<any>;
220
- /**
221
- * Give the spritesheet identifier
222
- *
223
- * Since version 3.0.0-rc, you can define several graphic elements. If you put a number, it represents the tile ID in the tileset
224
- *
225
- * Example 1:
226
- * ```ts
227
- * player.setGraphic(['body', 'shield'])
228
- * ```
229
- *
230
- * Example 2:
231
- * ```ts
232
- * player.setGraphic(3) // Use tile #3
233
- * ```
234
- *
235
- * > You must, on the client side, create the spritesheet in question. Guide: [Create Sprite](/guide/create-sprite.html)
236
- *
237
- * @title Set Graphic
238
- * @method player.setGraphic(graphic)
239
- * @param {string | number | (string | number)[]} graphic
240
- * @returns {void}
241
- * @memberof ComponentManager
242
- */
243
- setGraphic(graphic: string | number | (string | number)[]): void;
244
- /**
245
- * Delete components
246
- *
247
- * @title Remove Components
248
- * @param {string} position Position of the components. Can be: `top`, `center`, `bottom`, `left`, `right`
249
- * @memberof ComponentManager
250
- * @since 3.3.0
251
- */
252
- removeComponents(position: LayoutPositionEnum): void;
253
- /**
254
- * Delete components by id.
255
- *
256
- * @title Remove Component By Id
257
- * @param {string} position Position of the components. Can be: `top`, `center`, `bottom`, `left`, `right`
258
- * @param {string} id Id of the component
259
- * @since 3.3.0
260
- */
261
- removeComponentById(position: LayoutPositionEnum, id: string): void;
262
- /**
263
- * Merges components with existing components
264
- *
265
- * For use layout and options, see [setComponentsTop](/api/player.html#setcomponentstop)
266
- *
267
- * @title Merge Components
268
- * @param {string} position Position of the components. Can be: `top`, `center`, `bottom`, `left`, `right`
269
- * @param {Object} layout
270
- * @param {Object} options
271
- * @memberof ComponentManager
272
- * @since 3.3.0
273
- */
274
- mergeComponent<T = any>(position: LayoutPositionEnum, layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
275
- private setComponents;
276
- /**
277
- * Add components to the center of the graphic.
278
- *
279
- * View [setComponentsTop](/api/player.html#setcomponentstop) for more information
280
- *
281
- * > Be careful, because if you assign, it deletes the graphics and if the lines are superimposed (unlike the other locations)
282
- *
283
- * @title Set Components Center
284
- * @method player.setComponentsCenter(layout,options)
285
- * @param {Object} layout
286
- * @param {Object} options
287
- * @memberof ComponentManager
288
- * @since 3.3.0
289
- */
290
- setComponentsCenter<T = any>(layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
291
- /**
292
- * Add components to the top of the graphic. e.g. text, life bar etc. The block will be centred
293
- * The first array corresponds to the rows, and the nested table to the array in the row
294
- *
295
- * Example:
296
- *
297
- * ```ts
298
- * import { Components } from '@rpgjs/server'
299
- *
300
- * player.setComponentsTop([
301
- * [Components.text('Hello World')],
302
- * [Components.hpBar()]
303
- * ]) // 2 lines with 1 component each
304
- * ```
305
- *
306
- * or
307
- *
308
- * ```ts
309
- * import { Components } from '@rpgjs/server'
310
- *
311
- * player.setComponentsTop([
312
- * [Components.text('Hello World'), Components.hpBar()]
313
- * ]) // 1 line with 2 components
314
- * ```
315
- *
316
- * You can be faster if you only have lines
317
- *
318
- * ```ts
319
- * player.setComponentsTop([
320
- * Components.text('Hello World'),
321
- * Components.hpBar()
322
- * ]) // 2 lines with 1 component each
323
- * ```
324
- *
325
- * or one component:
326
- *
327
- * ```ts
328
- * player.setComponentsTop(Components.text('Hello World')) // 1 line with 1 component
329
- * ```
330
- *
331
- * You can add options to manage the style
332
- *
333
- * ```ts
334
- * player.setComponentsTop([
335
- * Components.text('Hello World'),
336
- * Components.hpBar()
337
- * ], {
338
- * width: 100,
339
- * height: 20,
340
- * marginTop: 10,
341
- * })
342
- * ```
343
- *
344
- * @title Set Components Top
345
- * @method player.setComponentsTop(layout,options)
346
- * @param {ComponentObject[][] | ComponentObject[] | ComponentObject} layout Components
347
- * @param {Object} [options = {}] Options
348
- * @param {number} [options.width] Width of the block
349
- * @param {number} [options.height = 20] Height of the block
350
- * @param {number} [options.marginTop] Margin top
351
- * @param {number} [options.marginBottom] Margin bottom
352
- * @param {number} [options.marginLeft] Margin left
353
- * @param {number} [options.marginRight] Margin right
354
- * @memberof ComponentManager
355
- * @since 3.3.0
356
- */
357
- setComponentsTop<T = any>(layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
358
- /**
359
- * Add components to the bottom of the graphic.
360
- *
361
- * View [setComponentsTop](/api/player.html#setcomponentstop) for more information
362
- *
363
- * @title Set Components Bottom
364
- * @method player.setComponentsBottom(layout,options)
365
- * @param {Object} layout
366
- * @param {Object} options
367
- * @memberof ComponentManager
368
- * @since 3.3.0
369
- */
370
- setComponentsBottom<T = any>(layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
371
- /**
372
- * Add components to the left of the graphic.
373
- *
374
- * View [setComponentsTop](/api/player.html#setcomponentstop) for more information
375
- *
376
- * @title Set Components Left
377
- * @method player.setComponentsLeft(layout,options)
378
- * @param {Object} layout
379
- * @param {Object} options
380
- * @memberof ComponentManager
381
- * @since 3.3.0
382
- */
383
- setComponentsLeft<T = any>(layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
384
- /**
385
- * Add components to the right of the graphic.
386
- *
387
- * View [setComponentsTop](/api/player.html#setcomponentstop) for more information
388
- *
389
- * @title Set Components Right
390
- * @method player.setComponentsRight(layout,options)
391
- * @param {Object} layout
392
- * @param {Object} options
393
- * @memberof ComponentManager
394
- * @since 3.3.0
395
- */
396
- setComponentsRight<T = any>(layout: ComponentObject<T>[][] | ComponentObject<T>[] | ComponentObject<T>, options?: LayoutOptions): void;
397
- }