gdcore-tools 2.0.0-gd-v5.5.223-autobuild → 2.0.0-gd-v5.5.225-autobuild

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 (202) hide show
  1. package/dist/Runtime/CustomRuntimeObject.js +1 -1
  2. package/dist/Runtime/CustomRuntimeObject.js.map +2 -2
  3. package/dist/Runtime/CustomRuntimeObject2D.js.map +2 -2
  4. package/dist/Runtime/Extensions/3D/A_RuntimeObject3D.js.map +2 -2
  5. package/dist/Runtime/Extensions/3D/Base3DBehavior.js.map +2 -2
  6. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js +1 -1
  7. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObject.js.map +2 -2
  8. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js +1 -1
  9. package/dist/Runtime/Extensions/3D/Cube3DRuntimeObjectPixiRenderer.js.map +2 -2
  10. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3D.js.map +2 -2
  11. package/dist/Runtime/Extensions/3D/CustomRuntimeObject3DRenderer.js.map +2 -2
  12. package/dist/Runtime/Extensions/3D/JsExtension.js +219 -108
  13. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js +1 -1
  14. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject.js.map +2 -2
  15. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js +1 -1
  16. package/dist/Runtime/Extensions/3D/Model3DRuntimeObject3DRenderer.js.map +2 -2
  17. package/dist/Runtime/Extensions/AdMob/JsExtension.js +63 -1
  18. package/dist/Runtime/Extensions/AdMob/admobtools.js +1 -1
  19. package/dist/Runtime/Extensions/AdMob/admobtools.js.map +2 -2
  20. package/dist/Runtime/Extensions/AdvancedWindow/electron-advancedwindowtools.js.map +2 -2
  21. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js +1 -1
  22. package/dist/Runtime/Extensions/AnchorBehavior/anchorruntimebehavior.js.map +2 -2
  23. package/dist/Runtime/Extensions/BBText/JsExtension.js +10 -9
  24. package/dist/Runtime/Extensions/BBText/bbtextruntimeobject.js.map +2 -2
  25. package/dist/Runtime/Extensions/BitmapText/JsExtension.js +4 -6
  26. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject-pixi-renderer.js.map +2 -2
  27. package/dist/Runtime/Extensions/BitmapText/bitmaptextruntimeobject.js.map +2 -2
  28. package/dist/Runtime/Extensions/DialogueTree/dialoguetools.js.map +2 -2
  29. package/dist/Runtime/Extensions/DraggableBehavior/draggableruntimebehavior.js.map +2 -2
  30. package/dist/Runtime/Extensions/Effects/adjustment-pixi-filter.js.map +2 -2
  31. package/dist/Runtime/Extensions/Effects/advanced-bloom-pixi-filter.js.map +2 -2
  32. package/dist/Runtime/Extensions/Effects/ascii-pixi-filter.js.map +2 -2
  33. package/dist/Runtime/Extensions/Effects/bevel-pixi-filter.js.map +2 -2
  34. package/dist/Runtime/Extensions/Effects/black-and-white-pixi-filter.js.map +2 -2
  35. package/dist/Runtime/Extensions/Effects/blending-mode-pixi-filter.js.map +2 -2
  36. package/dist/Runtime/Extensions/Effects/brightness-pixi-filter.js.map +2 -2
  37. package/dist/Runtime/Extensions/Effects/bulge-pinch-pixi-filter.js.map +2 -2
  38. package/dist/Runtime/Extensions/Effects/color-map-pixi-filter.js.map +2 -2
  39. package/dist/Runtime/Extensions/Effects/color-replace-pixi-filter.js.map +2 -2
  40. package/dist/Runtime/Extensions/Effects/crt-pixi-filter.js.map +2 -2
  41. package/dist/Runtime/Extensions/Effects/displacement-pixi-filter.js.map +2 -2
  42. package/dist/Runtime/Extensions/Effects/dot-pixi-filter.js.map +2 -2
  43. package/dist/Runtime/Extensions/Effects/drop-shadow-pixi-filter.js.map +2 -2
  44. package/dist/Runtime/Extensions/Effects/glitch-pixi-filter.js.map +2 -2
  45. package/dist/Runtime/Extensions/Effects/glow-pixi-filter.js.map +2 -2
  46. package/dist/Runtime/Extensions/Effects/godray-pixi-filter.js.map +2 -2
  47. package/dist/Runtime/Extensions/Effects/kawase-blur-pixi-filter.js.map +2 -2
  48. package/dist/Runtime/Extensions/Effects/noise-pixi-filter.js.map +2 -2
  49. package/dist/Runtime/Extensions/Effects/old-film-pixi-filter.js.map +2 -2
  50. package/dist/Runtime/Extensions/Effects/outline-pixi-filter.js.map +2 -2
  51. package/dist/Runtime/Extensions/Effects/pixelate-pixi-filter.js.map +2 -2
  52. package/dist/Runtime/Extensions/Effects/pixi-filters/types/drop-shadow/types.d.ts +10 -4
  53. package/dist/Runtime/Extensions/Effects/radial-blur-pixi-filter.js.map +2 -2
  54. package/dist/Runtime/Extensions/Effects/reflection-pixi-filter.js.map +2 -2
  55. package/dist/Runtime/Extensions/Effects/rgb-split-pixi-filter.js.map +2 -2
  56. package/dist/Runtime/Extensions/Effects/sepia-pixi-filter.js.map +2 -2
  57. package/dist/Runtime/Extensions/Effects/shockwave-pixi-filter.js.map +2 -2
  58. package/dist/Runtime/Extensions/Effects/tilt-shift-pixi-filter.js.map +2 -2
  59. package/dist/Runtime/Extensions/Effects/twist-pixi-filter.js.map +2 -2
  60. package/dist/Runtime/Extensions/Effects/zoom-blur-pixi-filter.js.map +2 -2
  61. package/dist/Runtime/Extensions/ExampleJsExtension/dummyeffect.js.map +2 -2
  62. package/dist/Runtime/Extensions/FacebookInstantGames/facebookinstantgamestools.js.map +2 -2
  63. package/dist/Runtime/Extensions/Firebase/A_firebasejs/firebase.d.ts +5 -4
  64. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_cloudfirestoretools.js.map +2 -2
  65. package/dist/Runtime/Extensions/Firebase/B_firebasetools/D_remoteconfigtools.js.map +2 -2
  66. package/dist/Runtime/Extensions/Firebase/JsExtension.js +21 -21
  67. package/dist/Runtime/Extensions/JsExtensionTypes.d.ts +1 -0
  68. package/dist/Runtime/Extensions/Leaderboards/leaderboardstools.js.map +2 -2
  69. package/dist/Runtime/Extensions/Lighting/JsExtension.js +2 -2
  70. package/dist/Runtime/Extensions/Lighting/lightobstacleruntimebehavior.js.map +2 -2
  71. package/dist/Runtime/Extensions/Lighting/lightruntimeobject-pixi-renderer.js.map +2 -2
  72. package/dist/Runtime/Extensions/Lighting/lightruntimeobject.js.map +2 -2
  73. package/dist/Runtime/Extensions/LinkedObjects/linkedobjects.js.map +2 -2
  74. package/dist/Runtime/Extensions/Multiplayer/JsExtension.js +122 -0
  75. package/dist/Runtime/Extensions/Multiplayer/messageManager.js.map +2 -2
  76. package/dist/Runtime/Extensions/Multiplayer/multiplayerVariablesManager.js.map +2 -2
  77. package/dist/Runtime/Extensions/Multiplayer/multiplayercomponents.js +1 -1
  78. package/dist/Runtime/Extensions/Multiplayer/multiplayercomponents.js.map +2 -2
  79. package/dist/Runtime/Extensions/Multiplayer/multiplayerobjectruntimebehavior.js.map +2 -2
  80. package/dist/Runtime/Extensions/Multiplayer/multiplayertools.js +1 -1
  81. package/dist/Runtime/Extensions/Multiplayer/multiplayertools.js.map +2 -2
  82. package/dist/Runtime/Extensions/Multiplayer/peerJsHelper.js +1 -1
  83. package/dist/Runtime/Extensions/Multiplayer/peerJsHelper.js.map +2 -2
  84. package/dist/Runtime/Extensions/Multiplayer/peerjs.d.ts +8 -10
  85. package/dist/Runtime/Extensions/P2P/peerjs.d.ts +8 -10
  86. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js.map +2 -2
  87. package/dist/Runtime/Extensions/PanelSpriteObject/panelspriteruntimeobject.js.map +2 -2
  88. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js.map +2 -2
  89. package/dist/Runtime/Extensions/ParticleSystem/particleemitterobject.js.map +2 -2
  90. package/dist/Runtime/Extensions/ParticleSystem/pixi-particles-pixi-renderer.d.ts +2 -1
  91. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js.map +2 -2
  92. package/dist/Runtime/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js.map +2 -2
  93. package/dist/Runtime/Extensions/Physics2Behavior/JsExtension.js +106 -106
  94. package/dist/Runtime/Extensions/Physics2Behavior/box2d.d.ts +13 -7
  95. package/dist/Runtime/Extensions/Physics2Behavior/physics2runtimebehavior.js.map +2 -2
  96. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js +1 -1
  97. package/dist/Runtime/Extensions/Physics3DBehavior/Physics3DRuntimeBehavior.js.map +2 -2
  98. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js +1 -1
  99. package/dist/Runtime/Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.js.map +2 -2
  100. package/dist/Runtime/Extensions/PhysicsBehavior/physicsruntimebehavior.js.map +2 -2
  101. package/dist/Runtime/Extensions/PlatformBehavior/platformerobjectruntimebehavior.js.map +2 -2
  102. package/dist/Runtime/Extensions/PlatformBehavior/platformruntimebehavior.js.map +2 -2
  103. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationcomponents.js.map +1 -1
  104. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js +1 -1
  105. package/dist/Runtime/Extensions/PlayerAuthentication/playerauthenticationtools.js.map +2 -2
  106. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject-pixi-renderer.js.map +2 -2
  107. package/dist/Runtime/Extensions/PrimitiveDrawing/shapepainterruntimeobject.js.map +2 -2
  108. package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js +1 -1
  109. package/dist/Runtime/Extensions/SpatialSound/spatialsoundtools.js.map +2 -2
  110. package/dist/Runtime/Extensions/Spine/JsExtension.js +5 -4
  111. package/dist/Runtime/Extensions/Spine/managers/pixi-spine-atlas-manager.js +1 -1
  112. package/dist/Runtime/Extensions/Spine/managers/pixi-spine-atlas-manager.js.map +2 -2
  113. package/dist/Runtime/Extensions/Spine/managers/pixi-spine-manager.js +1 -1
  114. package/dist/Runtime/Extensions/Spine/managers/pixi-spine-manager.js.map +2 -2
  115. package/dist/Runtime/Extensions/Spine/spineruntimeobject-pixi-renderer.js.map +2 -2
  116. package/dist/Runtime/Extensions/Spine/spineruntimeobject.js.map +2 -2
  117. package/dist/Runtime/Extensions/Steamworks/JsExtension.js +12 -12
  118. package/dist/Runtime/Extensions/Steamworks/Z_steamworksinputtools.js.map +2 -2
  119. package/dist/Runtime/Extensions/Steamworks/steamworkstools.js.map +2 -2
  120. package/dist/Runtime/Extensions/TextEntryObject/textentryruntimeobject-pixi-renderer.js.map +2 -2
  121. package/dist/Runtime/Extensions/TextInput/JsExtension.js +2 -2
  122. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js +1 -1
  123. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject-pixi-renderer.js.map +2 -2
  124. package/dist/Runtime/Extensions/TextInput/textinputruntimeobject.js.map +2 -2
  125. package/dist/Runtime/Extensions/TextObject/textruntimeobject-pixi-renderer.js.map +2 -2
  126. package/dist/Runtime/Extensions/TextObject/textruntimeobject.js.map +2 -2
  127. package/dist/Runtime/Extensions/TileMap/JsExtension.js +20 -18
  128. package/dist/Runtime/Extensions/TileMap/TileMapRuntimeManager.js.map +2 -2
  129. package/dist/Runtime/Extensions/TileMap/collision/TransformedTileMap.js.map +2 -2
  130. package/dist/Runtime/Extensions/TileMap/helper/dts/model/TileMapModel.d.ts +1 -3
  131. package/dist/Runtime/Extensions/TileMap/simpletilemapruntimeobject.js.map +2 -2
  132. package/dist/Runtime/Extensions/TileMap/tilemapcollisionmaskruntimeobject.js.map +2 -2
  133. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject-pixi-renderer.js.map +1 -1
  134. package/dist/Runtime/Extensions/TileMap/tilemapruntimeobject.js.map +2 -2
  135. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js.map +2 -2
  136. package/dist/Runtime/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js.map +2 -2
  137. package/dist/Runtime/Extensions/TopDownMovementBehavior/topdownmovementruntimebehavior.js.map +2 -2
  138. package/dist/Runtime/Extensions/TweenBehavior/tweenruntimebehavior.js.map +1 -1
  139. package/dist/Runtime/Extensions/Video/JsExtension.js +2 -1
  140. package/dist/Runtime/Extensions/Video/videoruntimeobject-pixi-renderer.js.map +2 -2
  141. package/dist/Runtime/Extensions/Video/videoruntimeobject.js.map +2 -2
  142. package/dist/Runtime/InAppTutorialMessage.js +6 -0
  143. package/dist/Runtime/InAppTutorialMessage.js.map +7 -0
  144. package/dist/Runtime/Model3DManager.js.map +2 -2
  145. package/dist/Runtime/ResourceLoader.js.map +2 -2
  146. package/dist/Runtime/RuntimeCustomObjectLayer.js +1 -1
  147. package/dist/Runtime/RuntimeCustomObjectLayer.js.map +2 -2
  148. package/dist/Runtime/RuntimeInstanceContainer.js.map +1 -1
  149. package/dist/Runtime/RuntimeLayer.js.map +2 -2
  150. package/dist/Runtime/SpriteAnimator.js.map +2 -2
  151. package/dist/Runtime/affinetransformation.js.map +1 -1
  152. package/dist/Runtime/debugger-client/abstract-debugger-client.js.map +2 -2
  153. package/dist/Runtime/debugger-client/hot-reloader.js +2 -2
  154. package/dist/Runtime/debugger-client/hot-reloader.js.map +2 -2
  155. package/dist/Runtime/debugger-client/websocket-debugger-client.js +1 -1
  156. package/dist/Runtime/debugger-client/websocket-debugger-client.js.map +2 -2
  157. package/dist/Runtime/events-tools/networktools.js +1 -1
  158. package/dist/Runtime/events-tools/networktools.js.map +2 -2
  159. package/dist/Runtime/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js.map +2 -2
  160. package/dist/Runtime/gd.js.map +2 -2
  161. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js +1 -1
  162. package/dist/Runtime/howler-sound-manager/howler-sound-manager.js.map +2 -2
  163. package/dist/Runtime/inputmanager.js.map +2 -2
  164. package/dist/Runtime/jsonmanager.js.map +2 -2
  165. package/dist/Runtime/layer.js.map +2 -2
  166. package/dist/Runtime/libs/nanomarkdown.js +5 -0
  167. package/dist/Runtime/libs/nanomarkdown.js.map +7 -0
  168. package/dist/Runtime/object-capabilities/AnimatableBehavior.js.map +2 -2
  169. package/dist/Runtime/object-capabilities/EffectBehavior.js.map +2 -2
  170. package/dist/Runtime/object-capabilities/FlippableBehavior.js.map +2 -2
  171. package/dist/Runtime/object-capabilities/OpacityBehavior.js.map +2 -2
  172. package/dist/Runtime/object-capabilities/ResizableBehavior.js.map +2 -2
  173. package/dist/Runtime/object-capabilities/ScalableBehavior.js.map +2 -2
  174. package/dist/Runtime/object-capabilities/TextContainerBehavior.js.map +2 -2
  175. package/dist/Runtime/pixi-renderers/CustomRuntimeObject2DPixiRenderer.js.map +2 -2
  176. package/dist/Runtime/pixi-renderers/DebuggerPixiRenderer.js.map +2 -2
  177. package/dist/Runtime/pixi-renderers/layer-pixi-renderer.js.map +2 -2
  178. package/dist/Runtime/pixi-renderers/loadingscreen-pixi-renderer.js.map +2 -2
  179. package/dist/Runtime/pixi-renderers/pixi-bitmapfont-manager.js.map +2 -2
  180. package/dist/Runtime/pixi-renderers/pixi-filters-tools.js.map +2 -2
  181. package/dist/Runtime/pixi-renderers/pixi-image-manager.js +1 -1
  182. package/dist/Runtime/pixi-renderers/pixi-image-manager.js.map +2 -2
  183. package/dist/Runtime/pixi-renderers/pixi.js +123 -177
  184. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js +1 -1
  185. package/dist/Runtime/pixi-renderers/runtimegame-pixi-renderer.js.map +2 -2
  186. package/dist/Runtime/pixi-renderers/runtimescene-pixi-renderer.js.map +2 -2
  187. package/dist/Runtime/pixi-renderers/spriteruntimeobject-pixi-renderer.js.map +2 -2
  188. package/dist/Runtime/profiler.js.map +2 -2
  189. package/dist/Runtime/runtimegame.js +1 -1
  190. package/dist/Runtime/runtimegame.js.map +2 -2
  191. package/dist/Runtime/runtimeobject.js +1 -1
  192. package/dist/Runtime/runtimeobject.js.map +2 -2
  193. package/dist/Runtime/runtimescene.js.map +2 -2
  194. package/dist/Runtime/runtimewatermark.js.map +2 -2
  195. package/dist/Runtime/scenestack.js.map +2 -2
  196. package/dist/Runtime/spriteruntimeobject.js.map +2 -2
  197. package/dist/Runtime/variable.js.map +2 -2
  198. package/dist/Runtime/variablescontainer.js.map +2 -2
  199. package/dist/lib/libGD.cjs +1 -1
  200. package/dist/lib/libGD.wasm +0 -0
  201. package/gd.d.ts +6 -0
  202. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/TextInput/textinputruntimeobject.ts"],
4
- "sourcesContent": ["namespace gdjs {\n const supportedInputTypes = [\n 'text',\n 'email',\n 'password',\n 'number',\n 'telephone number',\n 'url',\n 'search',\n 'text area',\n ] as const;\n const supportedTextAlign = ['left', 'center', 'right'] as const;\n\n type SupportedInputType = typeof supportedInputTypes[number];\n type SupportedTextAlign = typeof supportedTextAlign[number];\n const parseInputType = (potentialInputType: string): SupportedInputType => {\n const lowercasedNewInputType = potentialInputType.toLowerCase();\n\n // @ts-ignore - we're actually checking that this value is correct.\n if (supportedInputTypes.includes(lowercasedNewInputType))\n return potentialInputType as SupportedInputType;\n\n return 'text';\n };\n\n const parseTextAlign = (\n potentialTextAlign: string | undefined\n ): SupportedTextAlign => {\n if (!potentialTextAlign) return 'left';\n const lowercasedNewTextAlign = potentialTextAlign.toLowerCase();\n\n // @ts-ignore - we're actually checking that this value is correct.\n if (supportedTextAlign.includes(lowercasedNewTextAlign))\n return potentialTextAlign as SupportedTextAlign;\n\n return 'left';\n };\n\n /** Base parameters for {@link gdjs.TextInputRuntimeObject} */\n export interface TextInputObjectData extends ObjectData {\n /** The base parameters of the TextInput */\n content: {\n initialValue: string;\n placeholder: string;\n fontResourceName: string;\n fontSize: float;\n inputType: SupportedInputType;\n textColor: string;\n fillColor: string;\n fillOpacity: float;\n borderColor: string;\n borderOpacity: float;\n borderWidth: float;\n disabled: boolean;\n readOnly: boolean;\n // ---- Values can be undefined because of support for these feature was added in v5.5.222.\n paddingX?: float;\n paddingY?: float;\n textAlign?: SupportedTextAlign;\n maxLength?: integer;\n // ----\n };\n }\n\n export type TextInputNetworkSyncDataType = {\n opa: float;\n wid: float;\n hei: float;\n txt: string;\n frn: string;\n fs: number;\n place: string;\n it: SupportedInputType;\n tc: string;\n fc: string;\n fo: float;\n bc: string;\n bo: float;\n bw: float;\n dis: boolean;\n ro: boolean;\n };\n\n export type TextInputNetworkSyncData = ObjectNetworkSyncData &\n TextInputNetworkSyncDataType;\n\n const DEFAULT_WIDTH = 300;\n const DEFAULT_HEIGHT = 30;\n\n const clampPadding = (value: float, dimension: float, borderWidth: float) => {\n return Math.max(0, Math.min(dimension / 2 - borderWidth, value));\n };\n\n /**\n * Shows a text input on the screen the player can type text into.\n */\n export class TextInputRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.TextContainer, gdjs.Resizable, gdjs.OpacityHandler {\n private _string: string;\n private _placeholder: string;\n private opacity: float = 255;\n private _width: float = DEFAULT_WIDTH;\n private _height: float = DEFAULT_HEIGHT;\n private _fontResourceName: string;\n private _fontSize: float;\n private _inputType: SupportedInputType;\n private _textColor: [float, float, float];\n private _fillColor: [float, float, float];\n private _fillOpacity: float;\n private _paddingX: integer;\n private _paddingY: integer;\n private _textAlign: SupportedTextAlign;\n private _maxLength: integer;\n private _borderColor: [float, float, float];\n private _borderOpacity: float;\n private _borderWidth: float;\n private _disabled: boolean;\n private _readOnly: boolean;\n private _isSubmitted: boolean;\n _renderer: TextInputRuntimeObjectRenderer;\n\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n objectData: TextInputObjectData\n ) {\n super(instanceContainer, objectData);\n\n this._string = objectData.content.initialValue;\n this._placeholder = objectData.content.placeholder;\n this._fontResourceName = objectData.content.fontResourceName;\n this._fontSize = objectData.content.fontSize || 20;\n this._inputType = parseInputType(objectData.content.inputType);\n this._textColor = gdjs.rgbOrHexToRGBColor(objectData.content.textColor);\n this._fillColor = gdjs.rgbOrHexToRGBColor(objectData.content.fillColor);\n this._fillOpacity = objectData.content.fillOpacity;\n this._borderColor = gdjs.rgbOrHexToRGBColor(\n objectData.content.borderColor\n );\n this._borderOpacity = objectData.content.borderOpacity;\n this._borderWidth = objectData.content.borderWidth;\n this._disabled = objectData.content.disabled;\n this._readOnly = objectData.content.readOnly;\n this._textAlign = parseTextAlign(objectData.content.textAlign);\n this._maxLength = objectData.content.maxLength || 0;\n this._paddingX =\n objectData.content.paddingX !== undefined\n ? objectData.content.paddingX\n : 2;\n this._paddingY =\n objectData.content.paddingY !== undefined\n ? objectData.content.paddingY\n : 1;\n this._isSubmitted = false;\n this._renderer = new gdjs.TextInputRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n getRendererObject() {\n return null;\n }\n\n updateFromObjectData(\n oldObjectData: TextInputObjectData,\n newObjectData: TextInputObjectData\n ): boolean {\n if (\n oldObjectData.content.initialValue !==\n newObjectData.content.initialValue\n ) {\n if (this._string === oldObjectData.content.initialValue) {\n this.setString(newObjectData.content.initialValue);\n }\n }\n if (\n oldObjectData.content.placeholder !== newObjectData.content.placeholder\n ) {\n this.setPlaceholder(newObjectData.content.placeholder);\n }\n if (\n oldObjectData.content.fontResourceName !==\n newObjectData.content.fontResourceName\n ) {\n this.setFontResourceName(newObjectData.content.fontResourceName);\n }\n if (oldObjectData.content.fontSize !== newObjectData.content.fontSize) {\n this.setFontSize(newObjectData.content.fontSize);\n }\n if (oldObjectData.content.inputType !== newObjectData.content.inputType) {\n this.setInputType(newObjectData.content.inputType);\n }\n if (oldObjectData.content.textColor !== newObjectData.content.textColor) {\n this.setTextColor(newObjectData.content.textColor);\n }\n if (oldObjectData.content.fillColor !== newObjectData.content.fillColor) {\n this.setFillColor(newObjectData.content.fillColor);\n }\n if (\n oldObjectData.content.fillOpacity !== newObjectData.content.fillOpacity\n ) {\n this.setFillOpacity(newObjectData.content.fillOpacity);\n }\n if (\n oldObjectData.content.borderColor !== newObjectData.content.borderColor\n ) {\n this.setBorderColor(newObjectData.content.borderColor);\n }\n if (\n oldObjectData.content.borderOpacity !==\n newObjectData.content.borderOpacity\n ) {\n this.setBorderOpacity(newObjectData.content.borderOpacity);\n }\n if (\n oldObjectData.content.borderWidth !== newObjectData.content.borderWidth\n ) {\n this.setBorderWidth(newObjectData.content.borderWidth);\n }\n if (oldObjectData.content.disabled !== newObjectData.content.disabled) {\n this.setDisabled(newObjectData.content.disabled);\n }\n if (oldObjectData.content.readOnly !== newObjectData.content.readOnly) {\n this.setReadOnly(newObjectData.content.readOnly);\n }\n if (\n newObjectData.content.maxLength !== undefined &&\n oldObjectData.content.maxLength !== newObjectData.content.maxLength\n ) {\n this.setMaxLength(newObjectData.content.maxLength);\n }\n if (\n newObjectData.content.textAlign &&\n oldObjectData.content.textAlign !== newObjectData.content.textAlign\n ) {\n this._textAlign = newObjectData.content.textAlign;\n }\n if (\n newObjectData.content.paddingX !== undefined &&\n oldObjectData.content.paddingX !== newObjectData.content.paddingX\n ) {\n this.setPaddingX(newObjectData.content.paddingX);\n }\n if (\n newObjectData.content.paddingY !== undefined &&\n oldObjectData.content.paddingY !== newObjectData.content.paddingY\n ) {\n this.setPaddingY(newObjectData.content.paddingY);\n }\n\n return true;\n }\n\n getNetworkSyncData(): TextInputNetworkSyncData {\n return {\n ...super.getNetworkSyncData(),\n opa: this.getOpacity(),\n wid: this.getWidth(),\n hei: this.getHeight(),\n txt: this.getText(),\n frn: this.getFontResourceName(),\n fs: this.getFontSize(),\n place: this.getPlaceholder(),\n it: this.getInputType(),\n tc: this.getTextColor(),\n fc: this.getFillColor(),\n fo: this.getFillOpacity(),\n bc: this.getBorderColor(),\n bo: this.getBorderOpacity(),\n bw: this.getBorderWidth(),\n dis: this.isDisabled(),\n ro: this.isReadOnly(),\n };\n }\n\n updateFromNetworkSyncData(syncData: TextInputNetworkSyncData): void {\n super.updateFromNetworkSyncData(syncData);\n\n if (syncData.opa !== undefined) this.setOpacity(syncData.opa);\n if (syncData.wid !== undefined) this.setWidth(syncData.wid);\n if (syncData.hei !== undefined) this.setHeight(syncData.hei);\n if (syncData.txt !== undefined) this.setText(syncData.txt);\n if (syncData.frn !== undefined) this.setFontResourceName(syncData.frn);\n if (syncData.fs !== undefined) this.setFontSize(syncData.fs);\n if (syncData.place !== undefined) this.setPlaceholder(syncData.place);\n if (syncData.it !== undefined) this.setInputType(syncData.it);\n if (syncData.tc !== undefined) this.setTextColor(syncData.tc);\n if (syncData.fc !== undefined) this.setFillColor(syncData.fc);\n if (syncData.fo !== undefined) this.setFillOpacity(syncData.fo);\n if (syncData.bc !== undefined) this.setBorderColor(syncData.bc);\n if (syncData.bo !== undefined) this.setBorderOpacity(syncData.bo);\n if (syncData.bw !== undefined) this.setBorderWidth(syncData.bw);\n if (syncData.dis !== undefined) this.setDisabled(syncData.dis);\n if (syncData.ro !== undefined) this.setReadOnly(syncData.ro);\n }\n\n updatePreRender(instanceContainer: RuntimeInstanceContainer): void {\n this._isSubmitted = false;\n this._renderer.updatePreRender();\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n for (const property of initialInstanceData.stringProperties) {\n if (property.name === 'initialValue') {\n this.setString(property.value);\n } else if (property.name === 'placeholder') {\n this.setPlaceholder(property.value);\n }\n }\n if (initialInstanceData.customSize) {\n this.setWidth(initialInstanceData.width);\n this.setHeight(initialInstanceData.height);\n this._renderer.updatePadding();\n }\n if (initialInstanceData.opacity !== undefined) {\n this.setOpacity(initialInstanceData.opacity);\n }\n }\n\n onScenePaused(runtimeScene: gdjs.RuntimeScene): void {\n this._renderer.onScenePaused();\n }\n\n onSceneResumed(runtimeScene: gdjs.RuntimeScene): void {\n this._renderer.onSceneResumed();\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.onDestroy();\n }\n\n setOpacity(opacity: float): void {\n this.opacity = Math.max(0, Math.min(255, opacity));\n this._renderer.updateOpacity();\n }\n\n getOpacity(): float {\n return this.opacity;\n }\n\n setSize(width: number, height: number): void {\n this.setWidth(width);\n this.setHeight(height);\n }\n\n setWidth(width: float): void {\n this._width = width;\n this._renderer.updatePadding();\n }\n\n setHeight(height: float): void {\n this._height = height;\n this._renderer.updatePadding();\n }\n\n /**\n * Return the width of the object.\n * @return The width of the object\n */\n getWidth(): float {\n return this._width;\n }\n\n /**\n * Return the width of the object.\n * @return The height of the object\n */\n getHeight(): float {\n return this._height;\n }\n\n /**\n * Get the text entered in the text input.\n * @deprecated use `getText` instead\n */\n getString() {\n return this.getText();\n }\n\n /**\n * Replace the text inside the text input.\n * @deprecated use `setText` instead\n */\n setString(text: string) {\n this.setText(text);\n }\n\n getText() {\n return this._string;\n }\n\n setText(newString: string) {\n if (newString === this._string) return;\n\n this._string = newString;\n this._renderer.updateString();\n }\n\n /**\n * Called by the renderer when the value of the input shown on the screen\n * was changed (because the user typed something).\n * This does not propagate back the value to the renderer, which would\n * result in the cursor being sent back to the end of the text.\n *\n * Do not use this if you are not inside the renderer - use `setString` instead.\n */\n onRendererInputValueChanged(inputValue: string) {\n this._string = inputValue;\n }\n\n onRendererFormSubmitted() {\n this._isSubmitted = true;\n }\n\n getFontResourceName() {\n return this._fontResourceName;\n }\n\n setFontResourceName(resourceName: string) {\n if (this._fontResourceName === resourceName) return;\n\n this._fontResourceName = resourceName;\n this._renderer.updateFont();\n }\n\n getFontSize() {\n return this._fontSize;\n }\n\n setFontSize(newSize: number) {\n this._fontSize = newSize;\n }\n\n /**\n * Get the placeholder shown when no text is entered\n */\n getPlaceholder() {\n return this._placeholder;\n }\n\n /**\n * Replace the text inside the text input.\n */\n setPlaceholder(newPlaceholder: string) {\n if (newPlaceholder === this._placeholder) return;\n\n this._placeholder = newPlaceholder;\n this._renderer.updatePlaceholder();\n }\n\n /**\n * Get the type of the input.\n */\n getInputType() {\n return this._inputType;\n }\n\n /**\n * Set the type of the input.\n */\n setInputType(newInputType: string) {\n const lowercasedNewInputType = newInputType.toLowerCase();\n if (lowercasedNewInputType === this._inputType) return;\n\n this._inputType = parseInputType(lowercasedNewInputType);\n this._renderer.updateInputType();\n }\n\n setTextColor(newColor: string) {\n this._textColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateTextColor();\n }\n\n getTextColor(): string {\n return (\n this._textColor[0] + ';' + this._textColor[1] + ';' + this._textColor[2]\n );\n }\n\n _getRawTextColor(): [float, float, float] {\n return this._textColor;\n }\n\n setFillColor(newColor: string) {\n this._fillColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateFillColorAndOpacity();\n }\n\n getFillColor(): string {\n return (\n this._fillColor[0] + ';' + this._fillColor[1] + ';' + this._fillColor[2]\n );\n }\n\n _getRawFillColor(): [float, float, float] {\n return this._fillColor;\n }\n\n setFillOpacity(newOpacity: float) {\n this._fillOpacity = Math.max(0, Math.min(255, newOpacity));\n this._renderer.updateFillColorAndOpacity();\n }\n\n getFillOpacity(): float {\n return this._fillOpacity;\n }\n\n setBorderColor(newColor: string) {\n this._borderColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateBorderColorAndOpacity();\n }\n\n getBorderColor(): string {\n return (\n this._borderColor[0] +\n ';' +\n this._borderColor[1] +\n ';' +\n this._borderColor[2]\n );\n }\n\n _getRawBorderColor(): [float, float, float] {\n return this._borderColor;\n }\n\n setBorderOpacity(newOpacity: float) {\n this._borderOpacity = Math.max(0, Math.min(255, newOpacity));\n this._renderer.updateBorderColorAndOpacity();\n }\n\n getBorderOpacity(): float {\n return this._borderOpacity;\n }\n\n setBorderWidth(width: float) {\n this._borderWidth = Math.max(0, width);\n this._renderer.updateBorderWidth();\n }\n\n getBorderWidth(): float {\n return this._borderWidth;\n }\n\n setDisabled(value: boolean) {\n this._disabled = value;\n this._renderer.updateDisabled();\n }\n\n isDisabled(): boolean {\n return this._disabled;\n }\n\n setReadOnly(value: boolean) {\n this._readOnly = value;\n this._renderer.updateReadOnly();\n }\n\n isReadOnly(): boolean {\n return this._readOnly;\n }\n\n isFocused(): boolean {\n return this._renderer.isFocused();\n }\n isSubmitted(): boolean {\n return this._isSubmitted;\n }\n\n getMaxLength(): integer {\n return this._maxLength;\n }\n setMaxLength(value: integer) {\n if (this._maxLength === value) return;\n\n this._maxLength = value;\n this._renderer.updateMaxLength();\n }\n\n getPaddingX(): integer {\n return clampPadding(this._paddingX, this._width, this._borderWidth);\n }\n setPaddingX(value: integer) {\n if (this._paddingX === value) return;\n if (value < 0) {\n this._paddingX = 0;\n return;\n }\n\n this._paddingX = value;\n this._renderer.updatePadding();\n }\n getPaddingY(): integer {\n return clampPadding(this._paddingY, this._height, this._borderWidth);\n }\n setPaddingY(value: integer) {\n if (this._paddingY === value) return;\n if (value < 0) {\n this._paddingY = 0;\n return;\n }\n\n this._paddingY = value;\n this._renderer.updatePadding();\n }\n\n getTextAlign(): SupportedTextAlign {\n return this._textAlign;\n }\n\n setTextAlign(newTextAlign: string) {\n const parsedTextAlign = parseTextAlign(newTextAlign);\n if (parsedTextAlign === this._textAlign) return;\n\n this._textAlign = parsedTextAlign;\n this._renderer.updateTextAlign();\n }\n\n focus(): void {\n if (!this.isFocused()) {\n // If the input was not previously focused, reset input manager because there is\n // no reason to maintain its state. It avoids bugs where a key is pressed, the text\n // input is focused and then the input manager does not have access to the keyup event\n // and considers the key still pressed.\n this.getInstanceContainer()\n .getGame()\n .getInputManager()\n .clearAllPressedKeys();\n }\n this._renderer.focus();\n }\n }\n gdjs.registerObject(\n 'TextInput::TextInputObject',\n gdjs.TextInputRuntimeObject\n );\n}\n"],
5
- "mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CACE,KAAM,GAAsB,CAC1B,OACA,QACA,WACA,SACA,mBACA,MACA,SACA,aAEI,EAAqB,CAAC,OAAQ,SAAU,SAIxC,EAAiB,AAAC,GAAmD,CACzE,KAAM,GAAyB,EAAmB,cAGlD,MAAI,GAAoB,SAAS,GACxB,EAEF,QAGH,EAAiB,AAC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AAU,iBAGjB,YAAsB,CACpB,MAAO,MAAK,UAGd,WAAqB,CACnB,MAAO,MAAK,UAAU,YAExB,aAAuB,CACrB,MAAO,MAAK,aAGd,cAAwB,CACtB,MAAO,MAAK,WAEd,aAAa,EAAgB,CAC3B,AAAI,KAAK,aAAe,GAExB,MAAK,WAAa,EAClB,KAAK,UAAU,mBAGjB,aAAuB,CACrB,MAAO,GAAa,KAAK,UAAW,KAAK,OAAQ,KAAK,cAExD,YAAY,EAAgB,CAC1B,GAAI,KAAK,YAAc,EACvB,IAAI,EAAQ,EAAG,CACb,KAAK,UAAY,EACjB,OAGF,KAAK,UAAY,EACjB,KAAK,UAAU,iBAEjB,aAAuB,CACrB,MAAO,GAAa,KAAK,UAAW,KAAK,QAAS,KAAK,cAEzD,YAAY,EAAgB,CAC1B,GAAI,KAAK,YAAc,EACvB,IAAI,EAAQ,EAAG,CACb,KAAK,UAAY,EACjB,OAGF,KAAK,UAAY,EACjB,KAAK,UAAU,iBAGjB,cAAmC,CACjC,MAAO,MAAK,WAGd,aAAa,EAAsB,CACjC,KAAM,GAAkB,EAAe,GACvC,AAAI,IAAoB,KAAK,YAE7B,MAAK,WAAa,EAClB,KAAK,UAAU,mBAGjB,OAAc,CACZ,AAAK,KAAK,aAKR,KAAK,uBACF,UACA,kBACA,sBAEL,KAAK,UAAU,SA7hBZ,EAAM,yBAgiBb,EAAK,eACH,6BACA,EAAK,0BAloBC",
4
+ "sourcesContent": ["namespace gdjs {\n const supportedInputTypes = [\n 'text',\n 'email',\n 'password',\n 'number',\n 'telephone number',\n 'url',\n 'search',\n 'text area',\n ] as const;\n const supportedTextAlign = ['left', 'center', 'right'] as const;\n\n type SupportedInputType = (typeof supportedInputTypes)[number];\n type SupportedTextAlign = (typeof supportedTextAlign)[number];\n const parseInputType = (potentialInputType: string): SupportedInputType => {\n const lowercasedNewInputType = potentialInputType.toLowerCase();\n\n // @ts-ignore - we're actually checking that this value is correct.\n if (supportedInputTypes.includes(lowercasedNewInputType))\n return potentialInputType as SupportedInputType;\n\n return 'text';\n };\n\n const parseTextAlign = (\n potentialTextAlign: string | undefined\n ): SupportedTextAlign => {\n if (!potentialTextAlign) return 'left';\n const lowercasedNewTextAlign = potentialTextAlign.toLowerCase();\n\n // @ts-ignore - we're actually checking that this value is correct.\n if (supportedTextAlign.includes(lowercasedNewTextAlign))\n return potentialTextAlign as SupportedTextAlign;\n\n return 'left';\n };\n\n /** Base parameters for {@link gdjs.TextInputRuntimeObject} */\n export interface TextInputObjectData extends ObjectData {\n /** The base parameters of the TextInput */\n content: {\n initialValue: string;\n placeholder: string;\n fontResourceName: string;\n fontSize: float;\n inputType: SupportedInputType;\n textColor: string;\n fillColor: string;\n fillOpacity: float;\n borderColor: string;\n borderOpacity: float;\n borderWidth: float;\n disabled: boolean;\n readOnly: boolean;\n // ---- Values can be undefined because of support for these feature was added in v5.5.222.\n paddingX?: float;\n paddingY?: float;\n textAlign?: SupportedTextAlign;\n maxLength?: integer;\n // ----\n };\n }\n\n export type TextInputNetworkSyncDataType = {\n opa: float;\n wid: float;\n hei: float;\n txt: string;\n frn: string;\n fs: number;\n place: string;\n it: SupportedInputType;\n tc: string;\n fc: string;\n fo: float;\n bc: string;\n bo: float;\n bw: float;\n dis: boolean;\n ro: boolean;\n };\n\n export type TextInputNetworkSyncData = ObjectNetworkSyncData &\n TextInputNetworkSyncDataType;\n\n const DEFAULT_WIDTH = 300;\n const DEFAULT_HEIGHT = 30;\n\n const clampPadding = (value: float, dimension: float, borderWidth: float) => {\n return Math.max(0, Math.min(dimension / 2 - borderWidth, value));\n };\n\n /**\n * Shows a text input on the screen the player can type text into.\n */\n export class TextInputRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.TextContainer, gdjs.Resizable, gdjs.OpacityHandler\n {\n private _string: string;\n private _placeholder: string;\n private opacity: float = 255;\n private _width: float = DEFAULT_WIDTH;\n private _height: float = DEFAULT_HEIGHT;\n private _fontResourceName: string;\n private _fontSize: float;\n private _inputType: SupportedInputType;\n private _textColor: [float, float, float];\n private _fillColor: [float, float, float];\n private _fillOpacity: float;\n private _paddingX: integer;\n private _paddingY: integer;\n private _textAlign: SupportedTextAlign;\n private _maxLength: integer;\n private _borderColor: [float, float, float];\n private _borderOpacity: float;\n private _borderWidth: float;\n private _disabled: boolean;\n private _readOnly: boolean;\n private _isSubmitted: boolean;\n _renderer: TextInputRuntimeObjectRenderer;\n\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n objectData: TextInputObjectData\n ) {\n super(instanceContainer, objectData);\n\n this._string = objectData.content.initialValue;\n this._placeholder = objectData.content.placeholder;\n this._fontResourceName = objectData.content.fontResourceName;\n this._fontSize = objectData.content.fontSize || 20;\n this._inputType = parseInputType(objectData.content.inputType);\n this._textColor = gdjs.rgbOrHexToRGBColor(objectData.content.textColor);\n this._fillColor = gdjs.rgbOrHexToRGBColor(objectData.content.fillColor);\n this._fillOpacity = objectData.content.fillOpacity;\n this._borderColor = gdjs.rgbOrHexToRGBColor(\n objectData.content.borderColor\n );\n this._borderOpacity = objectData.content.borderOpacity;\n this._borderWidth = objectData.content.borderWidth;\n this._disabled = objectData.content.disabled;\n this._readOnly = objectData.content.readOnly;\n this._textAlign = parseTextAlign(objectData.content.textAlign);\n this._maxLength = objectData.content.maxLength || 0;\n this._paddingX =\n objectData.content.paddingX !== undefined\n ? objectData.content.paddingX\n : 2;\n this._paddingY =\n objectData.content.paddingY !== undefined\n ? objectData.content.paddingY\n : 1;\n this._isSubmitted = false;\n this._renderer = new gdjs.TextInputRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n getRendererObject() {\n return null;\n }\n\n updateFromObjectData(\n oldObjectData: TextInputObjectData,\n newObjectData: TextInputObjectData\n ): boolean {\n if (\n oldObjectData.content.initialValue !==\n newObjectData.content.initialValue\n ) {\n if (this._string === oldObjectData.content.initialValue) {\n this.setString(newObjectData.content.initialValue);\n }\n }\n if (\n oldObjectData.content.placeholder !== newObjectData.content.placeholder\n ) {\n this.setPlaceholder(newObjectData.content.placeholder);\n }\n if (\n oldObjectData.content.fontResourceName !==\n newObjectData.content.fontResourceName\n ) {\n this.setFontResourceName(newObjectData.content.fontResourceName);\n }\n if (oldObjectData.content.fontSize !== newObjectData.content.fontSize) {\n this.setFontSize(newObjectData.content.fontSize);\n }\n if (oldObjectData.content.inputType !== newObjectData.content.inputType) {\n this.setInputType(newObjectData.content.inputType);\n }\n if (oldObjectData.content.textColor !== newObjectData.content.textColor) {\n this.setTextColor(newObjectData.content.textColor);\n }\n if (oldObjectData.content.fillColor !== newObjectData.content.fillColor) {\n this.setFillColor(newObjectData.content.fillColor);\n }\n if (\n oldObjectData.content.fillOpacity !== newObjectData.content.fillOpacity\n ) {\n this.setFillOpacity(newObjectData.content.fillOpacity);\n }\n if (\n oldObjectData.content.borderColor !== newObjectData.content.borderColor\n ) {\n this.setBorderColor(newObjectData.content.borderColor);\n }\n if (\n oldObjectData.content.borderOpacity !==\n newObjectData.content.borderOpacity\n ) {\n this.setBorderOpacity(newObjectData.content.borderOpacity);\n }\n if (\n oldObjectData.content.borderWidth !== newObjectData.content.borderWidth\n ) {\n this.setBorderWidth(newObjectData.content.borderWidth);\n }\n if (oldObjectData.content.disabled !== newObjectData.content.disabled) {\n this.setDisabled(newObjectData.content.disabled);\n }\n if (oldObjectData.content.readOnly !== newObjectData.content.readOnly) {\n this.setReadOnly(newObjectData.content.readOnly);\n }\n if (\n newObjectData.content.maxLength !== undefined &&\n oldObjectData.content.maxLength !== newObjectData.content.maxLength\n ) {\n this.setMaxLength(newObjectData.content.maxLength);\n }\n if (\n newObjectData.content.textAlign &&\n oldObjectData.content.textAlign !== newObjectData.content.textAlign\n ) {\n this._textAlign = newObjectData.content.textAlign;\n }\n if (\n newObjectData.content.paddingX !== undefined &&\n oldObjectData.content.paddingX !== newObjectData.content.paddingX\n ) {\n this.setPaddingX(newObjectData.content.paddingX);\n }\n if (\n newObjectData.content.paddingY !== undefined &&\n oldObjectData.content.paddingY !== newObjectData.content.paddingY\n ) {\n this.setPaddingY(newObjectData.content.paddingY);\n }\n\n return true;\n }\n\n getNetworkSyncData(): TextInputNetworkSyncData {\n return {\n ...super.getNetworkSyncData(),\n opa: this.getOpacity(),\n wid: this.getWidth(),\n hei: this.getHeight(),\n txt: this.getText(),\n frn: this.getFontResourceName(),\n fs: this.getFontSize(),\n place: this.getPlaceholder(),\n it: this.getInputType(),\n tc: this.getTextColor(),\n fc: this.getFillColor(),\n fo: this.getFillOpacity(),\n bc: this.getBorderColor(),\n bo: this.getBorderOpacity(),\n bw: this.getBorderWidth(),\n dis: this.isDisabled(),\n ro: this.isReadOnly(),\n };\n }\n\n updateFromNetworkSyncData(syncData: TextInputNetworkSyncData): void {\n super.updateFromNetworkSyncData(syncData);\n\n if (syncData.opa !== undefined) this.setOpacity(syncData.opa);\n if (syncData.wid !== undefined) this.setWidth(syncData.wid);\n if (syncData.hei !== undefined) this.setHeight(syncData.hei);\n if (syncData.txt !== undefined) this.setText(syncData.txt);\n if (syncData.frn !== undefined) this.setFontResourceName(syncData.frn);\n if (syncData.fs !== undefined) this.setFontSize(syncData.fs);\n if (syncData.place !== undefined) this.setPlaceholder(syncData.place);\n if (syncData.it !== undefined) this.setInputType(syncData.it);\n if (syncData.tc !== undefined) this.setTextColor(syncData.tc);\n if (syncData.fc !== undefined) this.setFillColor(syncData.fc);\n if (syncData.fo !== undefined) this.setFillOpacity(syncData.fo);\n if (syncData.bc !== undefined) this.setBorderColor(syncData.bc);\n if (syncData.bo !== undefined) this.setBorderOpacity(syncData.bo);\n if (syncData.bw !== undefined) this.setBorderWidth(syncData.bw);\n if (syncData.dis !== undefined) this.setDisabled(syncData.dis);\n if (syncData.ro !== undefined) this.setReadOnly(syncData.ro);\n }\n\n updatePreRender(instanceContainer: RuntimeInstanceContainer): void {\n this._isSubmitted = false;\n this._renderer.updatePreRender();\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n for (const property of initialInstanceData.stringProperties) {\n if (property.name === 'initialValue') {\n this.setString(property.value);\n } else if (property.name === 'placeholder') {\n this.setPlaceholder(property.value);\n }\n }\n if (initialInstanceData.customSize) {\n this.setWidth(initialInstanceData.width);\n this.setHeight(initialInstanceData.height);\n this._renderer.updatePadding();\n }\n if (initialInstanceData.opacity !== undefined) {\n this.setOpacity(initialInstanceData.opacity);\n }\n }\n\n onScenePaused(runtimeScene: gdjs.RuntimeScene): void {\n this._renderer.onScenePaused();\n }\n\n onSceneResumed(runtimeScene: gdjs.RuntimeScene): void {\n this._renderer.onSceneResumed();\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.onDestroy();\n }\n\n setOpacity(opacity: float): void {\n this.opacity = Math.max(0, Math.min(255, opacity));\n this._renderer.updateOpacity();\n }\n\n getOpacity(): float {\n return this.opacity;\n }\n\n setSize(width: number, height: number): void {\n this.setWidth(width);\n this.setHeight(height);\n }\n\n setWidth(width: float): void {\n this._width = width;\n this._renderer.updatePadding();\n }\n\n setHeight(height: float): void {\n this._height = height;\n this._renderer.updatePadding();\n }\n\n /**\n * Return the width of the object.\n * @return The width of the object\n */\n getWidth(): float {\n return this._width;\n }\n\n /**\n * Return the width of the object.\n * @return The height of the object\n */\n getHeight(): float {\n return this._height;\n }\n\n /**\n * Get the text entered in the text input.\n * @deprecated use `getText` instead\n */\n getString() {\n return this.getText();\n }\n\n /**\n * Replace the text inside the text input.\n * @deprecated use `setText` instead\n */\n setString(text: string) {\n this.setText(text);\n }\n\n getText() {\n return this._string;\n }\n\n setText(newString: string) {\n if (newString === this._string) return;\n\n this._string = newString;\n this._renderer.updateString();\n }\n\n /**\n * Called by the renderer when the value of the input shown on the screen\n * was changed (because the user typed something).\n * This does not propagate back the value to the renderer, which would\n * result in the cursor being sent back to the end of the text.\n *\n * Do not use this if you are not inside the renderer - use `setString` instead.\n */\n onRendererInputValueChanged(inputValue: string) {\n this._string = inputValue;\n }\n\n onRendererFormSubmitted() {\n this._isSubmitted = true;\n }\n\n getFontResourceName() {\n return this._fontResourceName;\n }\n\n setFontResourceName(resourceName: string) {\n if (this._fontResourceName === resourceName) return;\n\n this._fontResourceName = resourceName;\n this._renderer.updateFont();\n }\n\n getFontSize() {\n return this._fontSize;\n }\n\n setFontSize(newSize: number) {\n this._fontSize = newSize;\n }\n\n /**\n * Get the placeholder shown when no text is entered\n */\n getPlaceholder() {\n return this._placeholder;\n }\n\n /**\n * Replace the text inside the text input.\n */\n setPlaceholder(newPlaceholder: string) {\n if (newPlaceholder === this._placeholder) return;\n\n this._placeholder = newPlaceholder;\n this._renderer.updatePlaceholder();\n }\n\n /**\n * Get the type of the input.\n */\n getInputType() {\n return this._inputType;\n }\n\n /**\n * Set the type of the input.\n */\n setInputType(newInputType: string) {\n const lowercasedNewInputType = newInputType.toLowerCase();\n if (lowercasedNewInputType === this._inputType) return;\n\n this._inputType = parseInputType(lowercasedNewInputType);\n this._renderer.updateInputType();\n }\n\n setTextColor(newColor: string) {\n this._textColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateTextColor();\n }\n\n getTextColor(): string {\n return (\n this._textColor[0] + ';' + this._textColor[1] + ';' + this._textColor[2]\n );\n }\n\n _getRawTextColor(): [float, float, float] {\n return this._textColor;\n }\n\n setFillColor(newColor: string) {\n this._fillColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateFillColorAndOpacity();\n }\n\n getFillColor(): string {\n return (\n this._fillColor[0] + ';' + this._fillColor[1] + ';' + this._fillColor[2]\n );\n }\n\n _getRawFillColor(): [float, float, float] {\n return this._fillColor;\n }\n\n setFillOpacity(newOpacity: float) {\n this._fillOpacity = Math.max(0, Math.min(255, newOpacity));\n this._renderer.updateFillColorAndOpacity();\n }\n\n getFillOpacity(): float {\n return this._fillOpacity;\n }\n\n setBorderColor(newColor: string) {\n this._borderColor = gdjs.rgbOrHexToRGBColor(newColor);\n this._renderer.updateBorderColorAndOpacity();\n }\n\n getBorderColor(): string {\n return (\n this._borderColor[0] +\n ';' +\n this._borderColor[1] +\n ';' +\n this._borderColor[2]\n );\n }\n\n _getRawBorderColor(): [float, float, float] {\n return this._borderColor;\n }\n\n setBorderOpacity(newOpacity: float) {\n this._borderOpacity = Math.max(0, Math.min(255, newOpacity));\n this._renderer.updateBorderColorAndOpacity();\n }\n\n getBorderOpacity(): float {\n return this._borderOpacity;\n }\n\n setBorderWidth(width: float) {\n this._borderWidth = Math.max(0, width);\n this._renderer.updateBorderWidth();\n }\n\n getBorderWidth(): float {\n return this._borderWidth;\n }\n\n setDisabled(value: boolean) {\n this._disabled = value;\n this._renderer.updateDisabled();\n }\n\n isDisabled(): boolean {\n return this._disabled;\n }\n\n setReadOnly(value: boolean) {\n this._readOnly = value;\n this._renderer.updateReadOnly();\n }\n\n isReadOnly(): boolean {\n return this._readOnly;\n }\n\n isFocused(): boolean {\n return this._renderer.isFocused();\n }\n isSubmitted(): boolean {\n return this._isSubmitted;\n }\n\n getMaxLength(): integer {\n return this._maxLength;\n }\n setMaxLength(value: integer) {\n if (this._maxLength === value) return;\n\n this._maxLength = value;\n this._renderer.updateMaxLength();\n }\n\n getPaddingX(): integer {\n return clampPadding(this._paddingX, this._width, this._borderWidth);\n }\n setPaddingX(value: integer) {\n if (this._paddingX === value) return;\n if (value < 0) {\n this._paddingX = 0;\n return;\n }\n\n this._paddingX = value;\n this._renderer.updatePadding();\n }\n getPaddingY(): integer {\n return clampPadding(this._paddingY, this._height, this._borderWidth);\n }\n setPaddingY(value: integer) {\n if (this._paddingY === value) return;\n if (value < 0) {\n this._paddingY = 0;\n return;\n }\n\n this._paddingY = value;\n this._renderer.updatePadding();\n }\n\n getTextAlign(): SupportedTextAlign {\n return this._textAlign;\n }\n\n setTextAlign(newTextAlign: string) {\n const parsedTextAlign = parseTextAlign(newTextAlign);\n if (parsedTextAlign === this._textAlign) return;\n\n this._textAlign = parsedTextAlign;\n this._renderer.updateTextAlign();\n }\n\n focus(): void {\n if (!this.isFocused()) {\n // If the input was not previously focused, reset input manager because there is\n // no reason to maintain its state. It avoids bugs where a key is pressed, the text\n // input is focused and then the input manager does not have access to the keyup event\n // and considers the key still pressed.\n this.getInstanceContainer()\n .getGame()\n .getInputManager()\n .clearAllPressedKeys();\n }\n this._renderer.focus();\n }\n }\n gdjs.registerObject(\n 'TextInput::TextInputObject',\n gdjs.TextInputRuntimeObject\n );\n}\n"],
5
+ "mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CACE,KAAM,GAAsB,CAC1B,OACA,QACA,WACA,SACA,mBACA,MACA,SACA,aAEI,EAAqB,CAAC,OAAQ,SAAU,SAIxC,EAAiB,AAAC,GAAmD,CACzE,KAAM,GAAyB,EAAmB,cAGlD,MAAI,GAAoB,SAAS,GACxB,EAEF,QAGH,EAAiB,AACrB,GACuB,CACvB,GAAI,CAAC,EAAoB,MAAO,OAChC,KAAM,GAAyB,EAAmB,cAGlD,MAAI,GAAmB,SAAS,GACvB,EAEF,QAmDH,EAAgB,IAChB,EAAiB,GAEjB,EAAe,CAAC,EAAc,EAAkB,IAC7C,KAAK,IAAI,EAAG,KAAK,IAAI,EAAY,EAAI,EAAa,IAMpD,eACG,GAAK,aAEf,CAwBE,YACE,EACA,EACA,CACA,MAAM,EAAmB,GAzBnB,aAAiB,IACjB,YAAgB,EAChB,aAAiB,EAyBvB,KAAK,QAAU,EAAW,QAAQ,aAClC,KAAK,aAAe,EAAW,QAAQ,YACvC,KAAK,kBAAoB,EAAW,QAAQ,iBAC5C,KAAK,UAAY,EAAW,QAAQ,UAAY,GAChD,KAAK,WAAa,EAAe,EAAW,QAAQ,WACpD,KAAK,WAAa,EAAK,mBAAmB,EAAW,QAAQ,WAC7D,KAAK,WAAa,EAAK,mBAAmB,EAAW,QAAQ,WAC7D,KAAK,aAAe,EAAW,QAAQ,YACvC,KAAK,aAAe,EAAK,mBACvB,EAAW,QAAQ,aAErB,KAAK,eAAiB,EAAW,QAAQ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AAK,YAE7B,MAAK,WAAa,EAClB,KAAK,UAAU,mBAGjB,OAAc,CACZ,AAAK,KAAK,aAKR,KAAK,uBACF,UACA,kBACA,sBAEL,KAAK,UAAU,SA9hBZ,EAAM,yBAiiBb,EAAK,eACH,6BACA,EAAK,0BAnoBC",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/TextObject/textruntimeobject-pixi-renderer.ts"],
4
- "sourcesContent": ["namespace gdjs {\n class TextRuntimeObjectPixiRenderer {\n _object: gdjs.TextRuntimeObject;\n _fontManager: any;\n _text: PIXI.Text;\n _justCreated: boolean = true;\n\n constructor(\n runtimeObject: gdjs.TextRuntimeObject,\n instanceContainer: gdjs.RuntimeInstanceContainer\n ) {\n this._object = runtimeObject;\n this._fontManager = instanceContainer.getGame().getFontManager();\n this._text = new PIXI.Text(' ', { align: 'left' });\n this._text.anchor.x = 0.5;\n this._text.anchor.y = 0.5;\n instanceContainer\n .getLayer('')\n .getRenderer()\n .addRendererObject(this._text, runtimeObject.getZOrder());\n this._text.text =\n runtimeObject._str.length === 0 ? ' ' : runtimeObject._str;\n\n //Work around a PIXI.js bug. See updateTime method.\n this.updateStyle();\n this.updatePosition();\n }\n\n getRendererObject() {\n return this._text;\n }\n\n ensureUpToDate() {\n if (this._justCreated) {\n //Work around a PIXI.js bug:\n this._text.updateText(false);\n\n //Width seems not to be correct when text is not rendered yet.\n this.updatePosition();\n this._justCreated = false;\n }\n }\n\n updateStyle(): void {\n const fontName =\n '\"' + this._fontManager.getFontFamily(this._object._fontName) + '\"';\n const style = this._text.style;\n style.fontStyle = this._object._italic ? 'italic' : 'normal';\n style.fontWeight = this._object._bold ? 'bold' : 'normal';\n style.fontSize = this._object._characterSize;\n style.fontFamily = fontName;\n if (this._object._useGradient) {\n style.fill = this._getGradientHex();\n } else {\n style.fill = this._getColorHex();\n }\n if (this._object._gradientType === 'LINEAR_VERTICAL') {\n style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_VERTICAL;\n } else {\n style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_HORIZONTAL;\n }\n // @ts-ignore\n style.align = this._object._textAlign;\n style.wordWrap = this._object._wrapping;\n style.wordWrapWidth = this._object._wrappingWidth;\n style.breakWords = true;\n style.stroke = gdjs.rgbToHexNumber(\n this._object._outlineColor[0],\n this._object._outlineColor[1],\n this._object._outlineColor[2]\n );\n style.strokeThickness = this._object._isOutlineEnabled\n ? this._object._outlineThickness\n : 0;\n style.dropShadow = this._object._shadow;\n style.dropShadowColor = gdjs.rgbToHexNumber(\n this._object._shadowColor[0],\n this._object._shadowColor[1],\n this._object._shadowColor[2]\n );\n style.dropShadowAlpha = this._object._shadowOpacity / 255;\n style.dropShadowBlur = this._object._shadowBlur;\n style.dropShadowAngle = gdjs.toRad(this._object._shadowAngle);\n style.dropShadowDistance = this._object._shadowDistance;\n const extraPaddingForShadow = style.dropShadow\n ? style.dropShadowDistance + style.dropShadowBlur\n : 0;\n style.padding = Math.ceil(this._object._padding + extraPaddingForShadow);\n\n // Prevent spikey outlines by adding a miter limit\n style.miterLimit = 3;\n this.updatePosition();\n\n // Manually ask the PIXI object to re-render as we changed a style property\n // see http://www.html5gamedevs.com/topic/16924-change-text-style-post-render/\n // @ts-ignore\n this._text.dirty = true;\n }\n\n updatePosition(): void {\n if (this._object.isWrapping()) {\n const alignmentX =\n this._object._textAlign === 'right'\n ? 1\n : this._object._textAlign === 'center'\n ? 0.5\n : 0;\n\n const width = this._object.getWrappingWidth();\n\n // A vector from the custom size center to the renderer center.\n const centerToCenterX = (width - this._text.width) * (alignmentX - 0.5);\n\n this._text.position.x = this._object.x + width / 2;\n this._text.anchor.x = 0.5 - centerToCenterX / this._text.width;\n } else {\n this._text.position.x = this._object.x + this._text.width / 2;\n this._text.anchor.x = 0.5;\n }\n this._text.position.y = this._object.y + this._text.height / 2;\n\n const alignmentY =\n this._object._verticalTextAlignment === 'bottom'\n ? 1\n : this._object._verticalTextAlignment === 'center'\n ? 0.5\n : 0;\n this._text.position.y =\n this._object.y + this._text.height * (0.5 - alignmentY);\n this._text.anchor.y = 0.5;\n }\n\n updateAngle(): void {\n this._text.rotation = gdjs.toRad(this._object.angle);\n }\n\n updateOpacity(): void {\n this._text.alpha = this._object.opacity / 255;\n }\n\n updateString(): void {\n this._text.text =\n this._object._str.length === 0 ? ' ' : this._object._str;\n\n //Work around a PIXI.js bug.\n this._text.updateText(false);\n }\n\n getWidth(): float {\n return this._text.width;\n }\n\n getHeight(): float {\n return this._text.height;\n }\n\n _getColorHex() {\n return gdjs.rgbToHexNumber(\n this._object._color[0],\n this._object._color[1],\n this._object._color[2]\n );\n }\n\n _getGradientHex() {\n const gradient: Array<string> = [];\n for (\n let colorIndex = 0;\n colorIndex < this._object._gradient.length;\n colorIndex++\n ) {\n gradient.push(\n '#' +\n gdjs.rgbToHex(\n this._object._gradient[colorIndex][0],\n this._object._gradient[colorIndex][1],\n this._object._gradient[colorIndex][2]\n )\n );\n }\n return gradient;\n }\n\n /**\n * Get x-scale of the text.\n */\n getScaleX(): float {\n return this._text.scale.x;\n }\n\n /**\n * Get y-scale of the text.\n */\n getScaleY(): float {\n return this._text.scale.y;\n }\n\n /**\n * Set the text object scale.\n * @param newScale The new scale for the text object.\n */\n setScale(newScale: float): void {\n this._text.scale.x = newScale;\n this._text.scale.y = newScale;\n }\n\n /**\n * Set the text object x-scale.\n * @param newScale The new x-scale for the text object.\n */\n setScaleX(newScale: float): void {\n this._text.scale.x = newScale;\n }\n\n /**\n * Set the text object y-scale.\n * @param newScale The new y-scale for the text object.\n */\n setScaleY(newScale: float): void {\n this._text.scale.y = newScale;\n }\n\n destroy() {\n this._text.destroy(true);\n }\n }\n\n // Register the class to let the engine use it.\n export const TextRuntimeObjectRenderer = TextRuntimeObjectPixiRenderer;\n export type TextRuntimeObjectRenderer = TextRuntimeObjectPixiRenderer;\n}\n"],
5
- "mappings": "AAAA,GAAU,MAAV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M,KACT,KAAK,QAAQ,KAAK,SAAW,EAAI,IAAM,KAAK,QAAQ,KAGtD,KAAK,MAAM,WAAW,IAGxB,UAAkB,CAChB,MAAO,MAAK,MAAM,MAGpB,WAAmB,CACjB,MAAO,MAAK,MAAM,OAGpB,cAAe,CACb,MAAO,GAAK,eACV,KAAK,QAAQ,OAAO,GACpB,KAAK,QAAQ,OAAO,GACpB,KAAK,QAAQ,OAAO,IAIxB,iBAAkB,CAChB,KAAM,GAA0B,GAChC,OACM,GAAa,EACjB,EAAa,KAAK,QAAQ,UAAU,OACpC,IAEA,EAAS,KACP,IACE,EAAK,SACH,KAAK,QAAQ,UAAU,GAAY,GACnC,KAAK,QAAQ,UAAU,GAAY,GACnC,KAAK,QAAQ,UAAU,GAAY,KAI3C,MAAO,GAMT,WAAmB,CACjB,MAAO,MAAK,MAAM,MAAM,EAM1B,WAAmB,CACjB,MAAO,MAAK,MAAM,MAAM,EAO1B,SAAS,EAAuB,CAC9B,KAAK,MAAM,MAAM,EAAI,EACrB,KAAK,MAAM,MAAM,EAAI,EAOvB,UAAU,EAAuB,CAC/B,KAAK,MAAM,MAAM,EAAI,EAOvB,UAAU,EAAuB,CAC/B,KAAK,MAAM,MAAM,EAAI,EAGvB,SAAU,CACR,KAAK,MAAM,QAAQ,KAKhB,AAAM,4BAA4B,IApOjC",
4
+ "sourcesContent": ["namespace gdjs {\n class TextRuntimeObjectPixiRenderer {\n _object: gdjs.TextRuntimeObject;\n _fontManager: any;\n _text: PIXI.Text;\n _justCreated: boolean = true;\n\n constructor(\n runtimeObject: gdjs.TextRuntimeObject,\n instanceContainer: gdjs.RuntimeInstanceContainer\n ) {\n this._object = runtimeObject;\n this._fontManager = instanceContainer.getGame().getFontManager();\n this._text = new PIXI.Text(' ', { align: 'left' });\n this._text.anchor.x = 0.5;\n this._text.anchor.y = 0.5;\n instanceContainer\n .getLayer('')\n .getRenderer()\n .addRendererObject(this._text, runtimeObject.getZOrder());\n this._text.text =\n runtimeObject._str.length === 0 ? ' ' : runtimeObject._str;\n\n //Work around a PIXI.js bug. See updateTime method.\n this.updateStyle();\n this.updatePosition();\n }\n\n getRendererObject() {\n return this._text;\n }\n\n ensureUpToDate() {\n if (this._justCreated) {\n //Work around a PIXI.js bug:\n this._text.updateText(false);\n\n //Width seems not to be correct when text is not rendered yet.\n this.updatePosition();\n this._justCreated = false;\n }\n }\n\n updateStyle(): void {\n const fontName =\n '\"' + this._fontManager.getFontFamily(this._object._fontName) + '\"';\n const style = this._text.style;\n style.fontStyle = this._object._italic ? 'italic' : 'normal';\n style.fontWeight = this._object._bold ? 'bold' : 'normal';\n style.fontSize = this._object._characterSize;\n style.fontFamily = fontName;\n if (this._object._useGradient) {\n style.fill = this._getGradientHex();\n } else {\n style.fill = this._getColorHex();\n }\n if (this._object._gradientType === 'LINEAR_VERTICAL') {\n style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_VERTICAL;\n } else {\n style.fillGradientType = PIXI.TEXT_GRADIENT.LINEAR_HORIZONTAL;\n }\n // @ts-ignore\n style.align = this._object._textAlign;\n style.wordWrap = this._object._wrapping;\n style.wordWrapWidth = this._object._wrappingWidth;\n style.breakWords = true;\n style.stroke = gdjs.rgbToHexNumber(\n this._object._outlineColor[0],\n this._object._outlineColor[1],\n this._object._outlineColor[2]\n );\n style.strokeThickness = this._object._isOutlineEnabled\n ? this._object._outlineThickness\n : 0;\n style.dropShadow = this._object._shadow;\n style.dropShadowColor = gdjs.rgbToHexNumber(\n this._object._shadowColor[0],\n this._object._shadowColor[1],\n this._object._shadowColor[2]\n );\n style.dropShadowAlpha = this._object._shadowOpacity / 255;\n style.dropShadowBlur = this._object._shadowBlur;\n style.dropShadowAngle = gdjs.toRad(this._object._shadowAngle);\n style.dropShadowDistance = this._object._shadowDistance;\n const extraPaddingForShadow = style.dropShadow\n ? style.dropShadowDistance + style.dropShadowBlur\n : 0;\n style.padding = Math.ceil(this._object._padding + extraPaddingForShadow);\n\n // Prevent spikey outlines by adding a miter limit\n style.miterLimit = 3;\n this.updatePosition();\n\n // Manually ask the PIXI object to re-render as we changed a style property\n // see http://www.html5gamedevs.com/topic/16924-change-text-style-post-render/\n // @ts-ignore\n this._text.dirty = true;\n }\n\n updatePosition(): void {\n if (this._object.isWrapping()) {\n const alignmentX =\n this._object._textAlign === 'right'\n ? 1\n : this._object._textAlign === 'center'\n ? 0.5\n : 0;\n\n const width = this._object.getWrappingWidth();\n\n // A vector from the custom size center to the renderer center.\n const centerToCenterX = (width - this._text.width) * (alignmentX - 0.5);\n\n this._text.position.x = this._object.x + width / 2;\n this._text.anchor.x = 0.5 - centerToCenterX / this._text.width;\n } else {\n this._text.position.x = this._object.x + this._text.width / 2;\n this._text.anchor.x = 0.5;\n }\n this._text.position.y = this._object.y + this._text.height / 2;\n\n const alignmentY =\n this._object._verticalTextAlignment === 'bottom'\n ? 1\n : this._object._verticalTextAlignment === 'center'\n ? 0.5\n : 0;\n this._text.position.y =\n this._object.y + this._text.height * (0.5 - alignmentY);\n this._text.anchor.y = 0.5;\n }\n\n updateAngle(): void {\n this._text.rotation = gdjs.toRad(this._object.angle);\n }\n\n updateOpacity(): void {\n this._text.alpha = this._object.opacity / 255;\n }\n\n updateString(): void {\n this._text.text =\n this._object._str.length === 0 ? ' ' : this._object._str;\n\n //Work around a PIXI.js bug.\n this._text.updateText(false);\n }\n\n getWidth(): float {\n return this._text.width;\n }\n\n getHeight(): float {\n return this._text.height;\n }\n\n _getColorHex() {\n return gdjs.rgbToHexNumber(\n this._object._color[0],\n this._object._color[1],\n this._object._color[2]\n );\n }\n\n _getGradientHex() {\n const gradient: Array<string> = [];\n for (\n let colorIndex = 0;\n colorIndex < this._object._gradient.length;\n colorIndex++\n ) {\n gradient.push(\n '#' +\n gdjs.rgbToHex(\n this._object._gradient[colorIndex][0],\n this._object._gradient[colorIndex][1],\n this._object._gradient[colorIndex][2]\n )\n );\n }\n return gradient;\n }\n\n /**\n * Get x-scale of the text.\n */\n getScaleX(): float {\n return this._text.scale.x;\n }\n\n /**\n * Get y-scale of the text.\n */\n getScaleY(): float {\n return this._text.scale.y;\n }\n\n /**\n * Set the text object scale.\n * @param newScale The new scale for the text object.\n */\n setScale(newScale: float): void {\n this._text.scale.x = newScale;\n this._text.scale.y = newScale;\n }\n\n /**\n * Set the text object x-scale.\n * @param newScale The new x-scale for the text object.\n */\n setScaleX(newScale: float): void {\n this._text.scale.x = newScale;\n }\n\n /**\n * Set the text object y-scale.\n * @param newScale The new y-scale for the text object.\n */\n setScaleY(newScale: float): void {\n this._text.scale.y = newScale;\n }\n\n destroy() {\n this._text.destroy(true);\n }\n }\n\n // Register the class to let the engine use it.\n export const TextRuntimeObjectRenderer = TextRuntimeObjectPixiRenderer;\n export type TextRuntimeObjectRenderer = TextRuntimeObjectPixiRenderer;\n}\n"],
5
+ "mappings": "AAAA,GAAU,MAAV,UAAU,EAAV,CACE,OAAoC,CAMlC,YACE,EACA,EACA,CALF,kBAAwB,GAMtB,KAAK,QAAU,EACf,KAAK,aAAe,EAAkB,UAAU,iBAChD,KAAK,MAAQ,GAAI,MAAK,KAAK,IAAK,CAAE,MAAO,SACzC,KAAK,MAAM,OAAO,EAAI,GACtB,KAAK,MAAM,OAAO,EAAI,GACtB,EACG,SAAS,IACT,cACA,kBAAkB,KAAK,MAAO,EAAc,aAC/C,KAAK,MAAM,KACT,EAAc,KAAK,SAAW,EAAI,IAAM,EAAc,KAGxD,KAAK,cACL,KAAK,iBAGP,mBAAoB,CAClB,MAAO,MAAK,MAGd,gBAAiB,CACf,AAAI,KAAK,cAEP,MAAK,MAAM,WAAW,IAGtB,KAAK,iBACL,KAAK,aAAe,IAIxB,aAAoB,CAClB,KAAM,GACJ,IAAM,KAAK,aAAa,cAAc,KAAK,QAAQ,WAAa,IAC5D,EAAQ,KAAK,MAAM,MACzB,EAAM,UAAY,KAAK,QAAQ,QAAU,SAAW,SACpD,EAAM,WAAa,KAAK,QAAQ,MAAQ,OAAS,SACjD,EAAM,SAAW,KAAK,QAAQ,eAC9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AOvB,UAAU,EAAuB,CAC/B,KAAK,MAAM,MAAM,EAAI,EAGvB,SAAU,CACR,KAAK,MAAM,QAAQ,KAKhB,AAAM,4BAA4B,IApOjC",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/TextObject/textruntimeobject.ts"],
4
- "sourcesContent": ["/*\n * GDevelop JS Platform\n * 2013-2016 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n /** Base parameters for gdjs.TextRuntimeObject */\n export type TextObjectDataType = {\n content: {\n /** The size of the characters */\n characterSize: number;\n /** The font name */\n font: string;\n /** Is Bold? */\n bold: boolean;\n /** Is Italic? */\n italic: boolean;\n /** Is Underlined? */\n underlined: boolean;\n /** The text color in an RGB representation */\n color: string;\n /** The text of the object */\n text: string;\n textAlignment: string;\n verticalTextAlignment: string;\n\n isOutlineEnabled: boolean;\n outlineThickness: float;\n /** The outline color in an RGB representation */\n outlineColor: string;\n isShadowEnabled: boolean;\n /** The shadow color in an RGB representation */\n shadowColor: string;\n shadowOpacity: float;\n shadowDistance: float;\n shadowAngle: float;\n shadowBlurRadius: float;\n };\n };\n\n export type TextObjectData = ObjectData & TextObjectDataType;\n\n export type TextObjectNetworkSyncDataType = {\n str: string;\n o: float;\n cs: number;\n fn: string;\n b: boolean;\n i: boolean;\n u: boolean;\n c: number[];\n scale: number;\n ta: string;\n wrap: boolean;\n wrapw: float;\n oena: boolean;\n ot: float;\n oc: number[];\n sh: boolean;\n shc: number[];\n sho: float;\n shd: float;\n sha: float;\n shb: float;\n pad: integer;\n };\n\n export type TextObjectNetworkSyncData = ObjectNetworkSyncData &\n TextObjectNetworkSyncDataType;\n\n /**\n * Displays a text.\n */\n export class TextRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.TextContainer, gdjs.OpacityHandler {\n _characterSize: number;\n _fontName: string;\n _bold: boolean;\n _italic: boolean;\n _underlined: boolean;\n _color: integer[];\n _useGradient: boolean = false;\n _gradient: Array<Array<integer>> = [];\n _gradientType: string = '';\n opacity: float = 255;\n _textAlign: string;\n _verticalTextAlignment: string;\n _wrapping: boolean = false;\n // A wrapping of 1 makes games crash on Firefox\n _wrappingWidth: float = 100;\n\n _isOutlineEnabled: boolean;\n _outlineThickness: float;\n _outlineColor: integer[];\n\n _shadow: boolean;\n _shadowColor: integer[];\n _shadowOpacity: float;\n _shadowDistance: float;\n _shadowAngle: float;\n _shadowBlur: float;\n\n _padding: integer = 5;\n _str: string;\n _renderer: gdjs.TextRuntimeObjectRenderer;\n\n // We can store the scale as nothing else can change it.\n _scaleX: number = 1;\n _scaleY: number = 1;\n\n /**\n * @param instanceContainer The container the object belongs to.\n * @param textObjectData The initial properties of the object\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n textObjectData: TextObjectData\n ) {\n super(instanceContainer, textObjectData);\n const content = textObjectData.content;\n this._characterSize = Math.max(1, content.characterSize);\n this._fontName = content.font;\n this._bold = content.bold;\n this._italic = content.italic;\n this._underlined = content.underlined;\n this._color = gdjs.rgbOrHexToRGBColor(content.color);\n this._str = content.text;\n this._textAlign = content.textAlignment || 'left';\n this._verticalTextAlignment = content.verticalTextAlignment || 'top';\n\n this._isOutlineEnabled = content.isOutlineEnabled;\n this._outlineThickness = content.outlineThickness;\n this._outlineColor = gdjs.rgbOrHexToRGBColor(content.outlineColor);\n\n this._shadow = content.isShadowEnabled;\n this._shadowColor = gdjs.rgbOrHexToRGBColor(content.shadowColor);\n this._shadowOpacity = content.shadowOpacity;\n this._shadowDistance = content.shadowDistance;\n this._shadowBlur = content.shadowBlurRadius;\n this._shadowAngle = content.shadowAngle;\n\n this._renderer = new gdjs.TextRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n updateFromObjectData(\n oldObjectData: TextObjectData,\n newObjectData: TextObjectData\n ): boolean {\n const oldContent = oldObjectData.content;\n const newContent = newObjectData.content;\n if (oldContent.characterSize !== newContent.characterSize) {\n this.setCharacterSize(newContent.characterSize);\n }\n if (oldContent.font !== newContent.font) {\n this.setFontName(newContent.font);\n }\n if (oldContent.bold !== newContent.bold) {\n this.setBold(newContent.bold);\n }\n if (oldContent.italic !== newContent.italic) {\n this.setItalic(newContent.italic);\n }\n if (oldContent.color !== newContent.color) {\n this.setColor(newContent.color);\n }\n if (oldContent.text !== newContent.text) {\n this.setText(newContent.text);\n }\n if (oldContent.underlined !== newContent.underlined) {\n return false;\n }\n if (oldContent.textAlignment !== newContent.textAlignment) {\n this.setTextAlignment(newContent.textAlignment);\n }\n if (\n oldContent.verticalTextAlignment !== newContent.verticalTextAlignment\n ) {\n this.setVerticalTextAlignment(newContent.verticalTextAlignment);\n }\n if (oldContent.isOutlineEnabled !== newContent.isOutlineEnabled) {\n this.setOutlineEnabled(newContent.isOutlineEnabled);\n }\n if (oldContent.outlineThickness !== newContent.outlineThickness) {\n this.setOutlineThickness(newContent.outlineThickness);\n }\n if (oldContent.outlineColor !== newContent.outlineColor) {\n this.setOutlineColor(newContent.outlineColor);\n }\n if (oldContent.isShadowEnabled !== newContent.isShadowEnabled) {\n this.showShadow(newContent.isShadowEnabled);\n }\n if (oldContent.shadowColor !== newContent.shadowColor) {\n this.setShadowColor(newContent.shadowColor);\n }\n if (oldContent.shadowOpacity !== newContent.shadowOpacity) {\n this.setShadowOpacity(newContent.shadowOpacity);\n }\n if (oldContent.shadowDistance !== newContent.shadowDistance) {\n this.setShadowDistance(newContent.shadowDistance);\n }\n if (oldContent.shadowAngle !== newContent.shadowAngle) {\n this.setShadowAngle(newContent.shadowAngle);\n }\n if (oldContent.shadowBlurRadius !== newContent.shadowBlurRadius) {\n this.setShadowBlurRadius(newContent.shadowBlurRadius);\n }\n return true;\n }\n\n getNetworkSyncData(): TextObjectNetworkSyncData {\n return {\n ...super.getNetworkSyncData(),\n str: this._str,\n o: this.opacity,\n cs: this._characterSize,\n fn: this._fontName,\n b: this._bold,\n i: this._italic,\n u: this._underlined,\n c: this._color,\n scale: this.getScale(),\n ta: this._textAlign,\n wrap: this._wrapping,\n wrapw: this._wrappingWidth,\n oena: this._isOutlineEnabled,\n ot: this._outlineThickness,\n oc: this._outlineColor,\n sh: this._shadow,\n shc: this._shadowColor,\n sho: this._shadowOpacity,\n shd: this._shadowDistance,\n sha: this._shadowAngle,\n shb: this._shadowBlur,\n pad: this._padding,\n };\n }\n\n updateFromNetworkSyncData(\n networkSyncData: TextObjectNetworkSyncData\n ): void {\n super.updateFromNetworkSyncData(networkSyncData);\n if (networkSyncData.str !== undefined) {\n this.setText(networkSyncData.str);\n }\n if (networkSyncData.o !== undefined) {\n this.setOpacity(networkSyncData.o);\n }\n if (networkSyncData.cs !== undefined) {\n this.setCharacterSize(networkSyncData.cs);\n }\n if (networkSyncData.fn !== undefined) {\n this.setFontName(networkSyncData.fn);\n }\n if (networkSyncData.b !== undefined) {\n this.setBold(networkSyncData.b);\n }\n if (networkSyncData.i !== undefined) {\n this.setItalic(networkSyncData.i);\n }\n if (networkSyncData.u !== undefined) {\n this._underlined = networkSyncData.u;\n }\n if (networkSyncData.c !== undefined) {\n this._color = networkSyncData.c;\n }\n if (networkSyncData.scale !== undefined) {\n this.setScale(networkSyncData.scale);\n }\n if (networkSyncData.ta !== undefined) {\n this.setTextAlignment(networkSyncData.ta);\n }\n if (networkSyncData.ta !== undefined) {\n this.setVerticalTextAlignment(networkSyncData.ta);\n }\n if (networkSyncData.wrap !== undefined) {\n this.setWrapping(networkSyncData.wrap);\n }\n if (networkSyncData.wrapw !== undefined) {\n this.setWrappingWidth(networkSyncData.wrapw);\n }\n if (networkSyncData.oena !== undefined) {\n this.setOutlineEnabled(networkSyncData.oena);\n }\n if (networkSyncData.ot !== undefined) {\n this.setOutlineThickness(networkSyncData.ot);\n }\n if (networkSyncData.oc !== undefined) {\n this._outlineColor = networkSyncData.oc;\n }\n if (networkSyncData.sh !== undefined) {\n this.showShadow(networkSyncData.sh);\n }\n if (networkSyncData.shc !== undefined) {\n this._shadowColor = networkSyncData.shc;\n }\n if (networkSyncData.sho !== undefined) {\n this.setShadowOpacity(networkSyncData.sho);\n }\n if (networkSyncData.shd !== undefined) {\n this.setShadowDistance(networkSyncData.shd);\n }\n if (networkSyncData.sha !== undefined) {\n this.setShadowAngle(networkSyncData.sha);\n }\n if (networkSyncData.shb !== undefined) {\n this.setShadowBlurRadius(networkSyncData.shb);\n }\n if (networkSyncData.pad !== undefined) {\n this.setPadding(networkSyncData.pad);\n }\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n update(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._renderer.ensureUpToDate();\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.destroy();\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n if (initialInstanceData.customSize) {\n this.setWrappingWidth(initialInstanceData.width);\n this.setWrapping(true);\n } else {\n this.setWrapping(false);\n }\n if (initialInstanceData.opacity !== undefined) {\n this.setOpacity(initialInstanceData.opacity);\n }\n }\n\n /**\n * Update the rendered object position.\n */\n private _updateTextPosition() {\n this.invalidateHitboxes();\n this._renderer.updatePosition();\n }\n\n /**\n * Set object position on X axis.\n */\n setX(x: float): void {\n super.setX(x);\n this._updateTextPosition();\n }\n\n /**\n * Set object position on Y axis.\n */\n setY(y: float): void {\n super.setY(y);\n this._updateTextPosition();\n }\n\n /**\n * Set the angle of the object.\n * @param angle The new angle of the object\n */\n setAngle(angle: float): void {\n super.setAngle(angle);\n this._renderer.updateAngle();\n }\n\n /**\n * Set object opacity.\n */\n setOpacity(opacity: float): void {\n if (opacity < 0) {\n opacity = 0;\n }\n if (opacity > 255) {\n opacity = 255;\n }\n this.opacity = opacity;\n this._renderer.updateOpacity();\n }\n\n /**\n * Get object opacity.\n */\n getOpacity() {\n return this.opacity;\n }\n\n /**\n * Get the string displayed by the object.\n * @deprecated use `getText` instead\n */\n getString(): string {\n return this.getText();\n }\n\n /**\n * Set the string displayed by the object.\n * @param text The new text\n * @deprecated use `setText` instead\n */\n setString(text: string): void {\n this.setText(text);\n }\n\n /**\n * Get the string displayed by the object.\n */\n getText(): string {\n return this._str;\n }\n\n /**\n * Set the string displayed by the object.\n * @param text The new text\n */\n setText(text: string): void {\n if (text === this._str) {\n return;\n }\n this._str = text;\n this._renderer.updateString();\n this._updateTextPosition();\n }\n\n /**\n * Get the font size of the characters of the object.\n */\n getCharacterSize(): number {\n return this._characterSize;\n }\n\n /**\n * Set the font size for characters of the object.\n * @param newSize The new font size for the text.\n */\n setCharacterSize(newSize: number): void {\n if (newSize <= 1) {\n newSize = 1;\n }\n this._characterSize = newSize;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the name of the resource to use for the font.\n * @param fontResourceName The name of the font resource.\n */\n setFontName(fontResourceName: string): void {\n this._fontName = fontResourceName;\n this._renderer.updateStyle();\n }\n\n /**\n * Return true if the text is bold.\n */\n isBold(): boolean {\n return this._bold;\n }\n\n /**\n * Set bold for the object text.\n * @param enable {boolean} true to have a bold text, false otherwise.\n */\n setBold(enable: boolean): void {\n this._bold = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Return true if the text is italic.\n */\n isItalic(): boolean {\n return this._italic;\n }\n\n /**\n * Set italic for the object text.\n * @param enable {boolean} true to have an italic text, false otherwise.\n */\n setItalic(enable: boolean): void {\n this._italic = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get width of the text.\n */\n getWidth(): float {\n return this._wrapping ? this._wrappingWidth : this._renderer.getWidth();\n }\n\n /**\n * Get height of the text.\n */\n getHeight(): float {\n return this._renderer.getHeight();\n }\n\n /**\n * Get the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).\n *\n * @return the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).\n * @deprecated Use `getScale` instead.\n */\n getScaleMean(): float {\n return (Math.abs(this._scaleX) + Math.abs(this._scaleY)) / 2.0;\n }\n\n /**\n * Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).\n *\n * @return the scale of the object (or the geometric mean of the X and Y scale in case they are different).\n */\n getScale(): float {\n const scaleX = Math.abs(this._scaleX);\n const scaleY = Math.abs(this._scaleY);\n return scaleX === scaleY ? scaleX : Math.sqrt(scaleX * scaleY);\n }\n\n /**\n * Get x-scale of the text.\n */\n getScaleX(): float {\n return this._scaleX;\n }\n\n /**\n * Get y-scale of the text.\n */\n getScaleY(): float {\n return this._scaleY;\n }\n\n /**\n * Set the text object scale.\n * @param newScale The new scale for the text object.\n */\n setScale(newScale: float): void {\n if (this._scaleX === newScale && this._scaleY === newScale) return;\n\n this._scaleX = newScale;\n this._scaleY = newScale;\n this._renderer.setScale(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the text object x-scale.\n * @param newScale The new x-scale for the text object.\n */\n setScaleX(newScale: float): void {\n if (this._scaleX === newScale) return;\n\n this._scaleX = newScale;\n this._renderer.setScaleX(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the text object y-scale.\n * @param newScale The new y-scale for the text object.\n */\n setScaleY(newScale: float): void {\n if (this._scaleY === newScale) return;\n\n this._scaleY = newScale;\n this._renderer.setScaleY(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Change the text color.\n * @param color color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setColor(str: string): void {\n const color = str.split(';');\n if (color.length < 3) {\n return;\n }\n this._color[0] = parseInt(color[0], 10);\n this._color[1] = parseInt(color[1], 10);\n this._color[2] = parseInt(color[2], 10);\n this._useGradient = false;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text color.\n * @return The color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n getColor(): string {\n return this._color[0] + ';' + this._color[1] + ';' + this._color[2];\n }\n\n /**\n * Set the text alignment on Y axis for multiline text objects.\n * @param alignment The text alignment.\n */\n setVerticalTextAlignment(alignment: string): void {\n this._verticalTextAlignment = alignment;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text alignment on Y axis of text object.\n * @return The text alignment.\n */\n getVerticalTextAlignment(): string {\n return this._verticalTextAlignment;\n }\n\n /**\n * Set the text alignment for multiline text objects.\n * @param alignment The text alignment.\n */\n setTextAlignment(alignment: string): void {\n this._textAlign = alignment;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text alignment of text object.\n * @return The text alignment.\n */\n getTextAlignment(): string {\n return this._textAlign;\n }\n\n /**\n * Return true if word wrapping is enabled for the text.\n */\n isWrapping(): boolean {\n return this._wrapping;\n }\n\n /**\n * Set word wrapping for the object text.\n * @param enable true to enable word wrapping, false to disable it.\n */\n setWrapping(enable: boolean): void {\n if (this._wrapping === enable) return;\n\n this._wrapping = enable;\n this._renderer.updateStyle();\n this.invalidateHitboxes();\n }\n\n /**\n * Get the word wrapping width for the text object.\n */\n getWrappingWidth(): float {\n return this._wrappingWidth;\n }\n\n /**\n * Set the word wrapping width for the text object.\n * @param width The new width to set.\n */\n setWrappingWidth(width: float): void {\n if (width <= 1) {\n width = 1;\n }\n if (this._wrappingWidth === width) {\n return;\n }\n this._wrappingWidth = width;\n\n if (this._wrapping) {\n this._renderer.updateStyle();\n this.invalidateHitboxes();\n }\n }\n\n setWidth(width: float): void {\n this.setWrappingWidth(width);\n }\n\n getDrawableY(): float {\n return (\n this.getY() -\n (this._verticalTextAlignment === 'center'\n ? this.getHeight() / 2\n : this._verticalTextAlignment === 'bottom'\n ? this.getHeight()\n : 0)\n );\n }\n\n /**\n * Set the outline for the text object.\n * @param str color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param thickness thickness of the outline (0 = disabled)\n * @deprecated Prefer independent setters.\n */\n setOutline(str: string, thickness: number): void {\n const color = str.split(';');\n if (color.length < 3) {\n return;\n }\n this._outlineColor[0] = parseInt(color[0], 10);\n this._outlineColor[1] = parseInt(color[1], 10);\n this._outlineColor[2] = parseInt(color[2], 10);\n this._outlineThickness = thickness;\n this._renderer.updateStyle();\n }\n\n isOutlineEnabled(): boolean {\n return this._isOutlineEnabled;\n }\n\n setOutlineEnabled(enable: boolean): void {\n this._isOutlineEnabled = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the outline thickness of the text object.\n * @return the outline thickness\n */\n getOutlineThickness(): number {\n return this._outlineThickness;\n }\n\n /**\n * Set the outline thickness of the text object.\n * @param value the outline thickness\n */\n setOutlineThickness(value: float): void {\n this._outlineThickness = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow color of the text object.\n * @param color the shadow color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setOutlineColor(color: string): void {\n this._outlineColor = gdjs.rgbOrHexToRGBColor(color);\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow for the text object.\n * @param str color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param distance distance between the shadow and the text, in pixels.\n * @param blur amount of shadow blur, in pixels.\n * @param angle shadow offset direction, in degrees.\n * @deprecated Prefer independent setters.\n */\n setShadow(\n str: string,\n distance: number,\n blur: integer,\n angle: float\n ): void {\n const color = str.split(';');\n if (color.length < 3) {\n return;\n }\n this._shadowColor[0] = parseInt(color[0], 10);\n this._shadowColor[1] = parseInt(color[1], 10);\n this._shadowColor[2] = parseInt(color[2], 10);\n this._shadowDistance = distance;\n this._shadowBlur = blur;\n this._shadowAngle = angle;\n this._shadow = true;\n this._renderer.updateStyle();\n }\n\n isShadowEnabled(): boolean {\n return this._shadow;\n }\n\n /**\n * Show the shadow of the text object.\n * @param enable true to show the shadow, false to hide it\n */\n showShadow(enable: boolean): void {\n this._shadow = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow opacity of the text object.\n * @return the opacity (0 - 255)\n */\n getShadowOpacity(): number {\n return this._shadowOpacity;\n }\n\n /**\n * Set the shadow opacity of the text object.\n * @param value the opacity (0 - 255)\n */\n setShadowOpacity(value: float): void {\n this._shadowOpacity = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow offset distance of the text object.\n * @return the shadow offset distance\n */\n getShadowDistance(): number {\n return this._shadowDistance;\n }\n\n /**\n * Set the shadow offset distance of the text object.\n * @param value the shadow offset distance\n */\n setShadowDistance(value: float): void {\n this._shadowDistance = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow offset angle of the text object.\n * @return the shadow offset angle in degrees\n */\n getShadowAngle(): number {\n return this._shadowAngle;\n }\n\n /**\n * Set the shadow offset angle of the text object.\n * @param value the shadow offset angle in degrees\n */\n setShadowAngle(value: float): void {\n this._shadowAngle = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow blur radius of the text object.\n * @return the shadow blur radius\n */\n getShadowBlurRadius(): number {\n return this._shadowBlur;\n }\n\n /**\n * Set the shadow blur radius of the text object.\n * @param value the shadow blur radius\n */\n setShadowBlurRadius(value: float): void {\n this._shadowBlur = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow color of the text object.\n * @param color the shadow color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setShadowColor(color: string): void {\n this._shadowColor = gdjs.rgbOrHexToRGBColor(color);\n this._renderer.updateStyle();\n }\n\n /**\n * Set the gradient for the text object.\n * @param strFirstColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strSecondColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strThirdColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strFourthColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strGradientType gradient type\n */\n setGradient(\n strGradientType: string,\n strFirstColor: string,\n strSecondColor: string,\n strThirdColor: string,\n strFourthColor: string\n ): void {\n const colorFirst = strFirstColor.split(';');\n const colorSecond = strSecondColor.split(';');\n const colorThird = strThirdColor.split(';');\n const colorFourth = strFourthColor.split(';');\n this._gradient = [];\n if (colorFirst.length == 3) {\n this._gradient.push([\n parseInt(colorFirst[0], 10),\n parseInt(colorFirst[1], 10),\n parseInt(colorFirst[2], 10),\n ]);\n }\n if (colorSecond.length == 3) {\n this._gradient.push([\n parseInt(colorSecond[0], 10),\n parseInt(colorSecond[1], 10),\n parseInt(colorSecond[2], 10),\n ]);\n }\n if (colorThird.length == 3) {\n this._gradient.push([\n parseInt(colorThird[0], 10),\n parseInt(colorThird[1], 10),\n parseInt(colorThird[2], 10),\n ]);\n }\n if (colorFourth.length == 3) {\n this._gradient.push([\n parseInt(colorFourth[0], 10),\n parseInt(colorFourth[1], 10),\n parseInt(colorFourth[2], 10),\n ]);\n }\n this._gradientType = strGradientType;\n this._useGradient = this._gradient.length > 1 ? true : false;\n this._renderer.updateStyle();\n }\n\n /**\n * Get padding of the text object.\n * @return number of pixels around the text before it gets cropped\n */\n getPadding(): number {\n return this._padding;\n }\n\n /**\n * Set padding of the text object.\n * @param value number of pixels around the text before it gets cropped\n */\n setPadding(value: float): void {\n this._padding = value;\n this._renderer.updateStyle();\n }\n }\n gdjs.registerObject('TextObject::Text', gdjs.TextRuntimeObject);\n}\n"],
5
- "mappings": "AAIA,GAAU,MAAV,UAAU,EAAV,CAoES,eACG,GAAK,aACsC,CAwCnD,YACE,EACA,EACA,CACA,MAAM,EAAmB,GArC3B,kBAAwB,GACxB,eAAmC,GACnC,mBAAwB,GACxB,aAAiB,IAGjB,eAAqB,GAErB,oBAAwB,IAaxB,cAAoB,EAKpB,aAAkB,EAClB,aAAkB,EAWhB,KAAM,GAAU,EAAe,QAC/B,KAAK,eAAiB,KAAK,IAAI,EAAG,EAAQ,eAC1C,KAAK,UAAY,EAAQ,KACzB,KAAK,MAAQ,EAAQ,KACrB,KAAK,QAAU,EAAQ,OACvB,KAAK,YAAc,EAAQ,WAC3B,KAAK,OAAS,EAAK,mBAAmB,EAAQ,OAC9C,KAAK,KAAO,EAAQ,KACpB,KAAK,WAAa,EAAQ,eAAiB,OAC3C,KAAK,uBAAyB,EAAQ,uBAAyB,MAE/D,KAAK,kBAAoB,EAAQ,iBACjC,KAAK,kBAAoB,EAAQ,iBACjC,KAAK,cAAgB,EAAK,mBAAmB,EAAQ,cAErD,KAAK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,UAAU,KAAK,CAClB,SAAS,EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,MAGxB,EAAY,QAAU,GACxB,KAAK,UAAU,KAAK,CAClB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,MAG7B,KAAK,cAAgB,EACrB,KAAK,aAAe,KAAK,UAAU,OAAS,EAC5C,KAAK,UAAU,cAOjB,YAAqB,CACnB,MAAO,MAAK,SAOd,WAAW,EAAoB,CAC7B,KAAK,SAAW,EAChB,KAAK,UAAU,eAn2BZ,EAAM,oBAs2Bb,EAAK,eAAe,mBAAoB,EAAK,qBA16BrC",
4
+ "sourcesContent": ["/*\n * GDevelop JS Platform\n * 2013-2016 Florian Rival (Florian.Rival@gmail.com)\n */\nnamespace gdjs {\n /** Base parameters for gdjs.TextRuntimeObject */\n export type TextObjectDataType = {\n content: {\n /** The size of the characters */\n characterSize: number;\n /** The font name */\n font: string;\n /** Is Bold? */\n bold: boolean;\n /** Is Italic? */\n italic: boolean;\n /** Is Underlined? */\n underlined: boolean;\n /** The text color in an RGB representation */\n color: string;\n /** The text of the object */\n text: string;\n textAlignment: string;\n verticalTextAlignment: string;\n\n isOutlineEnabled: boolean;\n outlineThickness: float;\n /** The outline color in an RGB representation */\n outlineColor: string;\n isShadowEnabled: boolean;\n /** The shadow color in an RGB representation */\n shadowColor: string;\n shadowOpacity: float;\n shadowDistance: float;\n shadowAngle: float;\n shadowBlurRadius: float;\n };\n };\n\n export type TextObjectData = ObjectData & TextObjectDataType;\n\n export type TextObjectNetworkSyncDataType = {\n str: string;\n o: float;\n cs: number;\n fn: string;\n b: boolean;\n i: boolean;\n u: boolean;\n c: number[];\n scale: number;\n ta: string;\n wrap: boolean;\n wrapw: float;\n oena: boolean;\n ot: float;\n oc: number[];\n sh: boolean;\n shc: number[];\n sho: float;\n shd: float;\n sha: float;\n shb: float;\n pad: integer;\n };\n\n export type TextObjectNetworkSyncData = ObjectNetworkSyncData &\n TextObjectNetworkSyncDataType;\n\n /**\n * Displays a text.\n */\n export class TextRuntimeObject\n extends gdjs.RuntimeObject\n implements gdjs.TextContainer, gdjs.OpacityHandler\n {\n _characterSize: number;\n _fontName: string;\n _bold: boolean;\n _italic: boolean;\n _underlined: boolean;\n _color: integer[];\n _useGradient: boolean = false;\n _gradient: Array<Array<integer>> = [];\n _gradientType: string = '';\n opacity: float = 255;\n _textAlign: string;\n _verticalTextAlignment: string;\n _wrapping: boolean = false;\n // A wrapping of 1 makes games crash on Firefox\n _wrappingWidth: float = 100;\n\n _isOutlineEnabled: boolean;\n _outlineThickness: float;\n _outlineColor: integer[];\n\n _shadow: boolean;\n _shadowColor: integer[];\n _shadowOpacity: float;\n _shadowDistance: float;\n _shadowAngle: float;\n _shadowBlur: float;\n\n _padding: integer = 5;\n _str: string;\n _renderer: gdjs.TextRuntimeObjectRenderer;\n\n // We can store the scale as nothing else can change it.\n _scaleX: number = 1;\n _scaleY: number = 1;\n\n /**\n * @param instanceContainer The container the object belongs to.\n * @param textObjectData The initial properties of the object\n */\n constructor(\n instanceContainer: gdjs.RuntimeInstanceContainer,\n textObjectData: TextObjectData\n ) {\n super(instanceContainer, textObjectData);\n const content = textObjectData.content;\n this._characterSize = Math.max(1, content.characterSize);\n this._fontName = content.font;\n this._bold = content.bold;\n this._italic = content.italic;\n this._underlined = content.underlined;\n this._color = gdjs.rgbOrHexToRGBColor(content.color);\n this._str = content.text;\n this._textAlign = content.textAlignment || 'left';\n this._verticalTextAlignment = content.verticalTextAlignment || 'top';\n\n this._isOutlineEnabled = content.isOutlineEnabled;\n this._outlineThickness = content.outlineThickness;\n this._outlineColor = gdjs.rgbOrHexToRGBColor(content.outlineColor);\n\n this._shadow = content.isShadowEnabled;\n this._shadowColor = gdjs.rgbOrHexToRGBColor(content.shadowColor);\n this._shadowOpacity = content.shadowOpacity;\n this._shadowDistance = content.shadowDistance;\n this._shadowBlur = content.shadowBlurRadius;\n this._shadowAngle = content.shadowAngle;\n\n this._renderer = new gdjs.TextRuntimeObjectRenderer(\n this,\n instanceContainer\n );\n\n // *ALWAYS* call `this.onCreated()` at the very end of your object constructor.\n this.onCreated();\n }\n\n updateFromObjectData(\n oldObjectData: TextObjectData,\n newObjectData: TextObjectData\n ): boolean {\n const oldContent = oldObjectData.content;\n const newContent = newObjectData.content;\n if (oldContent.characterSize !== newContent.characterSize) {\n this.setCharacterSize(newContent.characterSize);\n }\n if (oldContent.font !== newContent.font) {\n this.setFontName(newContent.font);\n }\n if (oldContent.bold !== newContent.bold) {\n this.setBold(newContent.bold);\n }\n if (oldContent.italic !== newContent.italic) {\n this.setItalic(newContent.italic);\n }\n if (oldContent.color !== newContent.color) {\n this.setColor(newContent.color);\n }\n if (oldContent.text !== newContent.text) {\n this.setText(newContent.text);\n }\n if (oldContent.underlined !== newContent.underlined) {\n return false;\n }\n if (oldContent.textAlignment !== newContent.textAlignment) {\n this.setTextAlignment(newContent.textAlignment);\n }\n if (\n oldContent.verticalTextAlignment !== newContent.verticalTextAlignment\n ) {\n this.setVerticalTextAlignment(newContent.verticalTextAlignment);\n }\n if (oldContent.isOutlineEnabled !== newContent.isOutlineEnabled) {\n this.setOutlineEnabled(newContent.isOutlineEnabled);\n }\n if (oldContent.outlineThickness !== newContent.outlineThickness) {\n this.setOutlineThickness(newContent.outlineThickness);\n }\n if (oldContent.outlineColor !== newContent.outlineColor) {\n this.setOutlineColor(newContent.outlineColor);\n }\n if (oldContent.isShadowEnabled !== newContent.isShadowEnabled) {\n this.showShadow(newContent.isShadowEnabled);\n }\n if (oldContent.shadowColor !== newContent.shadowColor) {\n this.setShadowColor(newContent.shadowColor);\n }\n if (oldContent.shadowOpacity !== newContent.shadowOpacity) {\n this.setShadowOpacity(newContent.shadowOpacity);\n }\n if (oldContent.shadowDistance !== newContent.shadowDistance) {\n this.setShadowDistance(newContent.shadowDistance);\n }\n if (oldContent.shadowAngle !== newContent.shadowAngle) {\n this.setShadowAngle(newContent.shadowAngle);\n }\n if (oldContent.shadowBlurRadius !== newContent.shadowBlurRadius) {\n this.setShadowBlurRadius(newContent.shadowBlurRadius);\n }\n return true;\n }\n\n getNetworkSyncData(): TextObjectNetworkSyncData {\n return {\n ...super.getNetworkSyncData(),\n str: this._str,\n o: this.opacity,\n cs: this._characterSize,\n fn: this._fontName,\n b: this._bold,\n i: this._italic,\n u: this._underlined,\n c: this._color,\n scale: this.getScale(),\n ta: this._textAlign,\n wrap: this._wrapping,\n wrapw: this._wrappingWidth,\n oena: this._isOutlineEnabled,\n ot: this._outlineThickness,\n oc: this._outlineColor,\n sh: this._shadow,\n shc: this._shadowColor,\n sho: this._shadowOpacity,\n shd: this._shadowDistance,\n sha: this._shadowAngle,\n shb: this._shadowBlur,\n pad: this._padding,\n };\n }\n\n updateFromNetworkSyncData(\n networkSyncData: TextObjectNetworkSyncData\n ): void {\n super.updateFromNetworkSyncData(networkSyncData);\n if (networkSyncData.str !== undefined) {\n this.setText(networkSyncData.str);\n }\n if (networkSyncData.o !== undefined) {\n this.setOpacity(networkSyncData.o);\n }\n if (networkSyncData.cs !== undefined) {\n this.setCharacterSize(networkSyncData.cs);\n }\n if (networkSyncData.fn !== undefined) {\n this.setFontName(networkSyncData.fn);\n }\n if (networkSyncData.b !== undefined) {\n this.setBold(networkSyncData.b);\n }\n if (networkSyncData.i !== undefined) {\n this.setItalic(networkSyncData.i);\n }\n if (networkSyncData.u !== undefined) {\n this._underlined = networkSyncData.u;\n }\n if (networkSyncData.c !== undefined) {\n this._color = networkSyncData.c;\n }\n if (networkSyncData.scale !== undefined) {\n this.setScale(networkSyncData.scale);\n }\n if (networkSyncData.ta !== undefined) {\n this.setTextAlignment(networkSyncData.ta);\n }\n if (networkSyncData.ta !== undefined) {\n this.setVerticalTextAlignment(networkSyncData.ta);\n }\n if (networkSyncData.wrap !== undefined) {\n this.setWrapping(networkSyncData.wrap);\n }\n if (networkSyncData.wrapw !== undefined) {\n this.setWrappingWidth(networkSyncData.wrapw);\n }\n if (networkSyncData.oena !== undefined) {\n this.setOutlineEnabled(networkSyncData.oena);\n }\n if (networkSyncData.ot !== undefined) {\n this.setOutlineThickness(networkSyncData.ot);\n }\n if (networkSyncData.oc !== undefined) {\n this._outlineColor = networkSyncData.oc;\n }\n if (networkSyncData.sh !== undefined) {\n this.showShadow(networkSyncData.sh);\n }\n if (networkSyncData.shc !== undefined) {\n this._shadowColor = networkSyncData.shc;\n }\n if (networkSyncData.sho !== undefined) {\n this.setShadowOpacity(networkSyncData.sho);\n }\n if (networkSyncData.shd !== undefined) {\n this.setShadowDistance(networkSyncData.shd);\n }\n if (networkSyncData.sha !== undefined) {\n this.setShadowAngle(networkSyncData.sha);\n }\n if (networkSyncData.shb !== undefined) {\n this.setShadowBlurRadius(networkSyncData.shb);\n }\n if (networkSyncData.pad !== undefined) {\n this.setPadding(networkSyncData.pad);\n }\n }\n\n getRendererObject() {\n return this._renderer.getRendererObject();\n }\n\n update(instanceContainer: gdjs.RuntimeInstanceContainer): void {\n this._renderer.ensureUpToDate();\n }\n\n onDestroyed(): void {\n super.onDestroyed();\n this._renderer.destroy();\n }\n\n /**\n * Initialize the extra parameters that could be set for an instance.\n */\n extraInitializationFromInitialInstance(initialInstanceData: InstanceData) {\n if (initialInstanceData.customSize) {\n this.setWrappingWidth(initialInstanceData.width);\n this.setWrapping(true);\n } else {\n this.setWrapping(false);\n }\n if (initialInstanceData.opacity !== undefined) {\n this.setOpacity(initialInstanceData.opacity);\n }\n }\n\n /**\n * Update the rendered object position.\n */\n private _updateTextPosition() {\n this.invalidateHitboxes();\n this._renderer.updatePosition();\n }\n\n /**\n * Set object position on X axis.\n */\n setX(x: float): void {\n super.setX(x);\n this._updateTextPosition();\n }\n\n /**\n * Set object position on Y axis.\n */\n setY(y: float): void {\n super.setY(y);\n this._updateTextPosition();\n }\n\n /**\n * Set the angle of the object.\n * @param angle The new angle of the object\n */\n setAngle(angle: float): void {\n super.setAngle(angle);\n this._renderer.updateAngle();\n }\n\n /**\n * Set object opacity.\n */\n setOpacity(opacity: float): void {\n if (opacity < 0) {\n opacity = 0;\n }\n if (opacity > 255) {\n opacity = 255;\n }\n this.opacity = opacity;\n this._renderer.updateOpacity();\n }\n\n /**\n * Get object opacity.\n */\n getOpacity() {\n return this.opacity;\n }\n\n /**\n * Get the string displayed by the object.\n * @deprecated use `getText` instead\n */\n getString(): string {\n return this.getText();\n }\n\n /**\n * Set the string displayed by the object.\n * @param text The new text\n * @deprecated use `setText` instead\n */\n setString(text: string): void {\n this.setText(text);\n }\n\n /**\n * Get the string displayed by the object.\n */\n getText(): string {\n return this._str;\n }\n\n /**\n * Set the string displayed by the object.\n * @param text The new text\n */\n setText(text: string): void {\n if (text === this._str) {\n return;\n }\n this._str = text;\n this._renderer.updateString();\n this._updateTextPosition();\n }\n\n /**\n * Get the font size of the characters of the object.\n */\n getCharacterSize(): number {\n return this._characterSize;\n }\n\n /**\n * Set the font size for characters of the object.\n * @param newSize The new font size for the text.\n */\n setCharacterSize(newSize: number): void {\n if (newSize <= 1) {\n newSize = 1;\n }\n this._characterSize = newSize;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the name of the resource to use for the font.\n * @param fontResourceName The name of the font resource.\n */\n setFontName(fontResourceName: string): void {\n this._fontName = fontResourceName;\n this._renderer.updateStyle();\n }\n\n /**\n * Return true if the text is bold.\n */\n isBold(): boolean {\n return this._bold;\n }\n\n /**\n * Set bold for the object text.\n * @param enable {boolean} true to have a bold text, false otherwise.\n */\n setBold(enable: boolean): void {\n this._bold = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Return true if the text is italic.\n */\n isItalic(): boolean {\n return this._italic;\n }\n\n /**\n * Set italic for the object text.\n * @param enable {boolean} true to have an italic text, false otherwise.\n */\n setItalic(enable: boolean): void {\n this._italic = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get width of the text.\n */\n getWidth(): float {\n return this._wrapping ? this._wrappingWidth : this._renderer.getWidth();\n }\n\n /**\n * Get height of the text.\n */\n getHeight(): float {\n return this._renderer.getHeight();\n }\n\n /**\n * Get the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).\n *\n * @return the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).\n * @deprecated Use `getScale` instead.\n */\n getScaleMean(): float {\n return (Math.abs(this._scaleX) + Math.abs(this._scaleY)) / 2.0;\n }\n\n /**\n * Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).\n *\n * @return the scale of the object (or the geometric mean of the X and Y scale in case they are different).\n */\n getScale(): float {\n const scaleX = Math.abs(this._scaleX);\n const scaleY = Math.abs(this._scaleY);\n return scaleX === scaleY ? scaleX : Math.sqrt(scaleX * scaleY);\n }\n\n /**\n * Get x-scale of the text.\n */\n getScaleX(): float {\n return this._scaleX;\n }\n\n /**\n * Get y-scale of the text.\n */\n getScaleY(): float {\n return this._scaleY;\n }\n\n /**\n * Set the text object scale.\n * @param newScale The new scale for the text object.\n */\n setScale(newScale: float): void {\n if (this._scaleX === newScale && this._scaleY === newScale) return;\n\n this._scaleX = newScale;\n this._scaleY = newScale;\n this._renderer.setScale(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the text object x-scale.\n * @param newScale The new x-scale for the text object.\n */\n setScaleX(newScale: float): void {\n if (this._scaleX === newScale) return;\n\n this._scaleX = newScale;\n this._renderer.setScaleX(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Set the text object y-scale.\n * @param newScale The new y-scale for the text object.\n */\n setScaleY(newScale: float): void {\n if (this._scaleY === newScale) return;\n\n this._scaleY = newScale;\n this._renderer.setScaleY(newScale);\n this.invalidateHitboxes();\n }\n\n /**\n * Change the text color.\n * @param colorString color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setColor(colorString: string): void {\n const color = colorString.split(';');\n if (color.length < 3) {\n return;\n }\n this._color[0] = parseInt(color[0], 10);\n this._color[1] = parseInt(color[1], 10);\n this._color[2] = parseInt(color[2], 10);\n this._useGradient = false;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text color.\n * @return The color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n getColor(): string {\n return this._color[0] + ';' + this._color[1] + ';' + this._color[2];\n }\n\n /**\n * Set the text alignment on Y axis for multiline text objects.\n * @param alignment The text alignment.\n */\n setVerticalTextAlignment(alignment: string): void {\n this._verticalTextAlignment = alignment;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text alignment on Y axis of text object.\n * @return The text alignment.\n */\n getVerticalTextAlignment(): string {\n return this._verticalTextAlignment;\n }\n\n /**\n * Set the text alignment for multiline text objects.\n * @param alignment The text alignment.\n */\n setTextAlignment(alignment: string): void {\n this._textAlign = alignment;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the text alignment of text object.\n * @return The text alignment.\n */\n getTextAlignment(): string {\n return this._textAlign;\n }\n\n /**\n * Return true if word wrapping is enabled for the text.\n */\n isWrapping(): boolean {\n return this._wrapping;\n }\n\n /**\n * Set word wrapping for the object text.\n * @param enable true to enable word wrapping, false to disable it.\n */\n setWrapping(enable: boolean): void {\n if (this._wrapping === enable) return;\n\n this._wrapping = enable;\n this._renderer.updateStyle();\n this.invalidateHitboxes();\n }\n\n /**\n * Get the word wrapping width for the text object.\n */\n getWrappingWidth(): float {\n return this._wrappingWidth;\n }\n\n /**\n * Set the word wrapping width for the text object.\n * @param width The new width to set.\n */\n setWrappingWidth(width: float): void {\n if (width <= 1) {\n width = 1;\n }\n if (this._wrappingWidth === width) {\n return;\n }\n this._wrappingWidth = width;\n\n if (this._wrapping) {\n this._renderer.updateStyle();\n this.invalidateHitboxes();\n }\n }\n\n setWidth(width: float): void {\n this.setWrappingWidth(width);\n }\n\n getDrawableY(): float {\n return (\n this.getY() -\n (this._verticalTextAlignment === 'center'\n ? this.getHeight() / 2\n : this._verticalTextAlignment === 'bottom'\n ? this.getHeight()\n : 0)\n );\n }\n\n /**\n * Set the outline for the text object.\n * @param str color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param thickness thickness of the outline (0 = disabled)\n * @deprecated Prefer independent setters.\n */\n setOutline(str: string, thickness: number): void {\n const color = str.split(';');\n if (color.length < 3) {\n return;\n }\n this._outlineColor[0] = parseInt(color[0], 10);\n this._outlineColor[1] = parseInt(color[1], 10);\n this._outlineColor[2] = parseInt(color[2], 10);\n this._outlineThickness = thickness;\n this._renderer.updateStyle();\n }\n\n isOutlineEnabled(): boolean {\n return this._isOutlineEnabled;\n }\n\n setOutlineEnabled(enable: boolean): void {\n this._isOutlineEnabled = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the outline thickness of the text object.\n * @return the outline thickness\n */\n getOutlineThickness(): number {\n return this._outlineThickness;\n }\n\n /**\n * Set the outline thickness of the text object.\n * @param value the outline thickness\n */\n setOutlineThickness(value: float): void {\n this._outlineThickness = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow color of the text object.\n * @param color the shadow color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setOutlineColor(color: string): void {\n this._outlineColor = gdjs.rgbOrHexToRGBColor(color);\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow for the text object.\n * @param str color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param distance distance between the shadow and the text, in pixels.\n * @param blur amount of shadow blur, in pixels.\n * @param angle shadow offset direction, in degrees.\n * @deprecated Prefer independent setters.\n */\n setShadow(\n str: string,\n distance: number,\n blur: integer,\n angle: float\n ): void {\n const color = str.split(';');\n if (color.length < 3) {\n return;\n }\n this._shadowColor[0] = parseInt(color[0], 10);\n this._shadowColor[1] = parseInt(color[1], 10);\n this._shadowColor[2] = parseInt(color[2], 10);\n this._shadowDistance = distance;\n this._shadowBlur = blur;\n this._shadowAngle = angle;\n this._shadow = true;\n this._renderer.updateStyle();\n }\n\n isShadowEnabled(): boolean {\n return this._shadow;\n }\n\n /**\n * Show the shadow of the text object.\n * @param enable true to show the shadow, false to hide it\n */\n showShadow(enable: boolean): void {\n this._shadow = enable;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow opacity of the text object.\n * @return the opacity (0 - 255)\n */\n getShadowOpacity(): number {\n return this._shadowOpacity;\n }\n\n /**\n * Set the shadow opacity of the text object.\n * @param value the opacity (0 - 255)\n */\n setShadowOpacity(value: float): void {\n this._shadowOpacity = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow offset distance of the text object.\n * @return the shadow offset distance\n */\n getShadowDistance(): number {\n return this._shadowDistance;\n }\n\n /**\n * Set the shadow offset distance of the text object.\n * @param value the shadow offset distance\n */\n setShadowDistance(value: float): void {\n this._shadowDistance = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow offset angle of the text object.\n * @return the shadow offset angle in degrees\n */\n getShadowAngle(): number {\n return this._shadowAngle;\n }\n\n /**\n * Set the shadow offset angle of the text object.\n * @param value the shadow offset angle in degrees\n */\n setShadowAngle(value: float): void {\n this._shadowAngle = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Get the shadow blur radius of the text object.\n * @return the shadow blur radius\n */\n getShadowBlurRadius(): number {\n return this._shadowBlur;\n }\n\n /**\n * Set the shadow blur radius of the text object.\n * @param value the shadow blur radius\n */\n setShadowBlurRadius(value: float): void {\n this._shadowBlur = value;\n this._renderer.updateStyle();\n }\n\n /**\n * Set the shadow color of the text object.\n * @param color the shadow color as a \"R;G;B\" string, for example: \"255;0;0\"\n */\n setShadowColor(color: string): void {\n this._shadowColor = gdjs.rgbOrHexToRGBColor(color);\n this._renderer.updateStyle();\n }\n\n /**\n * Set the gradient for the text object.\n * @param strFirstColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strSecondColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strThirdColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strFourthColor color as a \"R;G;B\" string, for example: \"255;0;0\"\n * @param strGradientType gradient type\n */\n setGradient(\n strGradientType: string,\n strFirstColor: string,\n strSecondColor: string,\n strThirdColor: string,\n strFourthColor: string\n ): void {\n const colorFirst = strFirstColor.split(';');\n const colorSecond = strSecondColor.split(';');\n const colorThird = strThirdColor.split(';');\n const colorFourth = strFourthColor.split(';');\n this._gradient = [];\n if (colorFirst.length == 3) {\n this._gradient.push([\n parseInt(colorFirst[0], 10),\n parseInt(colorFirst[1], 10),\n parseInt(colorFirst[2], 10),\n ]);\n }\n if (colorSecond.length == 3) {\n this._gradient.push([\n parseInt(colorSecond[0], 10),\n parseInt(colorSecond[1], 10),\n parseInt(colorSecond[2], 10),\n ]);\n }\n if (colorThird.length == 3) {\n this._gradient.push([\n parseInt(colorThird[0], 10),\n parseInt(colorThird[1], 10),\n parseInt(colorThird[2], 10),\n ]);\n }\n if (colorFourth.length == 3) {\n this._gradient.push([\n parseInt(colorFourth[0], 10),\n parseInt(colorFourth[1], 10),\n parseInt(colorFourth[2], 10),\n ]);\n }\n this._gradientType = strGradientType;\n this._useGradient = this._gradient.length > 1 ? true : false;\n this._renderer.updateStyle();\n }\n\n /**\n * Get padding of the text object.\n * @return number of pixels around the text before it gets cropped\n */\n getPadding(): number {\n return this._padding;\n }\n\n /**\n * Set padding of the text object.\n * @param value number of pixels around the text before it gets cropped\n */\n setPadding(value: float): void {\n this._padding = value;\n this._renderer.updateStyle();\n }\n }\n gdjs.registerObject('TextObject::Text', gdjs.TextRuntimeObject);\n}\n"],
5
+ "mappings": "AAIA,GAAU,MAAV,UAAU,EAAV,CAoES,eACG,GAAK,aAEf,CAwCE,YACE,EACA,EACA,CACA,MAAM,EAAmB,GArC3B,kBAAwB,GACxB,eAAmC,GACnC,mBAAwB,GACxB,aAAiB,IAGjB,eAAqB,GAErB,oBAAwB,IAaxB,cAAoB,EAKpB,aAAkB,EAClB,aAAkB,EAWhB,KAAM,GAAU,EAAe,QAC/B,KAAK,eAAiB,KAAK,IAAI,EAAG,EAAQ,eAC1C,KAAK,UAAY,EAAQ,KACzB,KAAK,MAAQ,EAAQ,KACrB,KAAK,QAAU,EAAQ,OACvB,KAAK,YAAc,EAAQ,WAC3B,KAAK,OAAS,EAAK,mBAAmB,EAAQ,O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EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,MAGxB,EAAY,QAAU,GACxB,KAAK,UAAU,KAAK,CAClB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,MAGzB,EAAW,QAAU,GACvB,KAAK,UAAU,KAAK,CAClB,SAAS,EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,IACxB,SAAS,EAAW,GAAI,MAGxB,EAAY,QAAU,GACxB,KAAK,UAAU,KAAK,CAClB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,IACzB,SAAS,EAAY,GAAI,MAG7B,KAAK,cAAgB,EACrB,KAAK,aAAe,KAAK,UAAU,OAAS,EAC5C,KAAK,UAAU,cAOjB,YAAqB,CACnB,MAAO,MAAK,SAOd,WAAW,EAAoB,CAC7B,KAAK,SAAW,EAChB,KAAK,UAAU,eAp2BZ,EAAM,oBAu2Bb,EAAK,eAAe,mBAAoB,EAAK,qBA36BrC",
6
6
  "names": []
7
7
  }
@@ -1887,14 +1887,14 @@ module.exports = {
1887
1887
 
1888
1888
  async _loadTileMap(tilemapJsonFile, tilesetJsonFile) {
1889
1889
  try {
1890
- const tileMapJsonData = await this._pixiResourcesLoader.getResourceJsonData(
1891
- this._project,
1892
- tilemapJsonFile
1893
- );
1890
+ const tileMapJsonData =
1891
+ await this._pixiResourcesLoader.getResourceJsonData(
1892
+ this._project,
1893
+ tilemapJsonFile
1894
+ );
1894
1895
 
1895
- const tileMap = TilemapHelper.TileMapManager.identify(
1896
- tileMapJsonData
1897
- );
1896
+ const tileMap =
1897
+ TilemapHelper.TileMapManager.identify(tileMapJsonData);
1898
1898
 
1899
1899
  if (tileMap.kind === 'tiled') {
1900
1900
  const tilesetJsonData = tilesetJsonFile
@@ -1996,7 +1996,8 @@ module.exports = {
1996
1996
  // Only update layers that are of type TileMapHelper.EditableTileMapLayer.
1997
1997
  // @ts-ignore - only this type of layer has setAlpha.
1998
1998
  if (layer.setAlpha) {
1999
- const editableLayer = /** @type {TileMapHelper.EditableTileMapLayer} */ (layer);
1999
+ const editableLayer =
2000
+ /** @type {TileMapHelper.EditableTileMapLayer} */ (layer);
2000
2001
  editableLayer.setAlpha(alphaForDisplay);
2001
2002
  }
2002
2003
  }
@@ -2103,8 +2104,8 @@ module.exports = {
2103
2104
  localPosition.y < this.height
2104
2105
  );
2105
2106
  };
2106
- this._placeholderTextPixiObject.interactive = true;
2107
- this._placeholderImagePixiObject.interactive = true;
2107
+ this._placeholderTextPixiObject.eventMode = 'static';
2108
+ this._placeholderImagePixiObject.eventMode = 'static';
2108
2109
  this._placeholderTextPixiObject.anchor.x = 0.5;
2109
2110
  this._placeholderTextPixiObject.anchor.y = 0.5;
2110
2111
  this._placeholderTextPixiObject.y = 30;
@@ -2392,7 +2393,8 @@ module.exports = {
2392
2393
  // Only update layers that are of type TileMapHelper.EditableTileMapLayer.
2393
2394
  // @ts-ignore - only this type of layer has setAlpha.
2394
2395
  if (layer.setAlpha) {
2395
- const editableLayer = /** @type {TileMapHelper.EditableTileMapLayer} */ (layer);
2396
+ const editableLayer =
2397
+ /** @type {TileMapHelper.EditableTileMapLayer} */ (layer);
2396
2398
  editableLayer.setAlpha(alphaForDisplay);
2397
2399
  }
2398
2400
  }
@@ -2576,14 +2578,14 @@ module.exports = {
2576
2578
 
2577
2579
  async _loadTileMap(tilemapJsonFile, tilesetJsonFile) {
2578
2580
  try {
2579
- const tileMapJsonData = await this._pixiResourcesLoader.getResourceJsonData(
2580
- this._project,
2581
- tilemapJsonFile
2582
- );
2581
+ const tileMapJsonData =
2582
+ await this._pixiResourcesLoader.getResourceJsonData(
2583
+ this._project,
2584
+ tilemapJsonFile
2585
+ );
2583
2586
 
2584
- const tileMap = TilemapHelper.TileMapManager.identify(
2585
- tileMapJsonData
2586
- );
2587
+ const tileMap =
2588
+ TilemapHelper.TileMapManager.identify(tileMapJsonData);
2587
2589
 
2588
2590
  if (tileMap.kind === 'tiled') {
2589
2591
  const tilesetJsonData = tilesetJsonFile
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../GDevelop/Extensions/TileMap/TileMapRuntimeManager.ts"],
4
- "sourcesContent": ["/// <reference path=\"helper/TileMapHelper.d.ts\" />\nnamespace gdjs {\n export interface RuntimeInstanceContainer {\n tileMapCollisionMaskManager: gdjs.TileMap.TileMapRuntimeManager;\n }\n export namespace TileMap {\n const logger = new gdjs.Logger('Tilemap object');\n\n /**\n * A holder to share tile maps across the 2 extension objects.\n *\n * Every instance with the same files path in properties will\n * share the same {@link EditableTileMap} and {@link TileTextureCache}.\n *\n * To use a tile map with collisions, a user can create 4 objects:\n * - one for the the rendering\n * - one for the solid platforms\n * - one for the jumpthrus\n * - one for the ladders\n *\n * To avoid to have 4 copies of the same tile map in memory, this manager\n * puts the tile map in cache and avoid unnecessary parsing.\n *\n * @see {@link TileMapManager}\n */\n export class TileMapRuntimeManager {\n private _instanceContainer: gdjs.RuntimeInstanceContainer;\n /**\n * Delegate that actually manage the caches without anything specific to\n * GDJS.\n * It allows to factorize code with the IDE.\n */\n private _manager: TileMapHelper.TileMapManager;\n /**\n * @param instanceContainer The instance container.\n */\n private constructor(instanceContainer: gdjs.RuntimeInstanceContainer) {\n this._instanceContainer = instanceContainer;\n this._manager = new TileMapHelper.TileMapManager();\n }\n\n /**\n * @param instanceContainer Where to set the manager instance.\n * @returns The shared manager.\n */\n static getManager(\n instanceContainer: gdjs.RuntimeInstanceContainer\n ): TileMapRuntimeManager {\n if (!instanceContainer.tileMapCollisionMaskManager) {\n // Create the shared manager if necessary.\n instanceContainer.tileMapCollisionMaskManager = new TileMapRuntimeManager(\n instanceContainer\n );\n }\n return instanceContainer.tileMapCollisionMaskManager;\n }\n\n /**\n * @param tileMapJsonResourceName The resource name of the tile map.\n * @param tileSetJsonResourceName The resource name of the tile set.\n * @param levelIndex The level of the tile map.\n * @param callback A function called when the tile map is parsed.\n */\n getOrLoadTileMap(\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n levelIndex: number,\n callback: (\n tileMapFileContent: TileMapHelper.EditableTileMap | null\n ) => void\n ): void {\n this._manager.getOrLoadTileMap(\n this._loadTileMap.bind(this),\n tileMapJsonResourceName,\n tileSetJsonResourceName,\n levelIndex,\n pako,\n callback\n );\n }\n\n getOrLoadSimpleTileMap(\n tileMapAsJsObject: TileMapHelper.EditableTileMapAsJsObject,\n objectName: string,\n tileSize: number,\n columnCount: number,\n rowCount: number,\n callback: (tileMap: TileMapHelper.EditableTileMap) => void\n ): void {\n this._manager.getOrLoadSimpleTileMap(\n tileMapAsJsObject,\n objectName,\n tileSize,\n columnCount,\n rowCount,\n callback\n );\n }\n\n /**\n * @param getTexture The method that loads the atlas image file in memory.\n * @param atlasImageResourceName The resource name of the atlas image.\n * @param tileMapJsonResourceName The resource name of the tile map.\n * @param tileSetJsonResourceName The resource name of the tile set.\n * @param levelIndex The level of the tile map.\n * @param callback A function called when the tiles textures are split.\n */\n getOrLoadTextureCache(\n getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,\n atlasImageResourceName: string,\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n levelIndex: number,\n callback: (textureCache: TileMapHelper.TileTextureCache | null) => void\n ): void {\n this._manager.getOrLoadTextureCache(\n this._loadTileMap.bind(this),\n getTexture,\n atlasImageResourceName,\n tileMapJsonResourceName,\n tileSetJsonResourceName,\n levelIndex,\n callback\n );\n }\n\n /**\n * @param getTexture The method that loads the atlas image file in memory.\n * @param atlasImageResourceName The resource name of the atlas image.\n * @param tileSize\n * @param columnCount\n * @param rowCount\n * @param callback A function called when the tiles textures are split.\n */\n getOrLoadSimpleTileMapTextureCache(\n getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,\n atlasImageResourceName: string,\n tileSize: number,\n columnCount: number,\n rowCount: number,\n callback: (textureCache: TileMapHelper.TileTextureCache | null) => void,\n errorCallback: (error: Error) => void\n ): void {\n try {\n this._manager.getOrLoadSimpleTileMapTextureCache(\n getTexture,\n atlasImageResourceName,\n tileSize,\n columnCount,\n rowCount,\n callback\n );\n } catch (error) {\n errorCallback(error);\n }\n }\n\n /**\n * Parse both JSON and set the content of the tile set in the right\n * attribute in the tile map to merge both parsed data.\n */\n private _loadTileMap(\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n callback: (\n tileMapFileContent: TileMapHelper.TileMapFileContent | null\n ) => void\n ): void {\n this._instanceContainer\n .getGame()\n .getJsonManager()\n .loadJson(tileMapJsonResourceName, (error, tileMapJsonData) => {\n if (error) {\n logger.error(\n 'An error happened while loading a Tilemap JSON data:',\n error\n );\n callback(null);\n return;\n }\n const tileMapFileContent = TileMapHelper.TileMapManager.identify(\n tileMapJsonData\n );\n if (!tileMapFileContent) {\n callback(null);\n return;\n }\n if (\n tileMapFileContent.kind === 'tiled' &&\n tileSetJsonResourceName\n ) {\n this._instanceContainer\n .getGame()\n .getJsonManager()\n .loadJson(tileSetJsonResourceName, (error, tileSetJsonData) => {\n if (error) {\n logger.error(\n 'An error happened while loading Tileset JSON data:',\n error\n );\n callback(null);\n return;\n }\n const tiledMap = tileMapFileContent.data;\n const tileSet = tileSetJsonData as TileMapHelper.TiledTileset;\n tileSet.firstgid = tiledMap.tilesets[0].firstgid;\n tiledMap.tilesets = [tileSet];\n callback(tileMapFileContent);\n });\n } else {\n callback(tileMapFileContent);\n }\n });\n }\n }\n }\n}\n"],
5
- "mappings": "AACA,GAAU,MAAV,UAAU,EAAV,CAIS,GAAU,GAAV,UAAU,EAAV,CACL,KAAM,GAAS,GAAI,GAAK,OAAO,kBAmBxB,OAA4B,CAWzB,YAAY,EAAkD,CACpE,KAAK,mBAAqB,EAC1B,KAAK,SAAW,GAAI,eAAc,qBAO7B,YACL,EACuB,CACvB,MAAK,GAAkB,6BAErB,GAAkB,4BAA8B,GAAI,GAClD,IAGG,EAAkB,4BAS3B,iBACE,EACA,EACA,EACA,EAGM,CACN,KAAK,SAAS,iBACZ,KAAK,aAAa,KAAK,MACvB,EACA,EACA,EACA,KACA,GAIJ,uBACE,EACA,EACA,EACA,EACA,EACA,EACM,CACN,KAAK,SAAS,uBACZ,EACA,EACA,EACA,EACA,EACA,GAYJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACM,CACN,KAAK,SAAS,sBACZ,KAAK,aAAa,KAAK,MACvB,EACA,EACA,EACA,EACA,EACA,GAYJ,mCACE,EACA,EACA,EACA,EACA,EACA,EACA,EACM,CACN,GAAI,CACF,KAAK,SAAS,mCACZ,EACA,EACA,EACA,EACA,EACA,SAEK,EAAP,CACA,EAAc,IAQV,aACN,EACA,EACA,EAGM,CACN,KAAK,mBACF,UACA,iBACA,SAAS,EAAyB,CAAC,EAAO,IAAoB,CAC7D,GAAI,EAAO,CACT,EAAO,MACL,uDACA,GAEF,EAAS,MACT,OAEF,KAAM,GAAqB,cAAc,eAAe,SACtD,GAEF,GAAI,CAAC,EAAoB,CACvB,EAAS,MACT,OAEF,AACE,EAAmB,OAAS,SAC5B,EAEA,KAAK,mBACF,UACA,iBACA,SAAS,EAAyB,CAAC,EAAO,IAAoB,CAC7D,GAAI,EAAO,CACT,EAAO,MACL,qDACA,GAEF,EAAS,MACT,OAEF,KAAM,GAAW,EAAmB,KAC9B,EAAU,EAChB,EAAQ,SAAW,EAAS,SAAS,GAAG,SACxC,EAAS,SAAW,CAAC,GACrB,EAAS,KAGb,EAAS,MAzLZ,EAAM,0BApBE,+BAJT",
4
+ "sourcesContent": ["/// <reference path=\"helper/TileMapHelper.d.ts\" />\nnamespace gdjs {\n export interface RuntimeInstanceContainer {\n tileMapCollisionMaskManager: gdjs.TileMap.TileMapRuntimeManager;\n }\n export namespace TileMap {\n const logger = new gdjs.Logger('Tilemap object');\n\n /**\n * A holder to share tile maps across the 2 extension objects.\n *\n * Every instance with the same files path in properties will\n * share the same {@link EditableTileMap} and {@link TileTextureCache}.\n *\n * To use a tile map with collisions, a user can create 4 objects:\n * - one for the the rendering\n * - one for the solid platforms\n * - one for the jumpthrus\n * - one for the ladders\n *\n * To avoid to have 4 copies of the same tile map in memory, this manager\n * puts the tile map in cache and avoid unnecessary parsing.\n *\n * @see {@link TileMapManager}\n */\n export class TileMapRuntimeManager {\n private _instanceContainer: gdjs.RuntimeInstanceContainer;\n /**\n * Delegate that actually manage the caches without anything specific to\n * GDJS.\n * It allows to factorize code with the IDE.\n */\n private _manager: TileMapHelper.TileMapManager;\n /**\n * @param instanceContainer The instance container.\n */\n private constructor(instanceContainer: gdjs.RuntimeInstanceContainer) {\n this._instanceContainer = instanceContainer;\n this._manager = new TileMapHelper.TileMapManager();\n }\n\n /**\n * @param instanceContainer Where to set the manager instance.\n * @returns The shared manager.\n */\n static getManager(\n instanceContainer: gdjs.RuntimeInstanceContainer\n ): TileMapRuntimeManager {\n if (!instanceContainer.tileMapCollisionMaskManager) {\n // Create the shared manager if necessary.\n instanceContainer.tileMapCollisionMaskManager =\n new TileMapRuntimeManager(instanceContainer);\n }\n return instanceContainer.tileMapCollisionMaskManager;\n }\n\n /**\n * @param tileMapJsonResourceName The resource name of the tile map.\n * @param tileSetJsonResourceName The resource name of the tile set.\n * @param levelIndex The level of the tile map.\n * @param callback A function called when the tile map is parsed.\n */\n getOrLoadTileMap(\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n levelIndex: number,\n callback: (\n tileMapFileContent: TileMapHelper.EditableTileMap | null\n ) => void\n ): void {\n this._manager.getOrLoadTileMap(\n this._loadTileMap.bind(this),\n tileMapJsonResourceName,\n tileSetJsonResourceName,\n levelIndex,\n pako,\n callback\n );\n }\n\n getOrLoadSimpleTileMap(\n tileMapAsJsObject: TileMapHelper.EditableTileMapAsJsObject,\n objectName: string,\n tileSize: number,\n columnCount: number,\n rowCount: number,\n callback: (tileMap: TileMapHelper.EditableTileMap) => void\n ): void {\n this._manager.getOrLoadSimpleTileMap(\n tileMapAsJsObject,\n objectName,\n tileSize,\n columnCount,\n rowCount,\n callback\n );\n }\n\n /**\n * @param getTexture The method that loads the atlas image file in memory.\n * @param atlasImageResourceName The resource name of the atlas image.\n * @param tileMapJsonResourceName The resource name of the tile map.\n * @param tileSetJsonResourceName The resource name of the tile set.\n * @param levelIndex The level of the tile map.\n * @param callback A function called when the tiles textures are split.\n */\n getOrLoadTextureCache(\n getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,\n atlasImageResourceName: string,\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n levelIndex: number,\n callback: (textureCache: TileMapHelper.TileTextureCache | null) => void\n ): void {\n this._manager.getOrLoadTextureCache(\n this._loadTileMap.bind(this),\n getTexture,\n atlasImageResourceName,\n tileMapJsonResourceName,\n tileSetJsonResourceName,\n levelIndex,\n callback\n );\n }\n\n /**\n * @param getTexture The method that loads the atlas image file in memory.\n * @param atlasImageResourceName The resource name of the atlas image.\n * @param tileSize\n * @param columnCount\n * @param rowCount\n * @param callback A function called when the tiles textures are split.\n */\n getOrLoadSimpleTileMapTextureCache(\n getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,\n atlasImageResourceName: string,\n tileSize: number,\n columnCount: number,\n rowCount: number,\n callback: (textureCache: TileMapHelper.TileTextureCache | null) => void,\n errorCallback: (error: Error) => void\n ): void {\n try {\n this._manager.getOrLoadSimpleTileMapTextureCache(\n getTexture,\n atlasImageResourceName,\n tileSize,\n columnCount,\n rowCount,\n callback\n );\n } catch (error) {\n errorCallback(error);\n }\n }\n\n /**\n * Parse both JSON and set the content of the tile set in the right\n * attribute in the tile map to merge both parsed data.\n */\n private _loadTileMap(\n tileMapJsonResourceName: string,\n tileSetJsonResourceName: string,\n callback: (\n tileMapFileContent: TileMapHelper.TileMapFileContent | null\n ) => void\n ): void {\n this._instanceContainer\n .getGame()\n .getJsonManager()\n .loadJson(tileMapJsonResourceName, (error, tileMapJsonData) => {\n if (error) {\n logger.error(\n 'An error happened while loading a Tilemap JSON data:',\n error\n );\n callback(null);\n return;\n }\n const tileMapFileContent =\n TileMapHelper.TileMapManager.identify(tileMapJsonData);\n if (!tileMapFileContent) {\n callback(null);\n return;\n }\n if (\n tileMapFileContent.kind === 'tiled' &&\n tileSetJsonResourceName\n ) {\n this._instanceContainer\n .getGame()\n .getJsonManager()\n .loadJson(tileSetJsonResourceName, (error, tileSetJsonData) => {\n if (error) {\n logger.error(\n 'An error happened while loading Tileset JSON data:',\n error\n );\n callback(null);\n return;\n }\n const tiledMap = tileMapFileContent.data;\n const tileSet = tileSetJsonData as TileMapHelper.TiledTileset;\n tileSet.firstgid = tiledMap.tilesets[0].firstgid;\n tiledMap.tilesets = [tileSet];\n callback(tileMapFileContent);\n });\n } else {\n callback(tileMapFileContent);\n }\n });\n }\n }\n }\n}\n"],
5
+ "mappings": "AACA,GAAU,MAAV,UAAU,EAAV,CAIS,GAAU,GAAV,UAAU,EAAV,CACL,KAAM,GAAS,GAAI,GAAK,OAAO,kBAmBxB,OAA4B,CAWzB,YAAY,EAAkD,CACpE,KAAK,mBAAqB,EAC1B,KAAK,SAAW,GAAI,eAAc,qBAO7B,YACL,EACuB,CACvB,MAAK,GAAkB,6BAErB,GAAkB,4BAChB,GAAI,GAAsB,IAEvB,EAAkB,4BAS3B,iBACE,EACA,EACA,EACA,EAGM,CACN,KAAK,SAAS,iBACZ,KAAK,aAAa,KAAK,MACvB,EACA,EACA,EACA,KACA,GAIJ,uBACE,EACA,EACA,EACA,EACA,EACA,EACM,CACN,KAAK,SAAS,uBACZ,EACA,EACA,EACA,EACA,EACA,GAYJ,sBACE,EACA,EACA,EACA,EACA,EACA,EACM,CACN,KAAK,SAAS,sBACZ,KAAK,aAAa,KAAK,MACvB,EACA,EACA,EACA,EACA,EACA,GAYJ,mCACE,EACA,EACA,EACA,EACA,EACA,EACA,EACM,CACN,GAAI,CACF,KAAK,SAAS,mCACZ,EACA,EACA,EACA,EACA,EACA,SAEK,EAAP,CACA,EAAc,IAQV,aACN,EACA,EACA,EAGM,CACN,KAAK,mBACF,UACA,iBACA,SAAS,EAA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