@caperjs/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +62 -0
- package/cli/add.mjs +197 -0
- package/cli/audio/cc.mjs +128 -0
- package/cli/audio/index.mjs +42 -0
- package/cli/audio/utils.mjs +56 -0
- package/cli/create-caper.mjs +8 -0
- package/cli/create.mjs +351 -0
- package/cli/install-peerdeps.mjs +57 -0
- package/cli/update.mjs +9 -0
- package/cli/utils.mjs +81 -0
- package/cli/vite.mjs +55 -0
- package/cli/voiceover/generateVoiceoverCSV.mjs +158 -0
- package/cli/voiceover/index.mjs +1 -0
- package/cli.mjs +157 -0
- package/client.d.ts +7 -0
- package/config/assetpack.mjs +212 -0
- package/config/tsconfig.base.json +28 -0
- package/config/vite.mjs +2464 -0
- package/extras/css/accessibility.css +9 -0
- package/extras/css/fullscreen.css +28 -0
- package/extras/css/loader.css +67 -0
- package/extras/llms.txt +1602 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js +277 -0
- package/lib/CaptionsPlugin-Dc8fIrjy.js.map +1 -0
- package/lib/DataAdapter-BY2114sp.js +84 -0
- package/lib/DataAdapter-BY2114sp.js.map +1 -0
- package/lib/DebugRenderer-BJMLILqI.js +1385 -0
- package/lib/DebugRenderer-BJMLILqI.js.map +1 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js +31 -0
- package/lib/DevToolsPlugin-wQ5rOkn0.js.map +1 -0
- package/lib/GSAPPlugin-DHhSZKv8.js +350 -0
- package/lib/GSAPPlugin-DHhSZKv8.js.map +1 -0
- package/lib/LayoutPlugin-B-DF9SYM.js +1271 -0
- package/lib/LayoutPlugin-B-DF9SYM.js.map +1 -0
- package/lib/SpinePlugin-Dz_3dljz.js +6077 -0
- package/lib/SpinePlugin-Dz_3dljz.js.map +1 -0
- package/lib/StatsPlugin-Cg82JMBD.js +70 -0
- package/lib/StatsPlugin-Cg82JMBD.js.map +1 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js +114 -0
- package/lib/VoiceOverPlugin-BR3ImT8C.js.map +1 -0
- package/lib/caper.mjs +1233 -0
- package/lib/caper.mjs.map +1 -0
- package/lib/core/Application.d.ts +268 -0
- package/lib/core/Application.d.ts.map +1 -0
- package/lib/core/config.d.ts +39 -0
- package/lib/core/config.d.ts.map +1 -0
- package/lib/core/create.d.ts +41 -0
- package/lib/core/create.d.ts.map +1 -0
- package/lib/core/globals.d.ts +51 -0
- package/lib/core/globals.d.ts.map +1 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/interfaces/IApplication.d.ts +566 -0
- package/lib/core/interfaces/IApplication.d.ts.map +1 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts +65 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts +49 -0
- package/lib/core/interfaces/ICoreFunctions.d.ts.map +1 -0
- package/lib/core/interfaces/ICoreSignals.d.ts +57 -0
- package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.d.ts +20 -0
- package/lib/core/interfaces/IStorageCapability.d.ts.map +1 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts +2 -0
- package/lib/core/interfaces/IStorageCapability.test.d.ts.map +1 -0
- package/lib/core/interfaces/index.d.ts +7 -0
- package/lib/core/interfaces/index.d.ts.map +1 -0
- package/lib/core/registries.d.ts +8 -0
- package/lib/core/registries.d.ts.map +1 -0
- package/lib/core/types.d.ts +12 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/display/AnimatedSprite.d.ts +40 -0
- package/lib/display/AnimatedSprite.d.ts.map +1 -0
- package/lib/display/Camera.d.ts +102 -0
- package/lib/display/Camera.d.ts.map +1 -0
- package/lib/display/Container.d.ts +115 -0
- package/lib/display/Container.d.ts.map +1 -0
- package/lib/display/Entity.d.ts +46 -0
- package/lib/display/Entity.d.ts.map +1 -0
- package/lib/display/ParticleContainer.d.ts +58 -0
- package/lib/display/ParticleContainer.d.ts.map +1 -0
- package/lib/display/Scene.d.ts +250 -0
- package/lib/display/Scene.d.ts.map +1 -0
- package/lib/display/SceneTransition.d.ts +41 -0
- package/lib/display/SceneTransition.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +76 -0
- package/lib/display/SpineAnimation.d.ts.map +1 -0
- package/lib/display/Svg.d.ts +5 -0
- package/lib/display/Svg.d.ts.map +1 -0
- package/lib/display/index.d.ts +10 -0
- package/lib/display/index.d.ts.map +1 -0
- package/lib/env.d.ts +6 -0
- package/lib/hello.d.ts +2 -0
- package/lib/hello.d.ts.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/mixins/animated.d.ts +53 -0
- package/lib/mixins/animated.d.ts.map +1 -0
- package/lib/mixins/factory/Factory.d.ts +8 -0
- package/lib/mixins/factory/Factory.d.ts.map +1 -0
- package/lib/mixins/factory/const.d.ts +67 -0
- package/lib/mixins/factory/const.d.ts.map +1 -0
- package/lib/mixins/factory/index.d.ts +8 -0
- package/lib/mixins/factory/index.d.ts.map +1 -0
- package/lib/mixins/factory/methods.d.ts +3 -0
- package/lib/mixins/factory/methods.d.ts.map +1 -0
- package/lib/mixins/factory/props.d.ts +160 -0
- package/lib/mixins/factory/props.d.ts.map +1 -0
- package/lib/mixins/factory/registry.d.ts +27 -0
- package/lib/mixins/factory/registry.d.ts.map +1 -0
- package/lib/mixins/factory/registry.test.d.ts +2 -0
- package/lib/mixins/factory/registry.test.d.ts.map +1 -0
- package/lib/mixins/factory/schema.d.ts +71 -0
- package/lib/mixins/factory/schema.d.ts.map +1 -0
- package/lib/mixins/factory/ui-registry.d.ts +20 -0
- package/lib/mixins/factory/ui-registry.d.ts.map +1 -0
- package/lib/mixins/factory/utils.d.ts +11 -0
- package/lib/mixins/factory/utils.d.ts.map +1 -0
- package/lib/mixins/focus.d.ts +15 -0
- package/lib/mixins/focus.d.ts.map +1 -0
- package/lib/mixins/index.d.ts +6 -0
- package/lib/mixins/index.d.ts.map +1 -0
- package/lib/mixins/interaction.d.ts +20 -0
- package/lib/mixins/interaction.d.ts.map +1 -0
- package/lib/mixins/signals.d.ts +15 -0
- package/lib/mixins/signals.d.ts.map +1 -0
- package/lib/plugins/AssetsPlugin.d.ts +79 -0
- package/lib/plugins/AssetsPlugin.d.ts.map +1 -0
- package/lib/plugins/DataAdapter.d.ts +95 -0
- package/lib/plugins/DataAdapter.d.ts.map +1 -0
- package/lib/plugins/DevToolsPlugin.d.ts +97 -0
- package/lib/plugins/DevToolsPlugin.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts +240 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -0
- package/lib/plugins/GSAPPlugin.d.ts +634 -0
- package/lib/plugins/GSAPPlugin.d.ts.map +1 -0
- package/lib/plugins/KeyboardPlugin.d.ts +53 -0
- package/lib/plugins/KeyboardPlugin.d.ts.map +1 -0
- package/lib/plugins/LayoutPlugin.d.ts +100 -0
- package/lib/plugins/LayoutPlugin.d.ts.map +1 -0
- package/lib/plugins/LookupPlugin.d.ts +223 -0
- package/lib/plugins/LookupPlugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.d.ts +132 -0
- package/lib/plugins/Plugin.d.ts.map +1 -0
- package/lib/plugins/Plugin.test.d.ts +2 -0
- package/lib/plugins/Plugin.test.d.ts.map +1 -0
- package/lib/plugins/PopupManagerPlugin.d.ts +108 -0
- package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/ResizerPlugin.d.ts +62 -0
- package/lib/plugins/ResizerPlugin.d.ts.map +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts +122 -0
- package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/StatsPlugin.d.ts +8 -0
- package/lib/plugins/StatsPlugin.d.ts.map +1 -0
- package/lib/plugins/TimerPlugin.d.ts +401 -0
- package/lib/plugins/TimerPlugin.d.ts.map +1 -0
- package/lib/plugins/WebEventsPlugin.d.ts +60 -0
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts +39 -0
- package/lib/plugins/actions/ActionsPlugin.d.ts.map +1 -0
- package/lib/plugins/actions/constants.d.ts +52 -0
- package/lib/plugins/actions/constants.d.ts.map +1 -0
- package/lib/plugins/actions/index.d.ts +5 -0
- package/lib/plugins/actions/index.d.ts.map +1 -0
- package/lib/plugins/actions/methods.d.ts +11 -0
- package/lib/plugins/actions/methods.d.ts.map +1 -0
- package/lib/plugins/actions/types.d.ts +25 -0
- package/lib/plugins/actions/types.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.d.ts +46 -0
- package/lib/plugins/audio/AudioChannel.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts +2 -0
- package/lib/plugins/audio/AudioChannel.test.d.ts.map +1 -0
- package/lib/plugins/audio/AudioInstance.d.ts +79 -0
- package/lib/plugins/audio/AudioInstance.d.ts.map +1 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts +323 -0
- package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts +69 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -0
- package/lib/plugins/audio/index.d.ts +4 -0
- package/lib/plugins/audio/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts +109 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.d.ts.map +1 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts +2 -0
- package/lib/plugins/breakpoints/BreakpointPlugin.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.d.ts +53 -0
- package/lib/plugins/breakpoints/evaluate.d.ts.map +1 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts +2 -0
- package/lib/plugins/breakpoints/evaluate.test.d.ts.map +1 -0
- package/lib/plugins/breakpoints/index.d.ts +4 -0
- package/lib/plugins/breakpoints/index.d.ts.map +1 -0
- package/lib/plugins/breakpoints/methods.d.ts +23 -0
- package/lib/plugins/breakpoints/methods.d.ts.map +1 -0
- package/lib/plugins/breakpoints/types.d.ts +70 -0
- package/lib/plugins/breakpoints/types.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts +150 -0
- package/lib/plugins/captions/CaptionsPlugin.d.ts.map +1 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts +37 -0
- package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -0
- package/lib/plugins/captions/index.d.ts +3 -0
- package/lib/plugins/captions/index.d.ts.map +1 -0
- package/lib/plugins/defaults.d.ts +4 -0
- package/lib/plugins/defaults.d.ts.map +1 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts +148 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -0
- package/lib/plugins/focus/FocusOutliner.d.ts +32 -0
- package/lib/plugins/focus/FocusOutliner.d.ts.map +1 -0
- package/lib/plugins/focus/index.d.ts +3 -0
- package/lib/plugins/focus/index.d.ts.map +1 -0
- package/lib/plugins/i18nPlugin.d.ts +128 -0
- package/lib/plugins/i18nPlugin.d.ts.map +1 -0
- package/lib/plugins/index.d.ts +18 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/input/AbstractControls.d.ts +8 -0
- package/lib/plugins/input/AbstractControls.d.ts.map +1 -0
- package/lib/plugins/input/Controls.d.ts +16 -0
- package/lib/plugins/input/Controls.d.ts.map +1 -0
- package/lib/plugins/input/InputPlugin.d.ts +52 -0
- package/lib/plugins/input/InputPlugin.d.ts.map +1 -0
- package/lib/plugins/input/constants.d.ts +8 -0
- package/lib/plugins/input/constants.d.ts.map +1 -0
- package/lib/plugins/input/index.d.ts +10 -0
- package/lib/plugins/input/index.d.ts.map +1 -0
- package/lib/plugins/input/interfaces.d.ts +30 -0
- package/lib/plugins/input/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts +28 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/index.d.ts +3 -0
- package/lib/plugins/input/keyboard/index.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts +18 -0
- package/lib/plugins/input/keyboard/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/methods.d.ts +4 -0
- package/lib/plugins/input/methods.d.ts.map +1 -0
- package/lib/plugins/input/touch/TouchControls.d.ts +35 -0
- package/lib/plugins/input/touch/TouchControls.d.ts.map +1 -0
- package/lib/plugins/input/touch/constants.d.ts +14 -0
- package/lib/plugins/input/touch/constants.d.ts.map +1 -0
- package/lib/plugins/input/touch/index.d.ts +4 -0
- package/lib/plugins/input/touch/index.d.ts.map +1 -0
- package/lib/plugins/input/touch/interfaces.d.ts +15 -0
- package/lib/plugins/input/touch/interfaces.d.ts.map +1 -0
- package/lib/plugins/input/types.d.ts +32 -0
- package/lib/plugins/input/types.d.ts.map +1 -0
- package/lib/plugins/input/utils.d.ts +23 -0
- package/lib/plugins/input/utils.d.ts.map +1 -0
- package/lib/plugins/spine/SpinePlugin.d.ts +6 -0
- package/lib/plugins/spine/SpinePlugin.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts +31 -0
- package/lib/plugins/spine/pixi-spine/BatchableSpineSlot.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts +211 -0
- package/lib/plugins/spine/pixi-spine/Spine.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts +81 -0
- package/lib/plugins/spine/pixi-spine/SpineDebugRenderer.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts +21 -0
- package/lib/plugins/spine/pixi-spine/SpinePipe.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts +16 -0
- package/lib/plugins/spine/pixi-spine/SpineTexture.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts +10 -0
- package/lib/plugins/spine/pixi-spine/assets/atlasLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts +6 -0
- package/lib/plugins/spine/pixi-spine/assets/skeletonLoader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts +22 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintBatcher.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts +5 -0
- package/lib/plugins/spine/pixi-spine/darktint/DarkTintShader.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts +51 -0
- package/lib/plugins/spine/pixi-spine/darktint/darkTintBit.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts +9 -0
- package/lib/plugins/spine/pixi-spine/index.d.ts.map +1 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts +34 -0
- package/lib/plugins/spine/pixi-spine/require-shim.d.ts.map +1 -0
- package/lib/registries-CYCaYKZI.js +6885 -0
- package/lib/registries-CYCaYKZI.js.map +1 -0
- package/lib/signals/Signal.d.ts +16 -0
- package/lib/signals/Signal.d.ts.map +1 -0
- package/lib/signals/Signal.test.d.ts +2 -0
- package/lib/signals/Signal.test.d.ts.map +1 -0
- package/lib/signals/index.d.ts +3 -0
- package/lib/signals/index.d.ts.map +1 -0
- package/lib/store/Store.d.ts +56 -0
- package/lib/store/Store.d.ts.map +1 -0
- package/lib/store/Store.test.d.ts +2 -0
- package/lib/store/Store.test.d.ts.map +1 -0
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/types/framework.d.ts +46 -0
- package/lib/types/gsap.d.ts +23 -0
- package/lib/ui/Button.d.ts +162 -0
- package/lib/ui/Button.d.ts.map +1 -0
- package/lib/ui/FlexContainer.d.ts +109 -0
- package/lib/ui/FlexContainer.d.ts.map +1 -0
- package/lib/ui/Input.d.ts +384 -0
- package/lib/ui/Input.d.ts.map +1 -0
- package/lib/ui/Joystick.d.ts +61 -0
- package/lib/ui/Joystick.d.ts.map +1 -0
- package/lib/ui/Popup.d.ts +109 -0
- package/lib/ui/Popup.d.ts.map +1 -0
- package/lib/ui/Toast.d.ts +131 -0
- package/lib/ui/Toast.d.ts.map +1 -0
- package/lib/ui/Toaster.d.ts +188 -0
- package/lib/ui/Toaster.d.ts.map +1 -0
- package/lib/ui/UICanvas.d.ts +155 -0
- package/lib/ui/UICanvas.d.ts.map +1 -0
- package/lib/ui/index.d.ts +9 -0
- package/lib/ui/index.d.ts.map +1 -0
- package/lib/utils/array.d.ts +11 -0
- package/lib/utils/array.d.ts.map +1 -0
- package/lib/utils/bind.d.ts +21 -0
- package/lib/utils/bind.d.ts.map +1 -0
- package/lib/utils/canvas.d.ts +2 -0
- package/lib/utils/canvas.d.ts.map +1 -0
- package/lib/utils/color.d.ts +66 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/console/Logger.d.ts +15 -0
- package/lib/utils/console/Logger.d.ts.map +1 -0
- package/lib/utils/console/index.d.ts +2 -0
- package/lib/utils/console/index.d.ts.map +1 -0
- package/lib/utils/debug.d.ts +34 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/define.d.ts +100 -0
- package/lib/utils/define.d.ts.map +1 -0
- package/lib/utils/env.d.ts +4 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/events.d.ts +12 -0
- package/lib/utils/events.d.ts.map +1 -0
- package/lib/utils/framework.d.ts +12 -0
- package/lib/utils/framework.d.ts.map +1 -0
- package/lib/utils/index.d.ts +28 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/map.d.ts +31 -0
- package/lib/utils/map.d.ts.map +1 -0
- package/lib/utils/math.d.ts +15 -0
- package/lib/utils/math.d.ts.map +1 -0
- package/lib/utils/misc.d.ts +13 -0
- package/lib/utils/misc.d.ts.map +1 -0
- package/lib/utils/number.d.ts +2 -0
- package/lib/utils/number.d.ts.map +1 -0
- package/lib/utils/object.d.ts +21 -0
- package/lib/utils/object.d.ts.map +1 -0
- package/lib/utils/padding.d.ts +4 -0
- package/lib/utils/padding.d.ts.map +1 -0
- package/lib/utils/pixi.d.ts +42 -0
- package/lib/utils/pixi.d.ts.map +1 -0
- package/lib/utils/platform.d.ts +20 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/point.d.ts +66 -0
- package/lib/utils/point.d.ts.map +1 -0
- package/lib/utils/promise/Queue.d.ts +60 -0
- package/lib/utils/promise/Queue.d.ts.map +1 -0
- package/lib/utils/promise/functions.d.ts +14 -0
- package/lib/utils/promise/functions.d.ts.map +1 -0
- package/lib/utils/promise/index.d.ts +3 -0
- package/lib/utils/promise/index.d.ts.map +1 -0
- package/lib/utils/random.d.ts +42 -0
- package/lib/utils/random.d.ts.map +1 -0
- package/lib/utils/rect.d.ts +26 -0
- package/lib/utils/rect.d.ts.map +1 -0
- package/lib/utils/set.d.ts +15 -0
- package/lib/utils/set.d.ts.map +1 -0
- package/lib/utils/string.d.ts +3 -0
- package/lib/utils/string.d.ts.map +1 -0
- package/lib/utils/text.d.ts +3 -0
- package/lib/utils/text.d.ts.map +1 -0
- package/lib/utils/typefilters.d.ts +4 -0
- package/lib/utils/typefilters.d.ts.map +1 -0
- package/lib/utils/types.d.ts +209 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/vite.d.ts +25 -0
- package/lib/utils/vite.d.ts.map +1 -0
- package/lib/utils/web.d.ts +3 -0
- package/lib/utils/web.d.ts.map +1 -0
- package/lib/version.d.ts +3 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/webgl-check.d.ts +2 -0
- package/lib/webgl-check.d.ts.map +1 -0
- package/package.json +138 -0
- package/src/core/Application.ts +1091 -0
- package/src/core/config.ts +168 -0
- package/src/core/create.ts +186 -0
- package/src/core/globals.ts +299 -0
- package/src/core/index.ts +6 -0
- package/src/core/interfaces/IApplication.ts +628 -0
- package/src/core/interfaces/IApplicationOptions.ts +81 -0
- package/src/core/interfaces/ICoreFunctions.ts +86 -0
- package/src/core/interfaces/ICoreSignals.ts +77 -0
- package/src/core/interfaces/IStorageCapability.test.ts +27 -0
- package/src/core/interfaces/IStorageCapability.ts +26 -0
- package/src/core/interfaces/index.ts +6 -0
- package/src/core/registries.ts +7 -0
- package/src/core/types.ts +13 -0
- package/src/display/AnimatedSprite.ts +227 -0
- package/src/display/Camera.ts +371 -0
- package/src/display/Container.ts +240 -0
- package/src/display/Entity.ts +50 -0
- package/src/display/ParticleContainer.ts +107 -0
- package/src/display/Scene.ts +305 -0
- package/src/display/SceneTransition.ts +108 -0
- package/src/display/SpineAnimation.ts +170 -0
- package/src/display/Svg.ts +9 -0
- package/src/display/index.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/hello.ts +20 -0
- package/src/index.ts +17 -0
- package/src/mixins/animated.ts +340 -0
- package/src/mixins/factory/Factory.ts +24 -0
- package/src/mixins/factory/const.ts +363 -0
- package/src/mixins/factory/index.ts +7 -0
- package/src/mixins/factory/methods.ts +21 -0
- package/src/mixins/factory/props.ts +207 -0
- package/src/mixins/factory/registry.test.ts +83 -0
- package/src/mixins/factory/registry.ts +61 -0
- package/src/mixins/factory/schema.ts +153 -0
- package/src/mixins/factory/ui-registry.ts +54 -0
- package/src/mixins/factory/utils.ts +130 -0
- package/src/mixins/focus.ts +124 -0
- package/src/mixins/index.ts +5 -0
- package/src/mixins/interaction.ts +74 -0
- package/src/mixins/signals.ts +49 -0
- package/src/plugins/AssetsPlugin.ts +407 -0
- package/src/plugins/DataAdapter.ts +259 -0
- package/src/plugins/DevToolsPlugin.ts +103 -0
- package/src/plugins/FullScreenPlugin.ts +359 -0
- package/src/plugins/GSAPPlugin.ts +811 -0
- package/src/plugins/KeyboardPlugin.ts +160 -0
- package/src/plugins/LayoutPlugin.ts +127 -0
- package/src/plugins/LookupPlugin.ts +308 -0
- package/src/plugins/Plugin.test.ts +73 -0
- package/src/plugins/Plugin.ts +200 -0
- package/src/plugins/PopupManagerPlugin.ts +263 -0
- package/src/plugins/ResizerPlugin.ts +220 -0
- package/src/plugins/SceneManagerPlugin.ts +669 -0
- package/src/plugins/StatsPlugin.ts +24 -0
- package/src/plugins/TimerPlugin.ts +841 -0
- package/src/plugins/WebEventsPlugin.ts +132 -0
- package/src/plugins/actions/ActionsPlugin.ts +113 -0
- package/src/plugins/actions/constants.ts +45 -0
- package/src/plugins/actions/index.ts +4 -0
- package/src/plugins/actions/methods.ts +28 -0
- package/src/plugins/actions/types.ts +47 -0
- package/src/plugins/audio/AudioChannel.test.ts +101 -0
- package/src/plugins/audio/AudioChannel.ts +164 -0
- package/src/plugins/audio/AudioInstance.ts +228 -0
- package/src/plugins/audio/AudioManagerPlugin.ts +903 -0
- package/src/plugins/audio/VoiceOverPlugin.ts +354 -0
- package/src/plugins/audio/index.ts +3 -0
- package/src/plugins/breakpoints/BreakpointPlugin.test.ts +228 -0
- package/src/plugins/breakpoints/BreakpointPlugin.ts +293 -0
- package/src/plugins/breakpoints/evaluate.test.ts +239 -0
- package/src/plugins/breakpoints/evaluate.ts +201 -0
- package/src/plugins/breakpoints/index.ts +3 -0
- package/src/plugins/breakpoints/methods.ts +22 -0
- package/src/plugins/breakpoints/types.ts +86 -0
- package/src/plugins/captions/CaptionsPlugin.ts +468 -0
- package/src/plugins/captions/CaptionsRenderer.ts +184 -0
- package/src/plugins/captions/font/Sans.fnt +116 -0
- package/src/plugins/captions/font/Sans.png +0 -0
- package/src/plugins/captions/index.ts +2 -0
- package/src/plugins/defaults.ts +95 -0
- package/src/plugins/focus/FocusManagerPlugin.ts +773 -0
- package/src/plugins/focus/FocusOutliner.ts +111 -0
- package/src/plugins/focus/index.ts +2 -0
- package/src/plugins/i18nPlugin.ts +284 -0
- package/src/plugins/index.ts +17 -0
- package/src/plugins/input/AbstractControls.ts +15 -0
- package/src/plugins/input/Controls.ts +55 -0
- package/src/plugins/input/InputPlugin.ts +168 -0
- package/src/plugins/input/constants.ts +12 -0
- package/src/plugins/input/index.ts +9 -0
- package/src/plugins/input/interfaces.ts +37 -0
- package/src/plugins/input/keyboard/KeyboardContols.ts +182 -0
- package/src/plugins/input/keyboard/index.ts +2 -0
- package/src/plugins/input/keyboard/interfaces.ts +21 -0
- package/src/plugins/input/methods.ts +9 -0
- package/src/plugins/input/touch/TouchControls.ts +237 -0
- package/src/plugins/input/touch/constants.ts +34 -0
- package/src/plugins/input/touch/index.ts +3 -0
- package/src/plugins/input/touch/interfaces.ts +15 -0
- package/src/plugins/input/types.ts +41 -0
- package/src/plugins/input/utils.ts +10 -0
- package/src/plugins/spine/SpinePlugin.ts +14 -0
- package/src/plugins/spine/pixi-spine/BatchableSpineSlot.ts +138 -0
- package/src/plugins/spine/pixi-spine/Spine.ts +897 -0
- package/src/plugins/spine/pixi-spine/SpineDebugRenderer.ts +615 -0
- package/src/plugins/spine/pixi-spine/SpinePipe.ts +197 -0
- package/src/plugins/spine/pixi-spine/SpineTexture.ts +143 -0
- package/src/plugins/spine/pixi-spine/assets/atlasLoader.ts +156 -0
- package/src/plugins/spine/pixi-spine/assets/skeletonLoader.ts +80 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatchGeometry.ts +92 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintBatcher.ts +186 -0
- package/src/plugins/spine/pixi-spine/darktint/DarkTintShader.ts +74 -0
- package/src/plugins/spine/pixi-spine/darktint/darkTintBit.ts +77 -0
- package/src/plugins/spine/pixi-spine/index.ts +43 -0
- package/src/plugins/spine/pixi-spine/require-shim.ts +43 -0
- package/src/signals/Signal.test.ts +54 -0
- package/src/signals/Signal.ts +68 -0
- package/src/signals/index.ts +10 -0
- package/src/store/Store.test.ts +146 -0
- package/src/store/Store.ts +192 -0
- package/src/store/index.ts +1 -0
- package/src/types/framework.d.ts +47 -0
- package/src/types/gsap.d.ts +26 -0
- package/src/ui/Button.ts +454 -0
- package/src/ui/FlexContainer.ts +526 -0
- package/src/ui/Input.ts +1274 -0
- package/src/ui/Joystick.ts +288 -0
- package/src/ui/Popup.ts +242 -0
- package/src/ui/Toast.ts +399 -0
- package/src/ui/Toaster.ts +409 -0
- package/src/ui/UICanvas.ts +812 -0
- package/src/ui/index.ts +8 -0
- package/src/utils/array.ts +24 -0
- package/src/utils/bind.ts +79 -0
- package/src/utils/canvas.ts +26 -0
- package/src/utils/color.ts +126 -0
- package/src/utils/console/Logger.ts +86 -0
- package/src/utils/console/index.ts +1 -0
- package/src/utils/debug.ts +69 -0
- package/src/utils/define.ts +120 -0
- package/src/utils/env.ts +3 -0
- package/src/utils/events.ts +10 -0
- package/src/utils/framework.ts +45 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/map.ts +59 -0
- package/src/utils/math.ts +19 -0
- package/src/utils/misc.ts +45 -0
- package/src/utils/number.ts +3 -0
- package/src/utils/object.ts +43 -0
- package/src/utils/padding.ts +43 -0
- package/src/utils/pixi.ts +116 -0
- package/src/utils/platform.ts +33 -0
- package/src/utils/point.ts +123 -0
- package/src/utils/promise/Queue.ts +125 -0
- package/src/utils/promise/functions.ts +16 -0
- package/src/utils/promise/index.ts +2 -0
- package/src/utils/random.ts +69 -0
- package/src/utils/rect.ts +50 -0
- package/src/utils/set.ts +32 -0
- package/src/utils/string.ts +9 -0
- package/src/utils/text.ts +30 -0
- package/src/utils/typefilters.ts +29 -0
- package/src/utils/types.ts +426 -0
- package/src/utils/vite.ts +41 -0
- package/src/utils/web.ts +7 -0
- package/src/version.ts +3 -0
- package/src/webgl-check.ts +12 -0
- package/templates/app/default/.eslintrc.json +21 -0
- package/templates/app/default/.meta.json +4 -0
- package/templates/app/default/.nvmrc +1 -0
- package/templates/app/default/.prettierrc.json +7 -0
- package/templates/app/default/README.md +8 -0
- package/templates/app/default/assets/audio{m}/music/Cheerful Annoyance.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Drumming Sticks.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Game Over.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Mishief Stroll.ogg +0 -0
- package/templates/app/default/assets/audio{m}/music/Night at the Beach.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/click.ogg +0 -0
- package/templates/app/default/assets/audio{m}/sfx/hover.ogg +0 -0
- package/templates/app/default/assets/required{m}/caper.png +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Bold{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Medium{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/SpaceGrotesk-Regular{family=Space Grotesk}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/fonts{fix}/Syncopate-Bold{family=Syncopate}{wf}.ttf +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/blue.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/green.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/grey.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/orange.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/purple.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/red.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn/yellow.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_a/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/down.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/over.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/btn_b/up.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/base.png +0 -0
- package/templates/app/default/assets/required{m}/ui{tps}/joystick/handle.png +0 -0
- package/templates/app/default/assets/required{m}/wordmark.svg +1 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.png +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro.skel +0 -0
- package/templates/app/default/assets/spine{m}/spineboy-pro{fix}.atlas +94 -0
- package/templates/app/default/caper.config.ts +60 -0
- package/templates/app/default/index.html +23 -0
- package/templates/app/default/package.template.json +17 -0
- package/templates/app/default/public/favicon.ico +0 -0
- package/templates/app/default/src/__APPLICATION_NAME__.ts +3 -0
- package/templates/app/default/src/main.ts +9 -0
- package/templates/app/default/src/scenes/Base.ts +39 -0
- package/templates/app/default/src/scenes/Game.ts +34 -0
- package/templates/app/default/src/scenes/Splash.ts +70 -0
- package/templates/app/default/src/scenes/Start.ts +90 -0
- package/templates/app/default/src/utils/Constants.ts +3 -0
- package/templates/app/default/tsconfig.json +1 -0
- package/templates/plugin/package.template.json +33 -0
- package/templates/plugin/src/Plugin.template.ts +24 -0
- package/templates/plugin/src/index.template.ts +3 -0
- package/templates/plugin/tsconfig.template.json +43 -0
- package/templates/plugin/vite-env.template.d.ts +16 -0
- package/templates/plugin/vite.config.template.ts +19 -0
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
/** ****************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
13
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
27
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
|
|
30
|
+
import { Container, Graphics, Text } from 'pixi.js';
|
|
31
|
+
import { Spine } from './Spine.js';
|
|
32
|
+
import {
|
|
33
|
+
ClippingAttachment,
|
|
34
|
+
MeshAttachment,
|
|
35
|
+
PathAttachment,
|
|
36
|
+
RegionAttachment,
|
|
37
|
+
SkeletonBounds
|
|
38
|
+
} from '@esotericsoftware/spine-core';
|
|
39
|
+
|
|
40
|
+
import type { AnimationStateListener } from '@esotericsoftware/spine-core';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Make a class that extends from this interface to create your own debug renderer.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export interface ISpineDebugRenderer {
|
|
47
|
+
/**
|
|
48
|
+
* This will be called every frame, after the spine has been updated.
|
|
49
|
+
*/
|
|
50
|
+
renderDebug: (spine: Spine) => void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* This is called when the `spine.debug` object is set to null or when the spine is destroyed.
|
|
54
|
+
*/
|
|
55
|
+
unregisterSpine: (spine: Spine) => void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* This is called when the `spine.debug` object is set to a new instance of a debug renderer.
|
|
59
|
+
*/
|
|
60
|
+
registerSpine: (spine: Spine) => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type DebugDisplayObjects = {
|
|
64
|
+
bones: Container;
|
|
65
|
+
skeletonXY: Graphics;
|
|
66
|
+
regionAttachmentsShape: Graphics;
|
|
67
|
+
meshTrianglesLine: Graphics;
|
|
68
|
+
meshHullLine: Graphics;
|
|
69
|
+
clippingPolygon: Graphics;
|
|
70
|
+
boundingBoxesRect: Graphics;
|
|
71
|
+
boundingBoxesCircle: Graphics;
|
|
72
|
+
boundingBoxesPolygon: Graphics;
|
|
73
|
+
pathsCurve: Graphics;
|
|
74
|
+
pathsLine: Graphics;
|
|
75
|
+
parentDebugContainer: Container;
|
|
76
|
+
eventText: Container;
|
|
77
|
+
eventCallback: AnimationStateListener;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* This is a debug renderer that uses PixiJS Graphics under the hood.
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export class SpineDebugRenderer implements ISpineDebugRenderer {
|
|
85
|
+
private readonly registeredSpines: Map<Spine, DebugDisplayObjects> = new Map();
|
|
86
|
+
|
|
87
|
+
public drawMeshHull = true;
|
|
88
|
+
public drawMeshTriangles = true;
|
|
89
|
+
public drawBones = true;
|
|
90
|
+
public drawPaths = true;
|
|
91
|
+
public drawBoundingBoxes = true;
|
|
92
|
+
public drawClipping = true;
|
|
93
|
+
public drawRegionAttachments = true;
|
|
94
|
+
public drawEvents = true;
|
|
95
|
+
|
|
96
|
+
public lineWidth = 1;
|
|
97
|
+
public regionAttachmentsColor = 0x0078ff;
|
|
98
|
+
public meshHullColor = 0x0078ff;
|
|
99
|
+
public meshTrianglesColor = 0xffcc00;
|
|
100
|
+
public clippingPolygonColor = 0xff00ff;
|
|
101
|
+
public boundingBoxesRectColor = 0x00ff00;
|
|
102
|
+
public boundingBoxesPolygonColor = 0x00ff00;
|
|
103
|
+
public boundingBoxesCircleColor = 0x00ff00;
|
|
104
|
+
public pathsCurveColor = 0xff0000;
|
|
105
|
+
public pathsLineColor = 0xff00ff;
|
|
106
|
+
public skeletonXYColor = 0xff0000;
|
|
107
|
+
public bonesColor = 0x00eecc;
|
|
108
|
+
public eventFontSize = 24;
|
|
109
|
+
public eventFontColor = 0x0;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The debug is attached by force to each spine object.
|
|
113
|
+
* So we need to create it inside the spine when we get the first update
|
|
114
|
+
*/
|
|
115
|
+
public registerSpine (spine: Spine): void {
|
|
116
|
+
if (this.registeredSpines.has(spine)) {
|
|
117
|
+
console.warn('SpineDebugRenderer.registerSpine() - this spine is already registered!', spine);
|
|
118
|
+
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const debugDisplayObjects: DebugDisplayObjects = {
|
|
122
|
+
parentDebugContainer: new Container(),
|
|
123
|
+
bones: new Container(),
|
|
124
|
+
skeletonXY: new Graphics(),
|
|
125
|
+
regionAttachmentsShape: new Graphics(),
|
|
126
|
+
meshTrianglesLine: new Graphics(),
|
|
127
|
+
meshHullLine: new Graphics(),
|
|
128
|
+
clippingPolygon: new Graphics(),
|
|
129
|
+
boundingBoxesRect: new Graphics(),
|
|
130
|
+
boundingBoxesCircle: new Graphics(),
|
|
131
|
+
boundingBoxesPolygon: new Graphics(),
|
|
132
|
+
pathsCurve: new Graphics(),
|
|
133
|
+
pathsLine: new Graphics(),
|
|
134
|
+
eventText: new Container(),
|
|
135
|
+
eventCallback: {
|
|
136
|
+
event: (_, event) => {
|
|
137
|
+
if (this.drawEvents) {
|
|
138
|
+
const scale = Math.abs(spine.scale.x || spine.scale.y || 1);
|
|
139
|
+
const text = new Text({
|
|
140
|
+
text: event.data.name,
|
|
141
|
+
style: {
|
|
142
|
+
fontSize: this.eventFontSize / scale,
|
|
143
|
+
fill: this.eventFontColor,
|
|
144
|
+
fontFamily: 'monospace'
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
text.scale.x = Math.sign(spine.scale.x);
|
|
149
|
+
text.anchor.set(0.5);
|
|
150
|
+
debugDisplayObjects.eventText.addChild(text);
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
if (!text.destroyed) {
|
|
153
|
+
text.destroy();
|
|
154
|
+
}
|
|
155
|
+
}, 250);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.bones);
|
|
162
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.skeletonXY);
|
|
163
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.regionAttachmentsShape);
|
|
164
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshTrianglesLine);
|
|
165
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshHullLine);
|
|
166
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.clippingPolygon);
|
|
167
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesRect);
|
|
168
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesCircle);
|
|
169
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesPolygon);
|
|
170
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsCurve);
|
|
171
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsLine);
|
|
172
|
+
debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.eventText);
|
|
173
|
+
|
|
174
|
+
(debugDisplayObjects.parentDebugContainer as any).zIndex = 9999999;
|
|
175
|
+
|
|
176
|
+
// Disable screen reader and mouse input on debug objects.
|
|
177
|
+
(debugDisplayObjects.parentDebugContainer as any).accessibleChildren = false;
|
|
178
|
+
(debugDisplayObjects.parentDebugContainer as any).eventMode = 'none';
|
|
179
|
+
(debugDisplayObjects.parentDebugContainer as any).interactiveChildren = false;
|
|
180
|
+
|
|
181
|
+
spine.addChild(debugDisplayObjects.parentDebugContainer);
|
|
182
|
+
|
|
183
|
+
spine.state.addListener(debugDisplayObjects.eventCallback);
|
|
184
|
+
|
|
185
|
+
this.registeredSpines.set(spine, debugDisplayObjects);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public renderDebug (spine: Spine): void {
|
|
189
|
+
if (!this.registeredSpines.has(spine)) {
|
|
190
|
+
// This should never happen. Spines are registered when you assign spine.debug
|
|
191
|
+
this.registerSpine(spine);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const debugDisplayObjects = this.registeredSpines.get(spine);
|
|
195
|
+
|
|
196
|
+
if (!debugDisplayObjects) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
spine.addChild(debugDisplayObjects.parentDebugContainer);
|
|
200
|
+
|
|
201
|
+
debugDisplayObjects.skeletonXY.clear();
|
|
202
|
+
debugDisplayObjects.regionAttachmentsShape.clear();
|
|
203
|
+
debugDisplayObjects.meshTrianglesLine.clear();
|
|
204
|
+
debugDisplayObjects.meshHullLine.clear();
|
|
205
|
+
debugDisplayObjects.clippingPolygon.clear();
|
|
206
|
+
debugDisplayObjects.boundingBoxesRect.clear();
|
|
207
|
+
debugDisplayObjects.boundingBoxesCircle.clear();
|
|
208
|
+
debugDisplayObjects.boundingBoxesPolygon.clear();
|
|
209
|
+
debugDisplayObjects.pathsCurve.clear();
|
|
210
|
+
debugDisplayObjects.pathsLine.clear();
|
|
211
|
+
|
|
212
|
+
for (let len = debugDisplayObjects.bones.children.length; len > 0; len--) {
|
|
213
|
+
debugDisplayObjects.bones.children[len - 1].destroy({ children: true, texture: true, textureSource: true });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const scale = Math.abs(spine.scale.x || spine.scale.y || 1);
|
|
217
|
+
const lineWidth = this.lineWidth / scale;
|
|
218
|
+
|
|
219
|
+
if (this.drawBones) {
|
|
220
|
+
this.drawBonesFunc(spine, debugDisplayObjects, lineWidth, scale);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (this.drawPaths) {
|
|
224
|
+
this.drawPathsFunc(spine, debugDisplayObjects, lineWidth);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (this.drawBoundingBoxes) {
|
|
228
|
+
this.drawBoundingBoxesFunc(spine, debugDisplayObjects, lineWidth);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (this.drawClipping) {
|
|
232
|
+
this.drawClippingFunc(spine, debugDisplayObjects, lineWidth);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (this.drawMeshHull || this.drawMeshTriangles) {
|
|
236
|
+
this.drawMeshHullAndMeshTriangles(spine, debugDisplayObjects, lineWidth);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (this.drawRegionAttachments) {
|
|
240
|
+
this.drawRegionAttachmentsFunc(spine, debugDisplayObjects, lineWidth);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (this.drawEvents) {
|
|
244
|
+
for (const child of debugDisplayObjects.eventText.children) {
|
|
245
|
+
child.alpha -= 0.05;
|
|
246
|
+
child.y -= 2;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
private drawBonesFunc (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number, scale: number): void {
|
|
252
|
+
const skeleton = spine.skeleton;
|
|
253
|
+
const skeletonX = skeleton.x;
|
|
254
|
+
const skeletonY = skeleton.y;
|
|
255
|
+
const bones = skeleton.bones;
|
|
256
|
+
|
|
257
|
+
debugDisplayObjects.skeletonXY.strokeStyle = { width: lineWidth, color: this.skeletonXYColor };
|
|
258
|
+
|
|
259
|
+
for (let i = 0, len = bones.length; i < len; i++) {
|
|
260
|
+
const bone = bones[i];
|
|
261
|
+
const boneLen = bone.data.length;
|
|
262
|
+
const starX = skeletonX + bone.worldX;
|
|
263
|
+
const starY = skeletonY + bone.worldY;
|
|
264
|
+
const endX = skeletonX + (boneLen * bone.a) + bone.worldX;
|
|
265
|
+
const endY = skeletonY + (boneLen * bone.b) + bone.worldY;
|
|
266
|
+
|
|
267
|
+
if (bone.data.name === 'root' || bone.data.parent === null) {
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const w = Math.abs(starX - endX);
|
|
272
|
+
const h = Math.abs(starY - endY);
|
|
273
|
+
// a = w, // side length a
|
|
274
|
+
const a2 = Math.pow(w, 2); // square root of side length a
|
|
275
|
+
const b = h; // side length b
|
|
276
|
+
const b2 = Math.pow(h, 2); // square root of side length b
|
|
277
|
+
const c = Math.sqrt(a2 + b2); // side length c
|
|
278
|
+
const c2 = Math.pow(c, 2); // square root of side length c
|
|
279
|
+
const rad = Math.PI / 180;
|
|
280
|
+
// A = Math.acos([a2 + c2 - b2] / [2 * a * c]) || 0, // Angle A
|
|
281
|
+
// C = Math.acos([a2 + b2 - c2] / [2 * a * b]) || 0, // C angle
|
|
282
|
+
const B = Math.acos((c2 + b2 - a2) / (2 * b * c)) || 0; // angle of corner B
|
|
283
|
+
|
|
284
|
+
if (c === 0) {
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const gp = new Graphics();
|
|
289
|
+
|
|
290
|
+
debugDisplayObjects.bones.addChild(gp);
|
|
291
|
+
|
|
292
|
+
// draw bone
|
|
293
|
+
const refRation = c / 50 / scale;
|
|
294
|
+
|
|
295
|
+
gp.context
|
|
296
|
+
.poly([0, 0, 0 - refRation, c - (refRation * 3), 0, c - refRation, 0 + refRation, c - (refRation * 3)])
|
|
297
|
+
.fill(this.bonesColor);
|
|
298
|
+
gp.x = starX;
|
|
299
|
+
gp.y = starY;
|
|
300
|
+
gp.pivot.y = c;
|
|
301
|
+
|
|
302
|
+
// Calculate bone rotation angle
|
|
303
|
+
let rotation = 0;
|
|
304
|
+
|
|
305
|
+
if (starX < endX && starY < endY) {
|
|
306
|
+
// bottom right
|
|
307
|
+
rotation = -B + (180 * rad);
|
|
308
|
+
}
|
|
309
|
+
else if (starX > endX && starY < endY) {
|
|
310
|
+
// bottom left
|
|
311
|
+
rotation = (180 * rad) + B;
|
|
312
|
+
}
|
|
313
|
+
else if (starX > endX && starY > endY) {
|
|
314
|
+
// top left
|
|
315
|
+
rotation = -B;
|
|
316
|
+
}
|
|
317
|
+
else if (starX < endX && starY > endY) {
|
|
318
|
+
// bottom left
|
|
319
|
+
rotation = B;
|
|
320
|
+
}
|
|
321
|
+
else if (starY === endY && starX < endX) {
|
|
322
|
+
// To the right
|
|
323
|
+
rotation = 90 * rad;
|
|
324
|
+
}
|
|
325
|
+
else if (starY === endY && starX > endX) {
|
|
326
|
+
// go left
|
|
327
|
+
rotation = -90 * rad;
|
|
328
|
+
}
|
|
329
|
+
else if (starX === endX && starY < endY) {
|
|
330
|
+
// down
|
|
331
|
+
rotation = 180 * rad;
|
|
332
|
+
}
|
|
333
|
+
else if (starX === endX && starY > endY) {
|
|
334
|
+
// up
|
|
335
|
+
rotation = 0;
|
|
336
|
+
}
|
|
337
|
+
gp.rotation = rotation;
|
|
338
|
+
|
|
339
|
+
// Draw the starting rotation point of the bone
|
|
340
|
+
gp.circle(0, c, refRation * 1.2)
|
|
341
|
+
.fill({ color: 0x000000, alpha: 0.6 })
|
|
342
|
+
.stroke({ width: lineWidth + refRation / 2.4, color: this.bonesColor });
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Draw the skeleton starting point "X" form
|
|
346
|
+
const startDotSize = lineWidth * 3;
|
|
347
|
+
|
|
348
|
+
debugDisplayObjects.skeletonXY.context
|
|
349
|
+
.moveTo(skeletonX - startDotSize, skeletonY - startDotSize)
|
|
350
|
+
.lineTo(skeletonX + startDotSize, skeletonY + startDotSize)
|
|
351
|
+
.moveTo(skeletonX + startDotSize, skeletonY - startDotSize)
|
|
352
|
+
.lineTo(skeletonX - startDotSize, skeletonY + startDotSize)
|
|
353
|
+
.stroke();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
private drawRegionAttachmentsFunc (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number): void {
|
|
357
|
+
const skeleton = spine.skeleton;
|
|
358
|
+
const slots = skeleton.slots;
|
|
359
|
+
|
|
360
|
+
for (let i = 0, len = slots.length; i < len; i++) {
|
|
361
|
+
const slot = slots[i];
|
|
362
|
+
const attachment = slot.getAttachment();
|
|
363
|
+
|
|
364
|
+
if (attachment === null || !(attachment instanceof RegionAttachment)) {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const regionAttachment = attachment;
|
|
369
|
+
|
|
370
|
+
const vertices = new Float32Array(8);
|
|
371
|
+
|
|
372
|
+
regionAttachment.computeWorldVertices(slot, vertices, 0, 2);
|
|
373
|
+
|
|
374
|
+
debugDisplayObjects.regionAttachmentsShape.poly(Array.from(vertices.slice(0, 8)));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
debugDisplayObjects.regionAttachmentsShape.stroke({
|
|
378
|
+
color: this.regionAttachmentsColor,
|
|
379
|
+
width: lineWidth
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
private drawMeshHullAndMeshTriangles (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number): void {
|
|
384
|
+
const skeleton = spine.skeleton;
|
|
385
|
+
const slots = skeleton.slots;
|
|
386
|
+
|
|
387
|
+
for (let i = 0, len = slots.length; i < len; i++) {
|
|
388
|
+
const slot = slots[i];
|
|
389
|
+
|
|
390
|
+
if (!slot.bone.active) {
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
const attachment = slot.getAttachment();
|
|
394
|
+
|
|
395
|
+
if (attachment === null || !(attachment instanceof MeshAttachment)) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const meshAttachment = attachment;
|
|
400
|
+
|
|
401
|
+
const vertices = new Float32Array(meshAttachment.worldVerticesLength);
|
|
402
|
+
const triangles = meshAttachment.triangles;
|
|
403
|
+
let hullLength = meshAttachment.hullLength;
|
|
404
|
+
|
|
405
|
+
meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, vertices, 0, 2);
|
|
406
|
+
// draw the skinned mesh (triangle)
|
|
407
|
+
if (this.drawMeshTriangles) {
|
|
408
|
+
for (let i = 0, len = triangles.length; i < len; i += 3) {
|
|
409
|
+
const v1 = triangles[i] * 2;
|
|
410
|
+
const v2 = triangles[i + 1] * 2;
|
|
411
|
+
const v3 = triangles[i + 2] * 2;
|
|
412
|
+
|
|
413
|
+
debugDisplayObjects.meshTrianglesLine.context
|
|
414
|
+
.moveTo(vertices[v1], vertices[v1 + 1])
|
|
415
|
+
.lineTo(vertices[v2], vertices[v2 + 1])
|
|
416
|
+
.lineTo(vertices[v3], vertices[v3 + 1]);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// draw skin border
|
|
421
|
+
if (this.drawMeshHull && hullLength > 0) {
|
|
422
|
+
hullLength = (hullLength >> 1) * 2;
|
|
423
|
+
let lastX = vertices[hullLength - 2];
|
|
424
|
+
let lastY = vertices[hullLength - 1];
|
|
425
|
+
|
|
426
|
+
for (let i = 0, len = hullLength; i < len; i += 2) {
|
|
427
|
+
const x = vertices[i];
|
|
428
|
+
const y = vertices[i + 1];
|
|
429
|
+
|
|
430
|
+
debugDisplayObjects.meshHullLine.context
|
|
431
|
+
.moveTo(x, y)
|
|
432
|
+
.lineTo(lastX, lastY);
|
|
433
|
+
lastX = x;
|
|
434
|
+
lastY = y;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
debugDisplayObjects.meshHullLine.stroke({ width: lineWidth, color: this.meshHullColor });
|
|
440
|
+
debugDisplayObjects.meshTrianglesLine.stroke({ width: lineWidth, color: this.meshTrianglesColor });
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
drawClippingFunc (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number): void {
|
|
444
|
+
const skeleton = spine.skeleton;
|
|
445
|
+
const slots = skeleton.slots;
|
|
446
|
+
|
|
447
|
+
for (let i = 0, len = slots.length; i < len; i++) {
|
|
448
|
+
const slot = slots[i];
|
|
449
|
+
|
|
450
|
+
if (!slot.bone.active) {
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
const attachment = slot.getAttachment();
|
|
454
|
+
|
|
455
|
+
if (attachment === null || !(attachment instanceof ClippingAttachment)) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
const clippingAttachment = attachment;
|
|
460
|
+
|
|
461
|
+
const nn = clippingAttachment.worldVerticesLength;
|
|
462
|
+
const world = new Float32Array(nn);
|
|
463
|
+
|
|
464
|
+
clippingAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);
|
|
465
|
+
debugDisplayObjects.clippingPolygon.poly(Array.from(world));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
debugDisplayObjects.clippingPolygon.stroke({
|
|
469
|
+
width: lineWidth, color: this.clippingPolygonColor, alpha: 1
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
drawBoundingBoxesFunc (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number): void {
|
|
474
|
+
// draw the total outline of the bounding box
|
|
475
|
+
const bounds = new SkeletonBounds();
|
|
476
|
+
bounds.update(spine.skeleton, true);
|
|
477
|
+
|
|
478
|
+
if (bounds.minX !== Infinity) {
|
|
479
|
+
debugDisplayObjects.boundingBoxesRect
|
|
480
|
+
.rect(bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight())
|
|
481
|
+
.stroke({ width: lineWidth, color: this.boundingBoxesRectColor });
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const polygons = bounds.polygons;
|
|
485
|
+
const drawPolygon = (polygonVertices: ArrayLike<number>, _offset: unknown, count: number): void => {
|
|
486
|
+
if (count < 3) {
|
|
487
|
+
throw new Error('Polygon must contain at least 3 vertices');
|
|
488
|
+
}
|
|
489
|
+
const paths: number[] = [];
|
|
490
|
+
const dotSize = lineWidth * 2;
|
|
491
|
+
|
|
492
|
+
for (let i = 0, len = polygonVertices.length; i < len; i += 2) {
|
|
493
|
+
const x1 = polygonVertices[i];
|
|
494
|
+
const y1 = polygonVertices[i + 1];
|
|
495
|
+
|
|
496
|
+
// draw the bounding box node
|
|
497
|
+
debugDisplayObjects.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor);
|
|
498
|
+
debugDisplayObjects.boundingBoxesCircle.drawCircle(x1, y1, dotSize);
|
|
499
|
+
debugDisplayObjects.boundingBoxesCircle.fill(0);
|
|
500
|
+
|
|
501
|
+
debugDisplayObjects.boundingBoxesCircle
|
|
502
|
+
.circle(x1, y1, dotSize)
|
|
503
|
+
.fill({ color: this.boundingBoxesCircleColor })
|
|
504
|
+
|
|
505
|
+
paths.push(x1, y1);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// draw the bounding box area
|
|
509
|
+
debugDisplayObjects.boundingBoxesPolygon
|
|
510
|
+
.poly(paths)
|
|
511
|
+
.fill({
|
|
512
|
+
color: this.boundingBoxesPolygonColor,
|
|
513
|
+
alpha: 0.1
|
|
514
|
+
})
|
|
515
|
+
.stroke({
|
|
516
|
+
width: lineWidth,
|
|
517
|
+
color: this.boundingBoxesPolygonColor
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
for (let i = 0, len = polygons.length; i < len; i++) {
|
|
522
|
+
const polygon = polygons[i];
|
|
523
|
+
|
|
524
|
+
drawPolygon(polygon, 0, polygon.length);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
private drawPathsFunc (spine: Spine, debugDisplayObjects: DebugDisplayObjects, lineWidth: number): void {
|
|
529
|
+
const skeleton = spine.skeleton;
|
|
530
|
+
const slots = skeleton.slots;
|
|
531
|
+
|
|
532
|
+
for (let i = 0, len = slots.length; i < len; i++) {
|
|
533
|
+
const slot = slots[i];
|
|
534
|
+
|
|
535
|
+
if (!slot.bone.active) {
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
const attachment = slot.getAttachment();
|
|
539
|
+
|
|
540
|
+
if (attachment === null || !(attachment instanceof PathAttachment)) {
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const pathAttachment = attachment;
|
|
545
|
+
let nn = pathAttachment.worldVerticesLength;
|
|
546
|
+
const world = new Float32Array(nn);
|
|
547
|
+
|
|
548
|
+
pathAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);
|
|
549
|
+
let x1 = world[2];
|
|
550
|
+
let y1 = world[3];
|
|
551
|
+
let x2 = 0;
|
|
552
|
+
let y2 = 0;
|
|
553
|
+
|
|
554
|
+
if (pathAttachment.closed) {
|
|
555
|
+
const cx1 = world[0];
|
|
556
|
+
const cy1 = world[1];
|
|
557
|
+
const cx2 = world[nn - 2];
|
|
558
|
+
const cy2 = world[nn - 1];
|
|
559
|
+
|
|
560
|
+
x2 = world[nn - 4];
|
|
561
|
+
y2 = world[nn - 3];
|
|
562
|
+
|
|
563
|
+
// curve
|
|
564
|
+
debugDisplayObjects.pathsCurve.moveTo(x1, y1);
|
|
565
|
+
debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);
|
|
566
|
+
|
|
567
|
+
// handle
|
|
568
|
+
debugDisplayObjects.pathsLine.moveTo(x1, y1);
|
|
569
|
+
debugDisplayObjects.pathsLine.lineTo(cx1, cy1);
|
|
570
|
+
debugDisplayObjects.pathsLine.moveTo(x2, y2);
|
|
571
|
+
debugDisplayObjects.pathsLine.lineTo(cx2, cy2);
|
|
572
|
+
}
|
|
573
|
+
nn -= 4;
|
|
574
|
+
for (let ii = 4; ii < nn; ii += 6) {
|
|
575
|
+
const cx1 = world[ii];
|
|
576
|
+
const cy1 = world[ii + 1];
|
|
577
|
+
const cx2 = world[ii + 2];
|
|
578
|
+
const cy2 = world[ii + 3];
|
|
579
|
+
|
|
580
|
+
x2 = world[ii + 4];
|
|
581
|
+
y2 = world[ii + 5];
|
|
582
|
+
// curve
|
|
583
|
+
debugDisplayObjects.pathsCurve.moveTo(x1, y1);
|
|
584
|
+
debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);
|
|
585
|
+
|
|
586
|
+
// handle
|
|
587
|
+
debugDisplayObjects.pathsLine.moveTo(x1, y1);
|
|
588
|
+
debugDisplayObjects.pathsLine.lineTo(cx1, cy1);
|
|
589
|
+
debugDisplayObjects.pathsLine.moveTo(x2, y2);
|
|
590
|
+
debugDisplayObjects.pathsLine.lineTo(cx2, cy2);
|
|
591
|
+
x1 = x2;
|
|
592
|
+
y1 = y2;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
debugDisplayObjects.pathsCurve.stroke({ width: lineWidth, color: this.pathsCurveColor });
|
|
597
|
+
debugDisplayObjects.pathsLine.stroke({ width: lineWidth, color: this.pathsLineColor });
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
public unregisterSpine (spine: Spine): void {
|
|
601
|
+
if (!this.registeredSpines.has(spine)) {
|
|
602
|
+
console.warn('SpineDebugRenderer.unregisterSpine() - spine is not registered, can\'t unregister!', spine);
|
|
603
|
+
}
|
|
604
|
+
const debugDisplayObjects = this.registeredSpines.get(spine);
|
|
605
|
+
|
|
606
|
+
if (!debugDisplayObjects) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
spine.state.removeListener(debugDisplayObjects.eventCallback);
|
|
611
|
+
|
|
612
|
+
debugDisplayObjects.parentDebugContainer.destroy({ textureSource: true, children: true, texture: true });
|
|
613
|
+
this.registeredSpines.delete(spine);
|
|
614
|
+
}
|
|
615
|
+
}
|