@rpgjs/client 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 (321) hide show
  1. package/dist/Game/EffectManager.d.ts +5 -0
  2. package/dist/Game/Event.d.ts +4 -0
  3. package/dist/Game/Map.d.ts +7 -0
  4. package/dist/Game/Player.d.ts +4 -0
  5. package/dist/Gui/Gui.d.ts +23 -0
  6. package/{lib → dist}/RpgClient.d.ts +9 -6
  7. package/dist/RpgClientEngine.d.ts +43 -0
  8. package/dist/components/effects/index.d.ts +4 -0
  9. package/dist/components/gui/index.d.ts +3 -0
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/core/inject.d.ts +5 -0
  12. package/dist/core/setup.d.ts +6 -0
  13. package/dist/index.d.ts +13 -0
  14. package/dist/index.js +13 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/index10.js +8 -0
  17. package/dist/index10.js.map +1 -0
  18. package/dist/index11.js +10 -0
  19. package/dist/index11.js.map +1 -0
  20. package/dist/index12.js +8 -0
  21. package/dist/index12.js.map +1 -0
  22. package/dist/index13.js +17 -0
  23. package/dist/index13.js.map +1 -0
  24. package/dist/index14.js +50 -0
  25. package/dist/index14.js.map +1 -0
  26. package/dist/index15.js +191 -0
  27. package/dist/index15.js.map +1 -0
  28. package/dist/index16.js +9 -0
  29. package/dist/index16.js.map +1 -0
  30. package/dist/index17.js +387 -0
  31. package/dist/index17.js.map +1 -0
  32. package/dist/index18.js +31 -0
  33. package/dist/index18.js.map +1 -0
  34. package/dist/index19.js +24 -0
  35. package/dist/index19.js.map +1 -0
  36. package/dist/index2.js +112 -0
  37. package/dist/index2.js.map +1 -0
  38. package/dist/index20.js +2421 -0
  39. package/dist/index20.js.map +1 -0
  40. package/dist/index21.js +114 -0
  41. package/dist/index21.js.map +1 -0
  42. package/dist/index22.js +109 -0
  43. package/dist/index22.js.map +1 -0
  44. package/dist/index23.js +71 -0
  45. package/dist/index23.js.map +1 -0
  46. package/dist/index24.js +21 -0
  47. package/dist/index24.js.map +1 -0
  48. package/dist/index25.js +41 -0
  49. package/dist/index25.js.map +1 -0
  50. package/dist/index26.js +5 -0
  51. package/dist/index26.js.map +1 -0
  52. package/dist/index27.js +322 -0
  53. package/dist/index27.js.map +1 -0
  54. package/dist/index28.js +25 -0
  55. package/dist/index28.js.map +1 -0
  56. package/dist/index29.js +11 -0
  57. package/dist/index29.js.map +1 -0
  58. package/dist/index3.js +87 -0
  59. package/dist/index3.js.map +1 -0
  60. package/dist/index30.js +11 -0
  61. package/dist/index30.js.map +1 -0
  62. package/dist/index31.js +174 -0
  63. package/dist/index31.js.map +1 -0
  64. package/dist/index32.js +501 -0
  65. package/dist/index32.js.map +1 -0
  66. package/dist/index33.js +12 -0
  67. package/dist/index33.js.map +1 -0
  68. package/dist/index34.js +4403 -0
  69. package/dist/index34.js.map +1 -0
  70. package/dist/index35.js +91 -0
  71. package/dist/index35.js.map +1 -0
  72. package/dist/index36.js +61 -0
  73. package/dist/index36.js.map +1 -0
  74. package/dist/index37.js +20 -0
  75. package/dist/index37.js.map +1 -0
  76. package/dist/index38.js +20 -0
  77. package/dist/index38.js.map +1 -0
  78. package/dist/index4.js +54 -0
  79. package/dist/index4.js.map +1 -0
  80. package/dist/index5.js +15 -0
  81. package/dist/index5.js.map +1 -0
  82. package/dist/index6.js +17 -0
  83. package/dist/index6.js.map +1 -0
  84. package/dist/index7.js +31 -0
  85. package/dist/index7.js.map +1 -0
  86. package/dist/index8.js +90 -0
  87. package/dist/index8.js.map +1 -0
  88. package/dist/index9.js +76 -0
  89. package/dist/index9.js.map +1 -0
  90. package/dist/module.d.ts +14 -0
  91. package/dist/presets/index.d.ts +22 -0
  92. package/{lib/Presets/AnimationSpritesheet.d.ts → dist/presets/rmspritesheet.d.ts} +6 -2
  93. package/dist/services/AbstractSocket.d.ts +15 -0
  94. package/dist/services/loadMap.d.ts +14 -0
  95. package/dist/services/mmorpg.d.ts +32 -0
  96. package/dist/services/standalone.d.ts +34 -0
  97. package/package.json +25 -42
  98. package/src/Game/EffectManager.ts +20 -0
  99. package/src/Game/Event.ts +5 -0
  100. package/src/Game/Map.ts +10 -0
  101. package/src/Game/Object.ts +16 -0
  102. package/src/Game/Player.ts +5 -0
  103. package/src/Gui/Gui.ts +80 -534
  104. package/src/RpgClient.ts +9 -5
  105. package/src/RpgClientEngine.ts +135 -815
  106. package/src/components/character.ce +104 -0
  107. package/src/components/effects/animation.ce +19 -0
  108. package/src/components/effects/hit.ce +87 -0
  109. package/src/components/effects/index.ts +7 -0
  110. package/src/components/gui/dialogbox/index.ce +194 -0
  111. package/src/components/gui/dialogbox/itemMenu.ce +23 -0
  112. package/src/components/gui/dialogbox/selection.ce +67 -0
  113. package/src/components/gui/index.ts +5 -0
  114. package/src/components/index.ts +3 -0
  115. package/src/components/scenes/canvas.ce +51 -0
  116. package/src/components/scenes/draw-map.ce +56 -0
  117. package/src/components/scenes/element-map.ce +23 -0
  118. package/src/components/scenes/event-layer.ce +20 -0
  119. package/src/core/inject.ts +17 -0
  120. package/src/core/setup.ts +18 -0
  121. package/src/index.ts +13 -29
  122. package/src/module.ts +93 -0
  123. package/src/presets/index.ts +5 -0
  124. package/src/{Presets/AnimationSpritesheet.ts → presets/rmspritesheet.ts} +4 -5
  125. package/src/services/AbstractSocket.ts +14 -0
  126. package/src/services/loadMap.ts +33 -0
  127. package/src/services/mmorpg.ts +64 -0
  128. package/src/services/standalone.ts +101 -0
  129. package/src/types/canvas-engine.d.ts +26 -0
  130. package/tsconfig.json +8 -3
  131. package/vite.config.ts +34 -0
  132. package/CHANGELOG.md +0 -177
  133. package/LICENSE +0 -19
  134. package/browser/React-f6f9b1de.js +0 -157
  135. package/browser/index-e74a289f.js +0 -44225
  136. package/browser/manifest.json +0 -21
  137. package/browser/rpg.client.js +0 -40
  138. package/browser/rpg.client.umd.cjs +0 -44414
  139. package/lib/Components/AbstractComponent.d.ts +0 -32
  140. package/lib/Components/AbstractComponent.js +0 -93
  141. package/lib/Components/AbstractComponent.js.map +0 -1
  142. package/lib/Components/BarComponent.d.ts +0 -21
  143. package/lib/Components/BarComponent.js +0 -169
  144. package/lib/Components/BarComponent.js.map +0 -1
  145. package/lib/Components/Component.d.ts +0 -124
  146. package/lib/Components/Component.js +0 -425
  147. package/lib/Components/Component.js.map +0 -1
  148. package/lib/Components/DebugComponent.d.ts +0 -11
  149. package/lib/Components/DebugComponent.js +0 -32
  150. package/lib/Components/DebugComponent.js.map +0 -1
  151. package/lib/Components/ImageComponent.d.ts +0 -11
  152. package/lib/Components/ImageComponent.js +0 -30
  153. package/lib/Components/ImageComponent.js.map +0 -1
  154. package/lib/Components/ShapeComponent.d.ts +0 -11
  155. package/lib/Components/ShapeComponent.js +0 -57
  156. package/lib/Components/ShapeComponent.js.map +0 -1
  157. package/lib/Components/TextComponent.d.ts +0 -11
  158. package/lib/Components/TextComponent.js +0 -35
  159. package/lib/Components/TextComponent.js.map +0 -1
  160. package/lib/Components/TileComponent.d.ts +0 -10
  161. package/lib/Components/TileComponent.js +0 -40
  162. package/lib/Components/TileComponent.js.map +0 -1
  163. package/lib/Effects/Animation.d.ts +0 -55
  164. package/lib/Effects/Animation.js +0 -233
  165. package/lib/Effects/Animation.js.map +0 -1
  166. package/lib/Effects/AnimationCharacter.d.ts +0 -7
  167. package/lib/Effects/AnimationCharacter.js +0 -9
  168. package/lib/Effects/AnimationCharacter.js.map +0 -1
  169. package/lib/Effects/Spinner.d.ts +0 -7
  170. package/lib/Effects/Spinner.js +0 -18
  171. package/lib/Effects/Spinner.js.map +0 -1
  172. package/lib/Effects/Timeline.d.ts +0 -151
  173. package/lib/Effects/Timeline.js +0 -369
  174. package/lib/Effects/Timeline.js.map +0 -1
  175. package/lib/Effects/TransitionScene.d.ts +0 -18
  176. package/lib/Effects/TransitionScene.js +0 -50
  177. package/lib/Effects/TransitionScene.js.map +0 -1
  178. package/lib/GameEngine.d.ts +0 -68
  179. package/lib/GameEngine.js +0 -254
  180. package/lib/GameEngine.js.map +0 -1
  181. package/lib/Gui/Gui.d.ts +0 -110
  182. package/lib/Gui/Gui.js +0 -490
  183. package/lib/Gui/Gui.js.map +0 -1
  184. package/lib/Gui/React.d.ts +0 -15
  185. package/lib/Gui/React.js +0 -113
  186. package/lib/Gui/React.js.map +0 -1
  187. package/lib/Gui/Vue.d.ts +0 -13
  188. package/lib/Gui/Vue.js +0 -114
  189. package/lib/Gui/Vue.js.map +0 -1
  190. package/lib/Interfaces/Character.d.ts +0 -6
  191. package/lib/Interfaces/Character.js +0 -2
  192. package/lib/Interfaces/Character.js.map +0 -1
  193. package/lib/Interfaces/Scene.d.ts +0 -10
  194. package/lib/Interfaces/Scene.js +0 -2
  195. package/lib/Interfaces/Scene.js.map +0 -1
  196. package/lib/KeyboardControls.d.ts +0 -367
  197. package/lib/KeyboardControls.js +0 -714
  198. package/lib/KeyboardControls.js.map +0 -1
  199. package/lib/Logger.d.ts +0 -1
  200. package/lib/Logger.js +0 -4
  201. package/lib/Logger.js.map +0 -1
  202. package/lib/Presets/AnimationSpritesheet.js +0 -39
  203. package/lib/Presets/AnimationSpritesheet.js.map +0 -1
  204. package/lib/Presets/Scene.d.ts +0 -3
  205. package/lib/Presets/Scene.js +0 -5
  206. package/lib/Presets/Scene.js.map +0 -1
  207. package/lib/Renderer.d.ts +0 -62
  208. package/lib/Renderer.js +0 -300
  209. package/lib/Renderer.js.map +0 -1
  210. package/lib/Resources.d.ts +0 -22
  211. package/lib/Resources.js +0 -38
  212. package/lib/Resources.js.map +0 -1
  213. package/lib/RpgClient.js +0 -2
  214. package/lib/RpgClient.js.map +0 -1
  215. package/lib/RpgClientEngine.d.ts +0 -257
  216. package/lib/RpgClientEngine.js +0 -674
  217. package/lib/RpgClientEngine.js.map +0 -1
  218. package/lib/Scene/EventLayer.d.ts +0 -4
  219. package/lib/Scene/EventLayer.js +0 -8
  220. package/lib/Scene/EventLayer.js.map +0 -1
  221. package/lib/Scene/Map.d.ts +0 -109
  222. package/lib/Scene/Map.js +0 -319
  223. package/lib/Scene/Map.js.map +0 -1
  224. package/lib/Scene/Scene.d.ts +0 -184
  225. package/lib/Scene/Scene.js +0 -250
  226. package/lib/Scene/Scene.js.map +0 -1
  227. package/lib/Scene/SceneData.d.ts +0 -4
  228. package/lib/Scene/SceneData.js +0 -8
  229. package/lib/Scene/SceneData.js.map +0 -1
  230. package/lib/Sound/RpgSound.d.ts +0 -11
  231. package/lib/Sound/RpgSound.js +0 -46
  232. package/lib/Sound/RpgSound.js.map +0 -1
  233. package/lib/Sound/Sound.d.ts +0 -78
  234. package/lib/Sound/Sound.js +0 -12
  235. package/lib/Sound/Sound.js.map +0 -1
  236. package/lib/Sound/Sounds.d.ts +0 -2
  237. package/lib/Sound/Sounds.js +0 -6
  238. package/lib/Sound/Sounds.js.map +0 -1
  239. package/lib/Sprite/Character.d.ts +0 -18
  240. package/lib/Sprite/Character.js +0 -131
  241. package/lib/Sprite/Character.js.map +0 -1
  242. package/lib/Sprite/Player.d.ts +0 -3
  243. package/lib/Sprite/Player.js +0 -4
  244. package/lib/Sprite/Player.js.map +0 -1
  245. package/lib/Sprite/Spritesheet.d.ts +0 -365
  246. package/lib/Sprite/Spritesheet.js +0 -13
  247. package/lib/Sprite/Spritesheet.js.map +0 -1
  248. package/lib/Sprite/Spritesheets.d.ts +0 -3
  249. package/lib/Sprite/Spritesheets.js +0 -6
  250. package/lib/Sprite/Spritesheets.js.map +0 -1
  251. package/lib/Tilemap/CommonLayer.d.ts +0 -10
  252. package/lib/Tilemap/CommonLayer.js +0 -17
  253. package/lib/Tilemap/CommonLayer.js.map +0 -1
  254. package/lib/Tilemap/ImageLayer.d.ts +0 -4
  255. package/lib/Tilemap/ImageLayer.js +0 -16
  256. package/lib/Tilemap/ImageLayer.js.map +0 -1
  257. package/lib/Tilemap/Tile.d.ts +0 -21
  258. package/lib/Tilemap/Tile.js +0 -67
  259. package/lib/Tilemap/Tile.js.map +0 -1
  260. package/lib/Tilemap/TileLayer.d.ts +0 -13
  261. package/lib/Tilemap/TileLayer.js +0 -122
  262. package/lib/Tilemap/TileLayer.js.map +0 -1
  263. package/lib/Tilemap/TileSet.d.ts +0 -7
  264. package/lib/Tilemap/TileSet.js +0 -24
  265. package/lib/Tilemap/TileSet.js.map +0 -1
  266. package/lib/Tilemap/index.d.ts +0 -28
  267. package/lib/Tilemap/index.js +0 -151
  268. package/lib/Tilemap/index.js.map +0 -1
  269. package/lib/clientEntryPoint.d.ts +0 -89
  270. package/lib/clientEntryPoint.js +0 -48
  271. package/lib/clientEntryPoint.js.map +0 -1
  272. package/lib/index.d.ts +0 -26
  273. package/lib/index.js +0 -27
  274. package/lib/index.js.map +0 -1
  275. package/lib/inject.d.ts +0 -23
  276. package/lib/inject.js +0 -30
  277. package/lib/inject.js.map +0 -1
  278. package/rpg.toml +0 -14
  279. package/src/Components/AbstractComponent.ts +0 -120
  280. package/src/Components/BarComponent.ts +0 -181
  281. package/src/Components/Component.ts +0 -515
  282. package/src/Components/DebugComponent.ts +0 -36
  283. package/src/Components/ImageComponent.ts +0 -30
  284. package/src/Components/ShapeComponent.ts +0 -64
  285. package/src/Components/TextComponent.ts +0 -33
  286. package/src/Components/TileComponent.ts +0 -43
  287. package/src/Effects/Animation.ts +0 -310
  288. package/src/Effects/AnimationCharacter.ts +0 -7
  289. package/src/Effects/Spinner.ts +0 -19
  290. package/src/Effects/Timeline.ts +0 -378
  291. package/src/Effects/TransitionScene.ts +0 -59
  292. package/src/GameEngine.ts +0 -289
  293. package/src/Gui/React.ts +0 -145
  294. package/src/Gui/Vue.ts +0 -154
  295. package/src/Interfaces/Character.ts +0 -7
  296. package/src/Interfaces/Scene.ts +0 -9
  297. package/src/KeyboardControls.ts +0 -748
  298. package/src/Logger.ts +0 -3
  299. package/src/Presets/Scene.ts +0 -3
  300. package/src/Renderer.ts +0 -334
  301. package/src/Resources.ts +0 -39
  302. package/src/Scene/EventLayer.ts +0 -9
  303. package/src/Scene/Map.ts +0 -402
  304. package/src/Scene/Scene.ts +0 -305
  305. package/src/Scene/SceneData.ts +0 -13
  306. package/src/Sound/RpgSound.ts +0 -50
  307. package/src/Sound/Sound.ts +0 -91
  308. package/src/Sound/Sounds.ts +0 -7
  309. package/src/Sprite/Character.ts +0 -157
  310. package/src/Sprite/Player.ts +0 -3
  311. package/src/Sprite/Spritesheet.ts +0 -392
  312. package/src/Sprite/Spritesheets.ts +0 -8
  313. package/src/Tilemap/CommonLayer.ts +0 -20
  314. package/src/Tilemap/ImageLayer.ts +0 -20
  315. package/src/Tilemap/Tile.ts +0 -80
  316. package/src/Tilemap/TileLayer.ts +0 -142
  317. package/src/Tilemap/TileSet.ts +0 -40
  318. package/src/Tilemap/index.ts +0 -175
  319. package/src/clientEntryPoint.ts +0 -150
  320. package/src/inject.ts +0 -34
  321. package/src/types/howler.d.ts +0 -73
@@ -1,131 +0,0 @@
1
- import { Utils, RpgPlugin, HookClient } from '@rpgjs/common';
2
- import { spritesheets } from './Spritesheets.js';
3
- import { Animation } from '../Effects/Animation.js';
4
- import { Animation as AnimationEnum } from '../Effects/AnimationCharacter.js';
5
- import { Sprite } from 'pixi.js';
6
- const { capitalize } = Utils;
7
- class Character extends Sprite {
8
- constructor(component, graphic) {
9
- super();
10
- this.component = component;
11
- this.graphic = graphic;
12
- this.playStandardAnimation = true;
13
- this.objSaved = {};
14
- this.data = {};
15
- /** @internal */
16
- this.h = 1;
17
- /** @internal */
18
- this.w = 1;
19
- this.data = component.logic;
20
- this.setGraphic(graphic);
21
- }
22
- /** @internal */
23
- showAnimation(graphic, animationName) {
24
- const refreshAnimation = (graphic) => {
25
- this.removeChild(this.animation);
26
- this.animation = new Animation(graphic);
27
- this.addChild(this.animation);
28
- this.setAnimationAnchor();
29
- };
30
- const memoryGraphic = this.graphic;
31
- let graphicId = '';
32
- // Changes only graphics already defined on the character
33
- if (Utils.isArray(graphic)) {
34
- graphicId = graphic.find(id => id == this.graphic);
35
- }
36
- else {
37
- graphicId = graphic;
38
- }
39
- if (!graphicId) {
40
- return null;
41
- }
42
- refreshAnimation(graphicId);
43
- this.component.animationIsPlaying = true;
44
- this.animation.onFinish = () => {
45
- this.playStandardAnimation = true;
46
- this.component.animationIsPlaying = false;
47
- refreshAnimation(memoryGraphic);
48
- this.update(this.objSaved);
49
- };
50
- this.playStandardAnimation = false;
51
- this.playAnimation(animationName);
52
- return this.animation;
53
- }
54
- /** @internal */
55
- setGraphic(graphic) {
56
- this.children.forEach((graphic, index) => {
57
- if (graphic.id == this.graphic) {
58
- this.removeChildAt(index);
59
- }
60
- });
61
- this.graphic = graphic;
62
- this.spritesheet = spritesheets.get(this.graphic);
63
- this.animation = new Animation(this.graphic);
64
- this.addChild(this.animation);
65
- this.setAnimationAnchor();
66
- }
67
- getGraphicHeight() {
68
- return this.animation.getSpriteHeight();
69
- }
70
- getGraphicWidth() {
71
- return this.animation.getSpriteWidth();
72
- }
73
- animationSprite() {
74
- return this.animation.animation$;
75
- }
76
- setAnimationAnchor() {
77
- this.animation.hitbox = { h: this.data.hHitbox, w: this.data.wHitbox };
78
- this.animation.applyTransform = (frame, animation, spritesheet) => {
79
- const { spriteWidth, spriteHeight } = animation;
80
- const prop = 'spriteRealSize';
81
- const currentAnchor = frame[prop] || animation[prop] || spritesheet[prop];
82
- if (currentAnchor) {
83
- return {};
84
- }
85
- return {
86
- spriteRealSize: {
87
- width: spriteWidth,
88
- height: spriteHeight
89
- }
90
- };
91
- };
92
- }
93
- /** @internal */
94
- update(obj, options = {}, deltaRatio = 1) {
95
- const { moving } = options;
96
- this.data = obj;
97
- if (this.anim)
98
- this.anim.update(deltaRatio);
99
- if (this.animation)
100
- this.animation.update(deltaRatio);
101
- if (this.playStandardAnimation) {
102
- if (moving) {
103
- RpgPlugin.emit(HookClient.SpriteMove, this);
104
- this.playAnimation(AnimationEnum.Walk);
105
- }
106
- else {
107
- this.playAnimation(AnimationEnum.Stand);
108
- }
109
- }
110
- this.objSaved = obj;
111
- return {
112
- moving,
113
- instance: this
114
- };
115
- }
116
- /** @internal */
117
- playAnimation(name) {
118
- const hook = `onCharacter${capitalize(name)}`;
119
- if (!this.spritesheet)
120
- return;
121
- if (this.spritesheet[hook]) {
122
- this.spritesheet[hook](this);
123
- }
124
- else if (this.animation.has(name)) {
125
- this.animation.play(name, [this.data.direction]);
126
- }
127
- }
128
- }
129
- Character.id = 'graphic';
130
- export default Character;
131
- //# sourceMappingURL=Character.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Character.js","sourceRoot":"","sources":["../../src/Sprite/Character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG1E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;AAE5B,MAAqB,SAAU,SAAQ,MAAM;IAiBzC,YAAoB,SAAuB,EAAU,OAAe;QAChE,KAAK,EAAE,CAAA;QADS,cAAS,GAAT,SAAS,CAAc;QAAU,YAAO,GAAP,OAAO,CAAQ;QAb5D,0BAAqB,GAAY,IAAI,CAAA;QAErC,aAAQ,GAAW,EAAE,CAAA;QACrB,SAAI,GAAQ,EAAE,CAAA;QAErB,gBAAgB;QAChB,MAAC,GAAW,CAAC,CAAA;QACb,gBAAgB;QAChB,MAAC,GAAW,CAAC,CAAA;QAOV,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;IAED,gBAAgB;IAChB,aAAa,CAAC,OAA0B,EAAE,aAAqB;QAC3D,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,EAAE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AAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;SACnD;IACL,CAAC;;AA/Ie,YAAE,GAAW,SAAS,AAApB,CAAoB;eADrB,SAAS"}
@@ -1,3 +0,0 @@
1
- import Character from './Character.js';
2
- export declare class RpgSprite extends Character {
3
- }
@@ -1,4 +0,0 @@
1
- import Character from './Character.js';
2
- export class RpgSprite extends Character {
3
- }
4
- //# sourceMappingURL=Player.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Player.js","sourceRoot":"","sources":["../../src/Sprite/Player.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,MAAM,OAAO,SAAU,SAAQ,SAAS;CAAG"}
@@ -1,365 +0,0 @@
1
- export interface TransformOptions {
2
- /**
3
- * The global value of opacity (between 0 and 1)
4
- *
5
- * @prop {number} [opacity]
6
- * @memberof Spritesheet
7
- * */
8
- opacity?: number;
9
- /**
10
- * The global value of pivot.
11
- *
12
- * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot is equal to position, regardless of the other three transformations. In other words, It is the center of rotation, scaling, and skewing.
13
- *
14
- * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
15
- *
16
- * ```ts
17
- * pivot: [0.5, 0.8]
18
- * ```
19
- *
20
- * @prop {Array<number>} [pivot]
21
- * @memberof Spritesheet
22
- * */
23
- pivot?: number[];
24
- /**
25
- * The global value of anchor.
26
- *
27
- * Position of the origin point
28
- *
29
- * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
30
- *
31
- * ```ts
32
- * anchor: [0.5, 0.8]
33
- * ```
34
- *
35
- * @prop {Array<number>} [anchor]
36
- * @memberof Spritesheet
37
- * */
38
- anchor?: number[];
39
- /**
40
- * Defines the actual size of the sprite that is inside a larger rectangle.
41
- * For example, if the texture rectangle is 192x192 while the character, which is in the center, is only 64x64 then set `spriteRealSize: 64`. This way the character will be well positioned in relation to the animations that have a different rectangle
42
- *
43
- * > You can also put `spriteRealSize: { width: 64, height: 64 }` but be aware that the width is not concerned because it will always be centered while the height depends on the hitbox
44
- *
45
- * @prop {{ width: number, height: number } | number} [spriteRealSize]
46
- * @since 3.2.0
47
- * @memberof Spritesheet
48
- * */
49
- spriteRealSize?: {
50
- width: number;
51
- height: number;
52
- } | number;
53
- /**
54
- * The global value of rotation
55
- *
56
- * Rotation. This will rotate the display object's projection by this angle (in radians).
57
- *
58
- * @prop {number} [angle]
59
- * @memberof Spritesheet
60
- * */
61
- angle?: number;
62
- /**
63
- * The global value of rotation
64
- *
65
- * Rotation. This is an alias for rotation, but in degrees.
66
- *
67
- * @prop {number} [rotation]
68
- * @memberof Spritesheet
69
- * */
70
- rotation?: number;
71
- /**
72
- * The global value of scale.
73
- *
74
- * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center of scaling is the pivot.
75
- *
76
- * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
77
- *
78
- * ```ts
79
- * scale: [0.5, 0.8]
80
- * ```
81
- *
82
- * @prop {Array<number>} [scale]
83
- * @memberof Spritesheet
84
- * */
85
- scale?: number[];
86
- /**
87
- * The global value of skew.
88
- *
89
- * Skewing. This can be used to deform a rectangular display object into a parallelogram.
90
- *
91
- * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be thought of the net rotation applied to the coordinate axes (separately). For example, if "skew.x" is ⍺ and "skew.y" is β, then the line x = 0 will be rotated by ⍺ (y = -x*cot⍺) and the line y = 0 will be rotated by β (y = x*tanβ). A line y = x*tanϴ (i.e. a line at angle ϴ to the x-axis in local-space) will be rotated by an angle between ⍺ and β.
92
- *
93
- * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying a rotation. Indeed, if "skew.x" = -ϴ and "skew.y" = ϴ, it will produce an equivalent of "rotation" = ϴ.
94
- *
95
- * Another quite interesting observation is that "skew.x", "skew.y", rotation are communtative operations. Indeed, because rotation is essentially a careful combination of the two.
96
- *
97
- * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
98
- *
99
- * @prop {Array<number>} [skew]
100
- * @memberof Spritesheet
101
- * */
102
- skew?: number[];
103
- /**
104
- * The global value of X translation
105
- *
106
- * @prop {number} [x]
107
- * @memberof Spritesheet
108
- * */
109
- x?: number;
110
- /**
111
- * The global value of Y translation
112
- *
113
- * @prop {number} [y]
114
- * @memberof Spritesheet
115
- * */
116
- y?: number;
117
- /**
118
- * The global value of visible
119
- *
120
- * @prop {boolean} [visible]
121
- * @memberof Spritesheet
122
- * */
123
- visible?: boolean;
124
- /**
125
- * Define the sound that will be played for all animations in the spritesheet. Remember to create the sound before with the @Sound decorator
126
- *
127
- * @prop {string} [sound]
128
- * @memberof Spritesheet
129
- * */
130
- sound?: string;
131
- }
132
- export interface FrameOptions extends TransformOptions {
133
- time: number;
134
- frameX?: number;
135
- frameY?: number;
136
- }
137
- export interface TextureOptions {
138
- /**
139
- * The number of frames on the width
140
- *
141
- * @prop {number} framesWidth
142
- * @memberof Spritesheet
143
- * */
144
- framesWidth?: number;
145
- /**
146
- * The number of frames on the height
147
- *
148
- * @prop {number} framesHeight
149
- * @memberof Spritesheet
150
- * */
151
- framesHeight?: number;
152
- /**
153
- * The width of the image (in pixels)
154
- *
155
- * @prop {number} width
156
- * @memberof Spritesheet
157
- * */
158
- width?: number;
159
- /**
160
- * The height of the image (in pixels)
161
- *
162
- * @prop {number} height
163
- * @memberof Spritesheet
164
- * */
165
- height?: number;
166
- /**
167
- * Takes a width of a rectangle in the image. Equivalent to `width / framesWidth`
168
- *
169
- * @prop {number} [rectWidth]
170
- * @memberof Spritesheet
171
- * */
172
- rectWidth?: number;
173
- /**
174
- * Takes a height of a rectangle in the image. Equivalent to `height / framesHeight`
175
- *
176
- * @prop {number} [rectHeight]
177
- * @memberof Spritesheet
178
- * */
179
- rectHeight?: number;
180
- /**
181
- * To take the texture, start at a well defined X and Y position. Otherwise, it starts at 0,0
182
- *
183
- * @prop {number} [offset]
184
- * @memberof Spritesheet
185
- * */
186
- offset?: {
187
- x: number;
188
- y: number;
189
- };
190
- }
191
- export type AnimationFrames = FrameOptions[][] | ((...args: any) => FrameOptions[][]);
192
- export interface TexturesOptions extends TextureOptions, TransformOptions {
193
- animations: AnimationFrames;
194
- }
195
- export interface SpritesheetOptions extends TransformOptions, TextureOptions {
196
- /**
197
- * Object containing all animations.
198
- * The key to the object is the name of the animation. The value is a two-dimensional array
199
- *
200
- * ```ts
201
- * textures: {
202
- * myanim: {
203
- * animations: [
204
- * [ { time: 0, frameX: 0, frameY: 0 } ]
205
- * ]
206
- * }
207
- * }
208
- * ```
209
- *
210
- * The first array represents an animation group. You can put several of them together to create an animation cluster. For example, several explosions with the same spritesheet
211
- * The second array represents the animation itself which will animate over time. The object indicates, over a period of time (in frame), which part of the spritesheet will be taken (`frameX`, `frameY`)
212
- *
213
- * Here are the properties:
214
- *
215
- * * `time`: Time in frame
216
- * * `frameX`: Retrieve a frame from the spritesheet on the X-axis
217
- * * `frameY`: Retrieve a frame from the spritesheet on the Y-axis
218
- * * `opacity`
219
- * * `pivot`
220
- * * `anchor`
221
- * * `rotation`
222
- * * `angle`
223
- * * `scale`
224
- * * `skew`
225
- * * `x`
226
- * * `y`
227
- * * `visible`
228
- * * `sound`: The sound that will be played during the frame
229
- *
230
- * ---
231
- * **Extract Animation of Spritesheet**
232
- *
233
- * Sometimes the animation is part of the image
234
- *
235
- * ```ts
236
- * textures: {
237
- * myanim: {
238
- * rectWidth: 64,
239
- * rectHeight: 64,
240
- * framesWidth: 10,
241
- * framesHeight: 2,
242
- * offset: {x: 0, y: 230},
243
- * sound: 'my-sound-id', // You can put a sound just for the animation
244
- * animations: [
245
- * [ { time: 0, frameX: 0, frameY: 0 } ]
246
- * ]
247
- * }
248
- * }
249
- * ```
250
- *
251
- * Above, we can specify which part we want to recover
252
- *
253
- * 1. We go to the position {0, 230} of the image (`offset`)
254
- * 2. We recover cells of 64px (`rectWidth` and `rectHeight`)
255
- * 3. And we get 20 cells (10 on the width, 2 on the height) (`frameX` and `frameY`)
256
- *
257
- * ---
258
- *
259
- * **Advanced**
260
- *
261
- * You can create an animation that will be linked to a data. For example, different animation according to a direction of the character.
262
- *
263
- * Full example:
264
- *
265
- * ```ts
266
- * import { Spritesheet, Animation, Direction } from '@rpgjs/client'
267
- *
268
- * @Spritesheet({
269
- * id: 'chest',
270
- * image: require('./assets/chest.png'),
271
- * width: 124,
272
- * height: 61,
273
- * framesHeight: 2,
274
- * framesWidth: 4,
275
- * textures: {
276
- * [Animation.Stand]: {
277
- * animations: direction => [[ {time: 0, frameX: 3, frameY: direction == Direction.Up ? 0 : 1 } ]]
278
- * }
279
- * })
280
- * })
281
- * export class Chest { }
282
- * ```
283
- *
284
- * > It is important to know that `Animation.Stand` animation is called if it exists. it only works in the case of an event that doesn't move. The direction is then sent
285
- *
286
- * As you can see, the property contains a function that returns the array for the animation. Here, it is the direction but the parameters depend on the call of the animation. Example:
287
- *
288
- * ```ts
289
- * import { Spritesheet, Animation, Direction, RpgSprite, ISpriteCharacter } from '@rpgjs/client'
290
- *
291
- * @Spritesheet({
292
- * id: 'chest',
293
- * image: require('./assets/chest.png'),
294
- * width: 124,
295
- * height: 61,
296
- * framesHeight: 2,
297
- * framesWidth: 4,
298
- * textures: {
299
- * [Animation.Stand]: {
300
- * animations: str => [[ {time: 0, frameX: 3, frameY: str == 'hello' ? 0 : 1 } ]]
301
- * }
302
- * }
303
- * })
304
- * export class Chest implements ISpriteCharacter {
305
- * onCharacterStand(sprite: RpgSprite) {
306
- * sprite.animation.play(Animation.Stand, ['hello'])
307
- * }
308
- * }
309
- * ```
310
- *
311
- * @prop { { [animName: string]: { animations: Array<Array<FrameOptions>> | Function, ...other } } } [textures]
312
- * @memberof Spritesheet
313
- * */
314
- textures?: {
315
- [animationName: string]: Partial<TexturesOptions> & Pick<TexturesOptions, 'animations'>;
316
- };
317
- }
318
- type SpritesheetImageOptions = SpritesheetOptions & {
319
- /**
320
- * The link to the image
321
- *
322
- * > Do not use the `images` property
323
- * > Remember to wrap the link to the image with the `require` function.
324
- *
325
- * ```ts
326
- * image: require('./assets/hero.png')
327
- * ```
328
- *
329
- * @prop {string} [image]
330
- * @memberof Spritesheet
331
- * */
332
- image?: string;
333
- /**
334
- * Spritesheet identifier.
335
- *
336
- * > Do not use the `images` property
337
- *
338
- * @prop {string} [id]
339
- * @memberof Spritesheet
340
- * */
341
- id: string;
342
- };
343
- type SpritesheetImagesOptions = SpritesheetOptions & {
344
- /**
345
- * Put the different images that are concerned by the properties below.
346
- * The key of the object is the identifier of the spritesheet and the value and the link to the image.
347
- *
348
- * > Remember to wrap the link to the image with the `require` function.
349
- *
350
- * ```ts
351
- * images: {
352
- * hero: require('./assets/hero.png')
353
- * }
354
- * ```
355
- *
356
- * @prop { { [id: string]: string } } [images]
357
- * @memberof Spritesheet
358
- * */
359
- images?: {
360
- [id: string]: string;
361
- };
362
- };
363
- export declare function Spritesheet(options: SpritesheetImageOptions): any;
364
- export declare function Spritesheet(options: SpritesheetImagesOptions): any;
365
- export {};
@@ -1,13 +0,0 @@
1
- export function Spritesheet(options) {
2
- return (target) => {
3
- if ('images' in options)
4
- target['images'] = options.images;
5
- if ('id' in options)
6
- target['id'] = options.id;
7
- for (let key in options) {
8
- target.prototype[key] = options[key];
9
- }
10
- return;
11
- };
12
- }
13
- //# sourceMappingURL=Spritesheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Spritesheet.js","sourceRoot":"","sources":["../../src/Sprite/Spritesheet.ts"],"names":[],"mappings":"AA8XA,MAAM,UAAU,WAAW,CAAC,OAA2D;IACnF,OAAO,CAAC,MAAgB,EAAE,EAAE;QACxB,IAAI,QAAQ,IAAI,OAAO;YAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAA;QAC1D,IAAI,IAAI,IAAI,OAAO;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,EAAE,CAAA;QAC9C,KAAK,IAAI,GAAG,IAAI,OAAO,EAAE;YACrB,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;SACvC;QACD,OAAM;IACV,CAAC,CAAA;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- import { RpgClientEngine } from '../index.js';
2
- export declare const spritesheets: Map<string, any>;
3
- export declare function _initSpritesheet(_spritesheets: any, engine: RpgClientEngine): void;
@@ -1,6 +0,0 @@
1
- import { _initResource } from '../Resources.js';
2
- export const spritesheets = new Map();
3
- export function _initSpritesheet(_spritesheets, engine) {
4
- return _initResource(spritesheets, _spritesheets, 'image', engine);
5
- }
6
- //# sourceMappingURL=Spritesheets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Spritesheets.js","sourceRoot":"","sources":["../../src/Sprite/Spritesheets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAqB,IAAI,GAAG,EAAE,CAAA;AAEvD,MAAM,UAAU,gBAAgB,CAAC,aAAa,EAAE,MAAuB;IACnE,OAAO,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AACtE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Layer } from "@rpgjs/tiled";
2
- import TileMap from './index.js';
3
- import { Container } from "pixi.js";
4
- export declare class CommonLayer extends Container {
5
- protected layer: Layer;
6
- protected map: TileMap;
7
- z: number;
8
- constructor(layer: Layer, map: TileMap);
9
- applyProperties(): void;
10
- }
@@ -1,17 +0,0 @@
1
- import { Container } from "pixi.js";
2
- export class CommonLayer extends Container {
3
- constructor(layer, map) {
4
- super();
5
- this.layer = layer;
6
- this.map = map;
7
- this.applyProperties();
8
- }
9
- applyProperties() {
10
- this.alpha = this.layer.opacity ?? 1;
11
- this.visible = this.layer.visible ?? true;
12
- this.x = this.layer.offsetx ?? 0;
13
- this.y = this.layer.offsety ?? 0;
14
- this.z = this.layer.properties.z ?? 0;
15
- }
16
- }
17
- //# sourceMappingURL=CommonLayer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonLayer.js","sourceRoot":"","sources":["../../src/Tilemap/CommonLayer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,OAAO,WAAY,SAAQ,SAAS;IAGtC,YAAsB,KAAY,EAAY,GAAY;QACtD,KAAK,EAAE,CAAA;QADW,UAAK,GAAL,KAAK,CAAO;QAAY,QAAG,GAAH,GAAG,CAAS;QAEtD,IAAI,CAAC,eAAe,EAAE,CAAA;IAC1B,CAAC;IAED,eAAe;QACX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAA;QACzC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;CACJ"}
@@ -1,4 +0,0 @@
1
- import { CommonLayer } from './CommonLayer.js';
2
- export default class ImageLayer extends CommonLayer {
3
- applyProperties(): void;
4
- }
@@ -1,16 +0,0 @@
1
- import { CommonLayer } from './CommonLayer.js';
2
- import { Texture, TilingSprite } from 'pixi.js';
3
- export default class ImageLayer extends CommonLayer {
4
- applyProperties() {
5
- super.applyProperties();
6
- const engine = this.map['renderer']['clientEngine'];
7
- if (this.layer.image && this.layer.image.source && engine) {
8
- const { width, height, source } = this.layer.image;
9
- const data = this.map.getData();
10
- const texture = Texture.from(engine.getResourceUrl(source));
11
- const tilingSprite = new TilingSprite(texture, this.layer.repeatx ? data.width * data.tilewidth : width, this.layer.repeaty ? data.height * data.tileheight : height);
12
- this.addChild(tilingSprite);
13
- }
14
- }
15
- }
16
- //# sourceMappingURL=ImageLayer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImageLayer.js","sourceRoot":"","sources":["../../src/Tilemap/ImageLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,eAAe;QACb,KAAK,CAAC,eAAe,EAAE,CAAA;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,CAAA;QACnD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,EAAE;YACzD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;YAClD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;YAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;YAC3D,MAAM,YAAY,GAAG,IAAI,YAAY,CACjC,OAAO,EACP,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACxD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAC9D,CAAA;YACD,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;SAC5B;IACH,CAAC;CACF"}
@@ -1,21 +0,0 @@
1
- import { Texture, AnimatedSprite } from "pixi.js";
2
- import TileSet from "./TileSet.js";
3
- import { Tile as TiledTileClass } from '@rpgjs/tiled';
4
- import { CompositeTilemap } from "@pixi/tilemap";
5
- export default class Tile extends AnimatedSprite {
6
- private tile;
7
- private tileSet;
8
- static getTextures(tile: TiledTileClass, tileSet: TileSet): Texture<import("pixi.js").Resource>[];
9
- animations: {
10
- tileid: number;
11
- duration: number;
12
- }[];
13
- _x: number;
14
- _y: number;
15
- pointsBufIndex: number;
16
- properties: any;
17
- constructor(tile: TiledTileClass, tileSet: TileSet);
18
- get gid(): number;
19
- setAnimation(frame: CompositeTilemap): void;
20
- flip(): void;
21
- }