@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,49 @@
|
|
|
1
|
+
import { Container as PIXIContainer } from 'pixi.js';
|
|
2
|
+
import { IScene } from '../../display';
|
|
3
|
+
import { ActionMap, ActionSignal, i18nTParams, IFocusable, IFocusLayer, KeySignal, LoadSceneConfig, InputController } from '../../plugins';
|
|
4
|
+
import { IPopup } from '../../ui';
|
|
5
|
+
import { AppTypeOverrides, PopupId, PopupInstance, PopupProps, SceneId, SceneLoadArgs } from '../../utils';
|
|
6
|
+
type AppContexts = AppTypeOverrides['Contexts'];
|
|
7
|
+
type AppActions = AppTypeOverrides['Actions'];
|
|
8
|
+
type AppScenes = AppTypeOverrides['Scenes'];
|
|
9
|
+
export interface ICoreFunctions {
|
|
10
|
+
addFocusable(focusable: IFocusable | IFocusable[], layerId?: string | number | null | undefined, isDefault?: boolean): void;
|
|
11
|
+
removeFocusable(focusable: IFocusable | IFocusable[]): void;
|
|
12
|
+
setLayerOrder(layerIds: (string | number)[]): void;
|
|
13
|
+
addFocusLayer(layerId?: string | number, setAsCurrent?: boolean, focusables?: IFocusable | IFocusable[]): IFocusLayer;
|
|
14
|
+
removeFocusLayer(layerId?: string | number, removeTopLayerIfUndefined?: boolean): void;
|
|
15
|
+
setFocus(focusable: IFocusable): IFocusable;
|
|
16
|
+
setFocusLayer(layerId: string | number): void;
|
|
17
|
+
clearFocus(): void;
|
|
18
|
+
removeAllFocusLayers(): void;
|
|
19
|
+
setLocale(localeId: string): void;
|
|
20
|
+
t(key: string, params?: i18nTParams, locale?: string): string;
|
|
21
|
+
translate(key: string, params?: i18nTParams, locale?: string): string;
|
|
22
|
+
isControllerActive(controller: InputController): boolean;
|
|
23
|
+
isGamepadActive(gamepad: Gamepad): boolean;
|
|
24
|
+
getAction<T = any>(action: AppActions): ActionSignal<T>;
|
|
25
|
+
getActions(): ActionMap;
|
|
26
|
+
sendAction<T = any>(actionId: AppActions, data?: T): void;
|
|
27
|
+
setActionContext(context: AppContexts): string;
|
|
28
|
+
actions<T = any>(action: AppActions): ActionSignal<T>;
|
|
29
|
+
onKeyDown(key?: string): KeySignal;
|
|
30
|
+
onKeyUp(key?: string): KeySignal;
|
|
31
|
+
isKeyDown(key: string): boolean;
|
|
32
|
+
showPopup<K extends PopupId>(id: K, config?: PopupProps<K>): Promise<PopupInstance<K> | undefined>;
|
|
33
|
+
hidePopup<T = any>(id: string | number, data?: T): Promise<IPopup<T> | undefined>;
|
|
34
|
+
removeAllPopups(animate?: boolean): void;
|
|
35
|
+
loadScene<K extends SceneId>(id: K, ...args: SceneLoadArgs<K>): Promise<void>;
|
|
36
|
+
loadScene(sceneIdOrLoadSceneConfig: LoadSceneConfig | AppScenes): Promise<void>;
|
|
37
|
+
loadAssets(assets: string | string[]): Promise<void>;
|
|
38
|
+
loadBundles(bundle: string | string[]): Promise<void>;
|
|
39
|
+
loadSceneAssets(scene: IScene, background?: boolean): Promise<void>;
|
|
40
|
+
unloadSceneAssets(scene: IScene): Promise<void>;
|
|
41
|
+
loadRequired(): Promise<void>;
|
|
42
|
+
getChildAtPath(path: string): PIXIContainer | undefined;
|
|
43
|
+
getChildrenAtPaths(paths: string[]): PIXIContainer[];
|
|
44
|
+
getPathForChild(container: PIXIContainer): string;
|
|
45
|
+
getPathsForChildren(containers: PIXIContainer[]): string[];
|
|
46
|
+
getAllPaths(): string[];
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=ICoreFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICoreFunctions.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/ICoreFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,KAAK,WAAW,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,UAAU,G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G,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhF,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAG9B,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACxD,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IACrD,eAAe,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAAC;IAClD,mBAAmB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3D,WAAW,IAAI,MAAM,EAAE,CAAC;CACzB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BreakpointChangeDetail, ChannelMutedDetail, ChannelVolumeDetail, FocusChangeDetail, IAudioInstance, KeyboardEventDetail, PopupSignalDetail, SoundDetail, ActionContext } from '../../plugins';
|
|
2
|
+
import { Signal } from '../../signals';
|
|
3
|
+
import { DataChangeSignalDetail } from '../../plugins/DataAdapter';
|
|
4
|
+
import { Orientation, Size } from '../../utils';
|
|
5
|
+
export interface ICoreSignals {
|
|
6
|
+
onResize: Signal<(size: Size) => void>;
|
|
7
|
+
onSoundStarted: Signal<(detail: SoundDetail) => void>;
|
|
8
|
+
onSoundEnded: Signal<(detail: SoundDetail) => void>;
|
|
9
|
+
onMuted: Signal<(muted: boolean) => void>;
|
|
10
|
+
onMasterVolumeChanged: Signal<(volume: number) => void>;
|
|
11
|
+
onChannelVolumeChanged: Signal<(detail: ChannelVolumeDetail) => void>;
|
|
12
|
+
onChannelMuted: Signal<(detail: ChannelMutedDetail) => void>;
|
|
13
|
+
onVoiceOverStart: Signal<(instance: IAudioInstance) => void>;
|
|
14
|
+
onVoiceOverPaused: Signal<(instance: IAudioInstance) => void>;
|
|
15
|
+
onVoiceOverComplete: Signal<(instance: IAudioInstance) => void>;
|
|
16
|
+
onVoiceOverResumed: Signal<(instance: IAudioInstance) => void>;
|
|
17
|
+
onVoiceOverStopped: Signal<(instance?: IAudioInstance) => void>;
|
|
18
|
+
onFocusManagerActivated: Signal<() => void>;
|
|
19
|
+
onFocusManagerDeactivated: Signal<() => void>;
|
|
20
|
+
onFocusLayerChange: Signal<(currentLayerId: string | number) => void>;
|
|
21
|
+
onFocusChange: Signal<(detail: FocusChangeDetail) => void>;
|
|
22
|
+
onLocaleChanged: Signal<(locale: string) => void>;
|
|
23
|
+
onActionContextChanged: Signal<(context: string | ActionContext) => void>;
|
|
24
|
+
onGamepadConnected: Signal<(gamepad: Gamepad) => void>;
|
|
25
|
+
onGamepadDisconnected: Signal<(gamepad: Gamepad) => void>;
|
|
26
|
+
onControllerActivated: Signal<(controller: string) => void>;
|
|
27
|
+
onControllerDeactivated: Signal<(controller: string) => void>;
|
|
28
|
+
onGlobalKeyDown: Signal<(detail: KeyboardEventDetail) => void>;
|
|
29
|
+
onGlobalKeyUp: Signal<(detail: KeyboardEventDetail) => void>;
|
|
30
|
+
onShowPopup: Signal<(detail: PopupSignalDetail) => void>;
|
|
31
|
+
onHidePopup: Signal<(detail: PopupSignalDetail) => void>;
|
|
32
|
+
onPopupChanged: Signal<(detail: PopupSignalDetail) => void>;
|
|
33
|
+
onSceneChangeStart: Signal<(detail: {
|
|
34
|
+
exiting: string | null;
|
|
35
|
+
entering: string;
|
|
36
|
+
}) => void>;
|
|
37
|
+
onSceneChangeComplete: Signal<(detail: {
|
|
38
|
+
current: string;
|
|
39
|
+
}) => void>;
|
|
40
|
+
onOrientationChanged: Signal<({ orientation, screenOrientation }: {
|
|
41
|
+
orientation: Orientation;
|
|
42
|
+
screenOrientation: ScreenOrientation;
|
|
43
|
+
}) => void>;
|
|
44
|
+
onVisibilityChanged: Signal<(visible: boolean) => void>;
|
|
45
|
+
onLoadProgress: Signal<(progress: number) => void>;
|
|
46
|
+
onLoadComplete: Signal<() => void>;
|
|
47
|
+
onError: Signal<(error: Error) => void>;
|
|
48
|
+
onBackgroundLoadStart: Signal<() => void>;
|
|
49
|
+
onBackgroundAssetsLoaded: Signal<(assets: string[]) => void>;
|
|
50
|
+
onBackgroundBundlesLoaded: Signal<(bundles: string[]) => void>;
|
|
51
|
+
onLoadRequiredStart: Signal<() => void>;
|
|
52
|
+
onLoadRequiredProgress: Signal<(progress: number) => void>;
|
|
53
|
+
onLoadRequiredComplete: Signal<() => void>;
|
|
54
|
+
onDataChange: Signal<(detail: DataChangeSignalDetail) => void>;
|
|
55
|
+
onBreakpointChanged: Signal<(detail: BreakpointChangeDetail) => void>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ICoreSignals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICoreSignals.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/ICoreSignals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,YAAY;IA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AM,CAC1B,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE;QAAE,WAAW,EAAE,WAAW,CAAC;QAAC,iBAAiB,EAAE,iBAAiB,CAAA;KAAE,KAAK,IAAI,CACjH,CAAC;IACF,mBAAmB,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC;IAExD,cAAc,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;IAExC,qBAAqB,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1C,wBAAwB,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC;IAC7D,yBAAyB,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC;IAE/D,mBAAmB,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACxC,sBAAsB,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;IAC3D,sBAAsB,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAE3C,YAAY,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC,CAAC;IAE/D,mBAAmB,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker interface for plugins that can act as a key/value store.
|
|
3
|
+
*
|
|
4
|
+
* Any plugin whose instance has `save` and `load` methods is considered
|
|
5
|
+
* storage-capable and will be reachable via `app.store.getAdapter(id)` /
|
|
6
|
+
* `app.store.save(id, ...)` / `app.store.load(id, ...)`.
|
|
7
|
+
*
|
|
8
|
+
* Implementations are free to interpret `key` and the variadic tail however
|
|
9
|
+
* they like — e.g. Firebase treats `key` as a collection name.
|
|
10
|
+
*/
|
|
11
|
+
export interface IStorageCapability<TSaveResult = any, TLoadResult = any> {
|
|
12
|
+
save(key: string, data: any, ...rest: any[]): Promise<TSaveResult> | TSaveResult;
|
|
13
|
+
load(key: string, ...rest: any[]): Promise<TLoadResult | undefined> | TLoadResult | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Duck-typed guard. No base class, no inheritance — any plugin that defines
|
|
17
|
+
* `save` and `load` qualifies.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isStorageCapable(plugin: unknown): plugin is IStorageCapability;
|
|
20
|
+
//# sourceMappingURL=IStorageCapability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IStorageCapability.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/IStorageCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB,CAAC,WAAW,GAAG,GAAG,EAAE,WAAW,GAAG,GAAG;IACtE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;IACjF,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,WAAW,GAAG,SAAS,CAAC;CAC/F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAM9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IStorageCapability.test.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/IStorageCapability.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ICoreFunctions } from './ICoreFunctions';
|
|
2
|
+
export type { ICoreSignals } from './ICoreSignals';
|
|
3
|
+
export type { IApplicationOptions } from './IApplicationOptions';
|
|
4
|
+
export type { IApplication } from './IApplication';
|
|
5
|
+
export { isStorageCapable } from './IStorageCapability';
|
|
6
|
+
export type { IStorageCapability } from './IStorageCapability';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICoreFunctions, ICoreSignals } from './interfaces';
|
|
2
|
+
export declare const coreSignalRegistry: {
|
|
3
|
+
[K in keyof ICoreSignals]: ICoreSignals[K];
|
|
4
|
+
};
|
|
5
|
+
export declare const coreFunctionRegistry: {
|
|
6
|
+
[K in keyof ICoreFunctions]: ICoreFunctions[K];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=registries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/core/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjE,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC;CAAO,CAAC;AAGrF,eAAO,MAAM,oBAAoB,EAAE;KAAG,CAAC,IAAI,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC;CAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WithRequiredProps } from '../utils';
|
|
2
|
+
import { IApplicationOptions } from './interfaces';
|
|
3
|
+
export type AppConfig = WithRequiredProps<IApplicationOptions, 'id'>;
|
|
4
|
+
export type PauseConfig = {
|
|
5
|
+
pauseAudio?: boolean;
|
|
6
|
+
pauseAnimations?: boolean;
|
|
7
|
+
pauseTimers?: boolean;
|
|
8
|
+
pauseTicker?: boolean;
|
|
9
|
+
pauseOther?: any[];
|
|
10
|
+
clearOnResume?: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AnimatedSprite as PIXIAnimatedSprite, Texture, Ticker } from 'pixi.js';
|
|
2
|
+
import { AnimatedSpriteProps } from '../mixins';
|
|
3
|
+
import { Signal } from '../signals';
|
|
4
|
+
import { SpritesheetAsset } from '../utils';
|
|
5
|
+
export declare class AnimatedSprite extends PIXIAnimatedSprite {
|
|
6
|
+
protected config?: Partial<AnimatedSpriteProps> | undefined;
|
|
7
|
+
onAnimationChange: Signal<(currentAnimation: string) => void>;
|
|
8
|
+
onAnimationStart: Signal<() => void>;
|
|
9
|
+
onAnimationStop: Signal<() => void>;
|
|
10
|
+
onAnimationLoop: Signal<() => void>;
|
|
11
|
+
onAnimationComplete: Signal<() => void>;
|
|
12
|
+
onAnimationFrameChange: Signal<() => void>;
|
|
13
|
+
defaultTexturePrefix: string;
|
|
14
|
+
defaultSheet: string | undefined;
|
|
15
|
+
defaultAnimation: string;
|
|
16
|
+
defaultAnimationSpeed: number;
|
|
17
|
+
defaultZeroPad: number | undefined;
|
|
18
|
+
autoPlay: boolean;
|
|
19
|
+
currentAnimation: string;
|
|
20
|
+
protected _animations: Map<string, Texture[]>;
|
|
21
|
+
constructor(config?: Partial<AnimatedSpriteProps> | undefined);
|
|
22
|
+
protected _paused: boolean;
|
|
23
|
+
get paused(): boolean;
|
|
24
|
+
set paused(value: boolean);
|
|
25
|
+
get speed(): number;
|
|
26
|
+
set speed(value: number);
|
|
27
|
+
protected _isReversed: boolean;
|
|
28
|
+
get isReversed(): boolean;
|
|
29
|
+
static generateTexturesFromProps(animationName: string, props?: Partial<AnimatedSpriteProps>, defaultTexturePrefix?: string, defaultSheet?: SpritesheetAsset | undefined, defaultZeroPad?: number, defaultStartIndex?: number): Texture[];
|
|
30
|
+
reverse(): void;
|
|
31
|
+
setAnimation(animationName: string, autoPlay?: boolean): void;
|
|
32
|
+
play(): void;
|
|
33
|
+
stop(): void;
|
|
34
|
+
nextAnimation(): void;
|
|
35
|
+
previousAnimation(): void;
|
|
36
|
+
update(ticker: Ticker): void;
|
|
37
|
+
private _generateAnimations;
|
|
38
|
+
private _added;
|
|
39
|
+
}
|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AC,mBAAmB,CAAC,YAAA;IAkC3D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAS;IAEnC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAExB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAEtB;IAED,SAAS,CAAC,WAAW,EAAE,OAAO,CAAS;IAEvC,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,MAAM,CAAC,yBAAyB,CAC9B,aAAa,EAAE,MAAM,EACrB,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,EACpC,oBAAoB,SAAK,EACzB,YAAY,GAAE,gBAAgB,GAAG,SAAqB,EACtD,cAAc,CAAC,EAAE,MAAM,EACvB,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,EAAE;IA2BZ,OAAO;IASP,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc;IAkB5D,IAAI;IAKJ,IAAI;IAKJ,aAAa;IAOb,iBAAiB;IAOjB,MAAM,CAAC,MAAM,EAAE,MAAM;IAOrB,OAAO,CAAC,mBAAmB;IAgC3B,OAAO,CAAC,MAAM;CAef"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Container, Point } from 'pixi.js';
|
|
2
|
+
import { IApplication } from '../core';
|
|
3
|
+
import { Signal } from '../signals';
|
|
4
|
+
import { ContainerLike, PointLike } from '../utils';
|
|
5
|
+
type CameraConfig = {
|
|
6
|
+
container: Container;
|
|
7
|
+
minX: number;
|
|
8
|
+
maxX: number;
|
|
9
|
+
minY: number;
|
|
10
|
+
maxY: number;
|
|
11
|
+
viewportWidth: number;
|
|
12
|
+
viewportHeight: number;
|
|
13
|
+
worldWidth: number;
|
|
14
|
+
worldHeight: number;
|
|
15
|
+
target: ContainerLike | null;
|
|
16
|
+
targetPivot: Point;
|
|
17
|
+
lerp: number;
|
|
18
|
+
};
|
|
19
|
+
type OptionalCameraConfig = Partial<CameraConfig>;
|
|
20
|
+
type RequiredCameraConfig = Required<Pick<CameraConfig, 'container'>>;
|
|
21
|
+
type CustomCameraConfig = OptionalCameraConfig & RequiredCameraConfig;
|
|
22
|
+
export interface ICamera {
|
|
23
|
+
onZoom: Signal<(camera?: ICamera) => void>;
|
|
24
|
+
onZoomComplete: Signal<(camera?: ICamera) => void>;
|
|
25
|
+
container: Container;
|
|
26
|
+
minX: number;
|
|
27
|
+
minY: number;
|
|
28
|
+
maxX: number;
|
|
29
|
+
maxY: number;
|
|
30
|
+
viewportWidth: number;
|
|
31
|
+
viewportHeight: number;
|
|
32
|
+
worldWidth: number;
|
|
33
|
+
worldHeight: number;
|
|
34
|
+
readonly targetPivot: Point;
|
|
35
|
+
readonly targetScale: Point;
|
|
36
|
+
readonly zooming: boolean;
|
|
37
|
+
readonly zoomLerp: number;
|
|
38
|
+
readonly lerp: number;
|
|
39
|
+
readonly target: ContainerLike | null;
|
|
40
|
+
readonly followOffset: Point;
|
|
41
|
+
app: IApplication;
|
|
42
|
+
follow(target: ContainerLike, offset: PointLike): void;
|
|
43
|
+
pan(deltaX: number, deltaY: number): void;
|
|
44
|
+
zoom(scale: number, lerp?: number): void;
|
|
45
|
+
update(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare class Camera extends Container implements ICamera {
|
|
48
|
+
config: CustomCameraConfig;
|
|
49
|
+
onZoom: Signal<(camera?: ICamera) => void>;
|
|
50
|
+
onZoomComplete: Signal<(camera?: ICamera) => void>;
|
|
51
|
+
container: Container;
|
|
52
|
+
minX: number;
|
|
53
|
+
minY: number;
|
|
54
|
+
maxX: number;
|
|
55
|
+
maxY: number;
|
|
56
|
+
viewportWidth: number;
|
|
57
|
+
viewportHeight: number;
|
|
58
|
+
worldWidth: number;
|
|
59
|
+
worldHeight: number;
|
|
60
|
+
constructor(config: CustomCameraConfig);
|
|
61
|
+
protected _zooming: boolean;
|
|
62
|
+
get zooming(): boolean;
|
|
63
|
+
protected _zoomLerp: number;
|
|
64
|
+
get zoomLerp(): number;
|
|
65
|
+
protected _targetPivot: Point;
|
|
66
|
+
get targetPivot(): Point;
|
|
67
|
+
protected _targetScale: Point;
|
|
68
|
+
get targetScale(): Point;
|
|
69
|
+
private _lerp;
|
|
70
|
+
get lerp(): number;
|
|
71
|
+
set lerp(value: number);
|
|
72
|
+
protected _target: ContainerLike | null;
|
|
73
|
+
get target(): ContainerLike | null;
|
|
74
|
+
set target(value: ContainerLike | null);
|
|
75
|
+
protected _followOffset: Point;
|
|
76
|
+
get followOffset(): Point;
|
|
77
|
+
set followOffset(value: PointLike);
|
|
78
|
+
get app(): IApplication;
|
|
79
|
+
follow(target: ContainerLike, offset?: PointLike): void;
|
|
80
|
+
pan(deltaX: number, deltaY: number): void;
|
|
81
|
+
zoom(scale: number, lerp?: number): void;
|
|
82
|
+
update(): void;
|
|
83
|
+
private focusOn;
|
|
84
|
+
private updateZoom;
|
|
85
|
+
private updatePosition;
|
|
86
|
+
}
|
|
87
|
+
export declare class CameraController {
|
|
88
|
+
camera: Camera;
|
|
89
|
+
interactiveArea: Container;
|
|
90
|
+
private dragging;
|
|
91
|
+
private previousPointerPosition;
|
|
92
|
+
constructor(camera: Camera, interactiveArea: Container);
|
|
93
|
+
get app(): IApplication;
|
|
94
|
+
destroy(): void;
|
|
95
|
+
private handleKeyDown;
|
|
96
|
+
private onPointerDown;
|
|
97
|
+
private onPointerMove;
|
|
98
|
+
private onPointerUp;
|
|
99
|
+
private getEventPosition;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=Camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../src/display/Camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAA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|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { DestroyOptions, Container as PIXIContainer, Sprite, Ticker } from 'pixi.js';
|
|
2
|
+
import { Signal } from '../signals';
|
|
3
|
+
import { SignalOrder } from '../signals/Signal';
|
|
4
|
+
import { AppTypeOverrides, PointLike, Size } from '../utils';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for the Container class.
|
|
7
|
+
*/
|
|
8
|
+
export type ContainerConfig = {
|
|
9
|
+
autoResize: boolean;
|
|
10
|
+
autoUpdate: boolean;
|
|
11
|
+
priority: SignalOrder;
|
|
12
|
+
};
|
|
13
|
+
export declare const ContainerConfigKeys: (keyof ContainerConfig)[];
|
|
14
|
+
export type BackgroundConfig = {
|
|
15
|
+
color: number;
|
|
16
|
+
alpha: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
anchor: PointLike;
|
|
20
|
+
autoResize: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Interface for the Container class.
|
|
24
|
+
*/
|
|
25
|
+
export interface IContainer {
|
|
26
|
+
app: AppTypeOverrides['App'];
|
|
27
|
+
animationContext: string | undefined;
|
|
28
|
+
onDestroy: Signal<() => void>;
|
|
29
|
+
destroy(options?: DestroyOptions): void;
|
|
30
|
+
added(): Promise<void> | void;
|
|
31
|
+
removed(): Promise<void> | void;
|
|
32
|
+
childAdded(child: PIXIContainer): Promise<void> | void;
|
|
33
|
+
childRemoved(child: PIXIContainer): Promise<void> | void;
|
|
34
|
+
resize(size?: Size): void;
|
|
35
|
+
update(ticker?: Ticker | number): void;
|
|
36
|
+
addColoredBackground(colorOrConfig?: number | Partial<BackgroundConfig>, alpha?: number): Sprite;
|
|
37
|
+
}
|
|
38
|
+
declare const Container_base: (new () => import('..').IFactory<{
|
|
39
|
+
existing: <TEntity>(entity: TEntity, props?: Partial<import('..').ExistingProps>) => TEntity;
|
|
40
|
+
container: (props?: Partial<import('..').ContainerProps> | undefined) => Container;
|
|
41
|
+
particleContainer: (props?: Partial<import('..').ParticleContainerProps> | undefined) => import('./ParticleContainer').ParticleContainer;
|
|
42
|
+
texture: typeof import('..').resolveTexture;
|
|
43
|
+
sprite: (props?: Partial<import('..').SpriteProps> | undefined) => Sprite;
|
|
44
|
+
tilingSprite: (props?: Partial<import('..').TilingSpriteProps> | undefined) => import('pixi.js').TilingSprite;
|
|
45
|
+
animatedSprite: (props?: Partial<import('..').AnimatedSpriteProps> | undefined) => import('./AnimatedSprite').AnimatedSprite;
|
|
46
|
+
graphics: (props?: Partial<import('..').GraphicsProps> | undefined) => import('pixi.js').Graphics;
|
|
47
|
+
svg(props: import('..').WithRequiredProps<import('..').SvgProps, "ctx">): import('./Svg').Svg;
|
|
48
|
+
text: (props?: Partial<import('..').TextProps> | undefined) => import('pixi.js').Text;
|
|
49
|
+
htmlText: (props?: Partial<import('..').HTMLTextProps> | undefined) => import('pixi.js').HTMLText;
|
|
50
|
+
bitmapText: (props?: Partial<import('..').BitmapTextProps> | undefined) => import('pixi.js').BitmapText;
|
|
51
|
+
button: (props?: Partial<import('..').ButtonProps> | undefined) => import('..').Button;
|
|
52
|
+
flexContainer: (props?: Partial<import('..').FlexContainerProps> | undefined) => import('..').FlexContainer;
|
|
53
|
+
uiCanvas: (props?: Partial<import('..').UICanvasFactoryProps> | undefined) => import('..').UICanvas;
|
|
54
|
+
spine: (props?: Partial<import('..').SpineProps> | undefined) => import('..').Spine;
|
|
55
|
+
spineAnimation: <ANames extends string = string>(props?: Partial<import('..').SpineProps>) => import('./SpineAnimation').SpineAnimation<ANames>;
|
|
56
|
+
toaster: (toasterConfig?: Partial<import('..').ToasterConfig>, defaultToastConfig?: Partial<import('..').ToastConfig>) => import('..').Toaster;
|
|
57
|
+
entity: <K extends import('..').EntityId>(id: K, props?: import('..').EntityProps<K> & import('..').EntityFactoryProps) => import('..').EntityInstance<K>;
|
|
58
|
+
ui: <K extends import('..').UIId>(id: K, props?: import('..').UIProps<K> & import('..').EntityFactoryProps) => import('..').UIInstance<K>;
|
|
59
|
+
}>) & import('..').Constructor<import('..').ISignalContainer> & import('..').Constructor<import('..').IAnimated>;
|
|
60
|
+
/**
|
|
61
|
+
* The Container class extends the _Container class (which includes the Animated and Factory mixins) and implements the IContainer interface.
|
|
62
|
+
* It represents a container for PIXI.js display objects.
|
|
63
|
+
*/
|
|
64
|
+
export declare class Container extends Container_base implements IContainer {
|
|
65
|
+
private readonly __caper_method_binding_root;
|
|
66
|
+
onDestroy: Signal<() => void>;
|
|
67
|
+
protected __background: Sprite;
|
|
68
|
+
protected _animationContext: string | undefined;
|
|
69
|
+
get animationContext(): string | undefined;
|
|
70
|
+
set animationContext(value: string);
|
|
71
|
+
private __config;
|
|
72
|
+
static onGlobalChildAdded: Signal<(child: PIXIContainer) => void>;
|
|
73
|
+
static onGlobalChildRemoved: Signal<(child: PIXIContainer) => void>;
|
|
74
|
+
static childAdded(child: PIXIContainer): void;
|
|
75
|
+
static childRemoved(child: PIXIContainer): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the application instance.
|
|
78
|
+
*/
|
|
79
|
+
get app(): AppTypeOverrides['App'];
|
|
80
|
+
/**
|
|
81
|
+
* The constructor for the Container class.
|
|
82
|
+
* @param config - The configuration for the container.
|
|
83
|
+
*/
|
|
84
|
+
constructor(config?: Partial<ContainerConfig>);
|
|
85
|
+
addColoredBackground(colorOrConfig?: number | Partial<BackgroundConfig>, alpha?: number): Sprite;
|
|
86
|
+
/**
|
|
87
|
+
* Update the container. This method is meant to be overridden by subclasses.
|
|
88
|
+
* @param ticker
|
|
89
|
+
*/
|
|
90
|
+
update(ticker?: Ticker | number): void;
|
|
91
|
+
/**
|
|
92
|
+
* Resize the container. This method is meant to be overridden by subclasses.
|
|
93
|
+
* @param size
|
|
94
|
+
*/
|
|
95
|
+
resize(size?: Size): void;
|
|
96
|
+
/**
|
|
97
|
+
* This method is called when the container is added to the stage. It is meant to be overridden by subclasses.
|
|
98
|
+
*/
|
|
99
|
+
added(): void;
|
|
100
|
+
childAdded(child: PIXIContainer): void;
|
|
101
|
+
destroy(options?: DestroyOptions): void;
|
|
102
|
+
removed(): void;
|
|
103
|
+
childRemoved(child: PIXIContainer): void;
|
|
104
|
+
protected __resizeBackground(): void;
|
|
105
|
+
/**
|
|
106
|
+
* This method is called when the container is added to the stage. It sets up auto-resizing and auto-updating if enabled.
|
|
107
|
+
*/
|
|
108
|
+
private _added;
|
|
109
|
+
private _removed;
|
|
110
|
+
private _childAdded;
|
|
111
|
+
private _childRemoved;
|
|
112
|
+
protected addAnimation(anim: gsap.core.Tween | gsap.core.Timeline | (gsap.core.Tween | gsap.core.Timeline)[], contextId?: string): gsap.core.Tween | gsap.core.Timeline | (gsap.core.Tween | gsap.core.Timeline)[];
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=Container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/display/Container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM,SAAS,CAAC;AAI9F,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGlE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,CAAC,MAAM,eAAe,CAAC,EAA6C,CAAC;AAIvG,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAA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,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;CAGnF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Container } from './Container';
|
|
2
|
+
/**
|
|
3
|
+
* Optional convenience base class for entities discovered from
|
|
4
|
+
* `src/entities/`. The factory system (`this.add.entity(id, props)`) does
|
|
5
|
+
* **not** require entities to extend this class — any class with a
|
|
6
|
+
* single-options-object constructor works. `Entity<Props>` just gives you
|
|
7
|
+
* typed prop storage and a conventional lifecycle for free.
|
|
8
|
+
*
|
|
9
|
+
* **Lifecycle** (inherited from Container):
|
|
10
|
+
*
|
|
11
|
+
* 1. `constructor(props)` — props are stashed on `this.props` before
|
|
12
|
+
* Container's constructor runs. Don't reference `this.app` yet.
|
|
13
|
+
* 2. **addChild** — the factory auto-adds the instance to the calling
|
|
14
|
+
* Container; Pixi emits an `added` event.
|
|
15
|
+
* 3. `added()` — override this to build the display tree using
|
|
16
|
+
* `this.props`. Safe to use `this.app`, `this.add.*`, and any asset.
|
|
17
|
+
* Runs after construction, after stage attachment.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { defineEntity, Entity } from '@caperjs/core';
|
|
22
|
+
*
|
|
23
|
+
* type ActorProps = { color?: number; x?: number; y?: number };
|
|
24
|
+
*
|
|
25
|
+
* export const entity = defineEntity({ id: 'actor' });
|
|
26
|
+
*
|
|
27
|
+
* export default class Actor extends Entity<ActorProps> {
|
|
28
|
+
* added() {
|
|
29
|
+
* this.x = this.props.x ?? 0;
|
|
30
|
+
* this.y = this.props.y ?? 0;
|
|
31
|
+
* this.add.graphics().circle(0, 0, 50).fill(this.props.color ?? 0xffffff);
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Then from a scene:
|
|
37
|
+
* ```ts
|
|
38
|
+
* this.add.entity('actor', { color: 0xff0000, x: 50, y: 100 });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class Entity<Props = void> extends Container {
|
|
42
|
+
/** Props passed into the factory call. Populated before `added()` fires. */
|
|
43
|
+
readonly props: Props;
|
|
44
|
+
constructor(props?: Props);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../src/display/Entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,MAAM,CAAC,KAAK,GAAG,IAAI,CAAE,SAAQ,SAAS;IACjD,4EAA4E;IAC5E,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAEjB,KAAK,CAAC,EAAE,KAAK;CAI1B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DestroyOptions, ParticleContainerOptions, ParticleContainer as PIXIParticleContainer, Ticker } from 'pixi.js';
|
|
2
|
+
import { Signal } from '../signals';
|
|
3
|
+
import { AppTypeOverrides, Size } from '../utils';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the Container class.
|
|
6
|
+
*/
|
|
7
|
+
export interface ParticleContainerConfig extends ParticleContainerOptions {
|
|
8
|
+
autoUpdate: boolean;
|
|
9
|
+
priority: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const ParticleContainerConfigKeys: (keyof ParticleContainerConfig)[];
|
|
12
|
+
export interface IParticleContainer {
|
|
13
|
+
app: AppTypeOverrides['App'];
|
|
14
|
+
onDestroy: Signal<() => void>;
|
|
15
|
+
destroy(options?: DestroyOptions): void;
|
|
16
|
+
added(): Promise<void> | void;
|
|
17
|
+
update(ticker?: Ticker | number): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The Container class extends the _Container class (which includes the Animated and Factory mixins) and implements the IContainer interface.
|
|
21
|
+
* It represents a container for PIXI.js display objects.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ParticleContainer extends PIXIParticleContainer implements IParticleContainer {
|
|
24
|
+
onDestroy: Signal<() => void>;
|
|
25
|
+
__caper_method_binding_root: boolean;
|
|
26
|
+
private __config;
|
|
27
|
+
/**
|
|
28
|
+
* The constructor for the Container class.
|
|
29
|
+
* @param config - The configuration for the container.
|
|
30
|
+
*/
|
|
31
|
+
constructor(config?: Partial<ParticleContainerConfig>);
|
|
32
|
+
/**
|
|
33
|
+
* Get the application instance.
|
|
34
|
+
*/
|
|
35
|
+
get app(): AppTypeOverrides['App'];
|
|
36
|
+
/**
|
|
37
|
+
* Update the container. This method is meant to be overridden by subclasses.
|
|
38
|
+
* @param ticker
|
|
39
|
+
*/
|
|
40
|
+
update(ticker?: Ticker | number): void;
|
|
41
|
+
/**
|
|
42
|
+
* Resize the container. This method is meant to be overridden by subclasses.
|
|
43
|
+
* @param size
|
|
44
|
+
*/
|
|
45
|
+
resize(size?: Size): void;
|
|
46
|
+
/**
|
|
47
|
+
* This method is called when the container is added to the stage. It is meant to be overridden by subclasses.
|
|
48
|
+
*/
|
|
49
|
+
added(): void;
|
|
50
|
+
destroy(options?: DestroyOptions): void;
|
|
51
|
+
removed(): void;
|
|
52
|
+
/**
|
|
53
|
+
* This method is called when the container is added to the stage. It sets up auto-resizing and auto-updating if enabled.
|
|
54
|
+
*/
|
|
55
|
+
private _added;
|
|
56
|
+
private _removed;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=ParticleContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticleContainer.d.ts","sourceRoot":"","sources":["../../src/display/ParticleContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,EAAE,MA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