@egret/engine 0.0.0-stage → 7.0.1-rc.3
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 +201 -0
- package/NOTICE +21 -0
- package/README.md +101 -2
- package/README.zh-CN.md +102 -0
- package/dist/Engine.d.ts +77 -0
- package/dist/Engine.js +464 -0
- package/dist/animation/index.d.ts +6 -0
- package/dist/animation/index.js +5 -0
- package/dist/animation/sequenceController.d.ts +22 -0
- package/dist/animation/sequenceController.js +618 -0
- package/dist/animation/sequenceCoordinator.d.ts +26 -0
- package/dist/animation/sequenceCoordinator.js +161 -0
- package/dist/animation/sequenceInput.d.ts +25 -0
- package/dist/animation/sequenceInput.js +108 -0
- package/dist/animation/sequenceMath.d.ts +35 -0
- package/dist/animation/sequenceMath.js +164 -0
- package/dist/animation/sequenceResetSlot.d.ts +7 -0
- package/dist/animation/sequenceResetSlot.js +367 -0
- package/dist/animation/sequenceResetTypes.d.ts +42 -0
- package/dist/animation/sequenceResetTypes.js +2 -0
- package/dist/animation/types.d.ts +69 -0
- package/dist/animation/types.js +2 -0
- package/dist/assetBundle.d.ts +52 -0
- package/dist/assetBundle.js +173 -0
- package/dist/assetGroup.d.ts +17 -0
- package/dist/assetGroup.js +332 -0
- package/dist/assetGroupTypes.d.ts +15 -0
- package/dist/assetGroupTypes.js +2 -0
- package/dist/audio.d.ts +4 -0
- package/dist/audio.js +4 -0
- package/dist/audioCues.d.ts +43 -0
- package/dist/audioCues.js +127 -0
- package/dist/audioMixer.d.ts +7 -0
- package/dist/audioMixer.js +785 -0
- package/dist/audioTypes.d.ts +233 -0
- package/dist/audioTypes.js +3 -0
- package/dist/bitmapBindingTicket.d.ts +24 -0
- package/dist/bitmapBindingTicket.js +215 -0
- package/dist/bitmapButton.d.ts +4 -0
- package/dist/bitmapButton.js +407 -0
- package/dist/bitmapButtonTypes.d.ts +29 -0
- package/dist/bitmapButtonTypes.js +2 -0
- package/dist/bitmapFontParse.d.ts +10 -0
- package/dist/bitmapFontParse.js +246 -0
- package/dist/bitmapFontTypes.d.ts +109 -0
- package/dist/bitmapFontTypes.js +2 -0
- package/dist/bitmapResourceSlot.d.ts +25 -0
- package/dist/bitmapResourceSlot.js +340 -0
- package/dist/bitmapText.d.ts +6 -0
- package/dist/bitmapText.js +320 -0
- package/dist/bitmapfont.d.ts +5 -0
- package/dist/bitmapfont.js +5 -0
- package/dist/camera.d.ts +4 -0
- package/dist/camera.js +4 -0
- package/dist/camera2d.d.ts +7 -0
- package/dist/camera2d.js +411 -0
- package/dist/cameraTypes.d.ts +114 -0
- package/dist/cameraTypes.js +2 -0
- package/dist/closeHost.d.ts +4 -0
- package/dist/closeHost.js +66 -0
- package/dist/contentArtifacts.d.ts +12 -0
- package/dist/contentArtifacts.js +153 -0
- package/dist/contentAtlasPages.d.ts +13 -0
- package/dist/contentAtlasPages.js +117 -0
- package/dist/contentLoader.d.ts +6 -0
- package/dist/contentLoader.js +327 -0
- package/dist/contentTypes.d.ts +33 -0
- package/dist/contentTypes.js +2 -0
- package/dist/createEngine.d.ts +7 -0
- package/dist/createEngine.js +25 -0
- package/dist/createEngineForProfile.d.ts +5 -0
- package/dist/createEngineForProfile.js +42 -0
- package/dist/displaySubtreeTicket.d.ts +25 -0
- package/dist/displaySubtreeTicket.js +76 -0
- package/dist/fontContentLoader.d.ts +6 -0
- package/dist/fontContentLoader.js +298 -0
- package/dist/fontContentTypes.d.ts +34 -0
- package/dist/fontContentTypes.js +2 -0
- package/dist/gameClock.d.ts +24 -0
- package/dist/gameClock.js +246 -0
- package/dist/gameClockTypes.d.ts +31 -0
- package/dist/gameClockTypes.js +2 -0
- package/dist/gameRun.d.ts +50 -0
- package/dist/gameRun.js +97 -0
- package/dist/gamepad.d.ts +5 -0
- package/dist/gamepad.js +5 -0
- package/dist/gamepadInput.d.ts +4 -0
- package/dist/gamepadInput.js +281 -0
- package/dist/gamepadKeys.d.ts +4 -0
- package/dist/gamepadKeys.js +205 -0
- package/dist/gamepadTypes.d.ts +134 -0
- package/dist/gamepadTypes.js +3 -0
- package/dist/hover.d.ts +4 -0
- package/dist/hover.js +4 -0
- package/dist/hoverInput.d.ts +8 -0
- package/dist/hoverInput.js +503 -0
- package/dist/hoverInputTypes.d.ts +119 -0
- package/dist/hoverInputTypes.js +2 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +20 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +5 -0
- package/dist/inputActions.d.ts +81 -0
- package/dist/inputActions.js +330 -0
- package/dist/internal/contentFactoryState.d.ts +19 -0
- package/dist/internal/contentFactoryState.js +42 -0
- package/dist/internal/mouseInputFactoryState.d.ts +57 -0
- package/dist/internal/mouseInputFactoryState.js +125 -0
- package/dist/internal/sequenceControllerFactoryState.d.ts +42 -0
- package/dist/internal/sequenceControllerFactoryState.js +98 -0
- package/dist/internal/textFieldFactoryState.d.ts +11 -0
- package/dist/internal/textFieldFactoryState.js +32 -0
- package/dist/internal/texturedFrameState.d.ts +4 -0
- package/dist/internal/texturedFrameState.js +12 -0
- package/dist/internal/uiFactoryState.d.ts +64 -0
- package/dist/internal/uiFactoryState.js +157 -0
- package/dist/internal/uiRootState.d.ts +67 -0
- package/dist/internal/uiRootState.js +103 -0
- package/dist/keyboardInput.d.ts +12 -0
- package/dist/keyboardInput.js +578 -0
- package/dist/keyboardInputTypes.d.ts +81 -0
- package/dist/keyboardInputTypes.js +2 -0
- package/dist/kit.d.ts +14 -0
- package/dist/kit.js +9 -0
- package/dist/layout.d.ts +5 -0
- package/dist/layout.js +132 -0
- package/dist/layoutTypes.d.ts +28 -0
- package/dist/layoutTypes.js +2 -0
- package/dist/manifestAssetGroup.d.ts +10 -0
- package/dist/manifestAssetGroup.js +477 -0
- package/dist/manifestResourceState.d.ts +16 -0
- package/dist/manifestResourceState.js +57 -0
- package/dist/manifestResourceTypes.d.ts +25 -0
- package/dist/manifestResourceTypes.js +2 -0
- package/dist/motion.d.ts +33 -0
- package/dist/motion.js +206 -0
- package/dist/mouseInput.d.ts +102 -0
- package/dist/mouseInput.js +562 -0
- package/dist/mouseInputTypes.d.ts +37 -0
- package/dist/mouseInputTypes.js +2 -0
- package/dist/paragraph.d.ts +8 -0
- package/dist/paragraph.js +7 -0
- package/dist/particleEmitter.d.ts +4 -0
- package/dist/particleEmitter.js +292 -0
- package/dist/particleTypes.d.ts +107 -0
- package/dist/particleTypes.js +2 -0
- package/dist/particles.d.ts +4 -0
- package/dist/particles.js +4 -0
- package/dist/physics2d.d.ts +4 -0
- package/dist/physics2d.js +4 -0
- package/dist/physics2dGeometry.d.ts +39 -0
- package/dist/physics2dGeometry.js +230 -0
- package/dist/physics2dTypes.d.ts +167 -0
- package/dist/physics2dTypes.js +2 -0
- package/dist/physics2dWorld.d.ts +4 -0
- package/dist/physics2dWorld.js +623 -0
- package/dist/pointerInput.d.ts +11 -0
- package/dist/pointerInput.js +299 -0
- package/dist/pointerInputTypes.d.ts +38 -0
- package/dist/pointerInputTypes.js +2 -0
- package/dist/random.d.ts +29 -0
- package/dist/random.js +131 -0
- package/dist/rendering/ownedPreparationFailure2D.d.ts +5 -0
- package/dist/rendering/ownedPreparationFailure2D.js +33 -0
- package/dist/rendering/packSharedDraws2D.d.ts +50 -0
- package/dist/rendering/packSharedDraws2D.js +331 -0
- package/dist/rendering/packedOrientation.d.ts +4 -0
- package/dist/rendering/packedOrientation.js +7 -0
- package/dist/rendering/prepareRectangles2D.d.ts +92 -0
- package/dist/rendering/prepareRectangles2D.js +481 -0
- package/dist/rendering/prepareSharedDraws2D.d.ts +88 -0
- package/dist/rendering/prepareSharedDraws2D.js +652 -0
- package/dist/rendering/preparedBatches2D.d.ts +17 -0
- package/dist/rendering/preparedBatches2D.js +30 -0
- package/dist/rendering/preparedSharedBatches2D.d.ts +44 -0
- package/dist/rendering/preparedSharedBatches2D.js +247 -0
- package/dist/rendering/sharedColor2D.d.ts +18 -0
- package/dist/rendering/sharedColor2D.js +68 -0
- package/dist/rendering/sharedEffects2D.d.ts +23 -0
- package/dist/rendering/sharedEffects2D.js +118 -0
- package/dist/rendering/sharedPreparationRetention2D.d.ts +120 -0
- package/dist/rendering/sharedPreparationRetention2D.js +357 -0
- package/dist/rendering/srgbBytes.d.ts +3 -0
- package/dist/rendering/srgbBytes.js +64 -0
- package/dist/rendering/texturedPreparationBudget2D.d.ts +31 -0
- package/dist/rendering/texturedPreparationBudget2D.js +81 -0
- package/dist/rendering/world3d/Animation3D.d.ts +95 -0
- package/dist/rendering/world3d/Animation3D.js +380 -0
- package/dist/rendering/world3d/AnimationTexture3D.d.ts +157 -0
- package/dist/rendering/world3d/AnimationTexture3D.js +601 -0
- package/dist/rendering/world3d/Batch3D.d.ts +71 -0
- package/dist/rendering/world3d/Batch3D.js +329 -0
- package/dist/rendering/world3d/Camera3D.d.ts +57 -0
- package/dist/rendering/world3d/Camera3D.js +129 -0
- package/dist/rendering/world3d/Character3D.d.ts +123 -0
- package/dist/rendering/world3d/Character3D.js +303 -0
- package/dist/rendering/world3d/Cloth3D.d.ts +115 -0
- package/dist/rendering/world3d/Cloth3D.js +498 -0
- package/dist/rendering/world3d/Compression3D.d.ts +21 -0
- package/dist/rendering/world3d/Compression3D.js +702 -0
- package/dist/rendering/world3d/Curves3D.d.ts +111 -0
- package/dist/rendering/world3d/Curves3D.js +455 -0
- package/dist/rendering/world3d/Decal3D.d.ts +41 -0
- package/dist/rendering/world3d/Decal3D.js +241 -0
- package/dist/rendering/world3d/Geometry3D.d.ts +85 -0
- package/dist/rendering/world3d/Geometry3D.js +326 -0
- package/dist/rendering/world3d/GeometryBuilder3D.d.ts +51 -0
- package/dist/rendering/world3d/GeometryBuilder3D.js +196 -0
- package/dist/rendering/world3d/Gizmo3D.d.ts +75 -0
- package/dist/rendering/world3d/Gizmo3D.js +512 -0
- package/dist/rendering/world3d/Gltf3D.d.ts +67 -0
- package/dist/rendering/world3d/Gltf3D.js +976 -0
- package/dist/rendering/world3d/GpuParticles3D.d.ts +107 -0
- package/dist/rendering/world3d/GpuParticles3D.js +400 -0
- package/dist/rendering/world3d/Hdr3D.d.ts +33 -0
- package/dist/rendering/world3d/Hdr3D.js +190 -0
- package/dist/rendering/world3d/Jelly3D.d.ts +75 -0
- package/dist/rendering/world3d/Jelly3D.js +266 -0
- package/dist/rendering/world3d/Ktx23D.d.ts +27 -0
- package/dist/rendering/world3d/Ktx23D.js +112 -0
- package/dist/rendering/world3d/Light3D.d.ts +75 -0
- package/dist/rendering/world3d/Light3D.js +93 -0
- package/dist/rendering/world3d/Material3D.d.ts +243 -0
- package/dist/rendering/world3d/Material3D.js +267 -0
- package/dist/rendering/world3d/Mesh3D.d.ts +108 -0
- package/dist/rendering/world3d/Mesh3D.js +323 -0
- package/dist/rendering/world3d/Meshopt3D.d.ts +12 -0
- package/dist/rendering/world3d/Meshopt3D.js +275 -0
- package/dist/rendering/world3d/Navigation3D.d.ts +173 -0
- package/dist/rendering/world3d/Navigation3D.js +971 -0
- package/dist/rendering/world3d/Object3D.d.ts +107 -0
- package/dist/rendering/world3d/Object3D.js +305 -0
- package/dist/rendering/world3d/Particles3D.d.ts +85 -0
- package/dist/rendering/world3d/Particles3D.js +274 -0
- package/dist/rendering/world3d/Physics3D.d.ts +416 -0
- package/dist/rendering/world3d/Physics3D.js +2835 -0
- package/dist/rendering/world3d/PhysicsHull3D.d.ts +35 -0
- package/dist/rendering/world3d/PhysicsHull3D.js +227 -0
- package/dist/rendering/world3d/PhysicsMesh3D.d.ts +39 -0
- package/dist/rendering/world3d/PhysicsMesh3D.js +338 -0
- package/dist/rendering/world3d/PhysicsQueries3D.d.ts +24 -0
- package/dist/rendering/world3d/PhysicsQueries3D.js +323 -0
- package/dist/rendering/world3d/PhysicsRemote3D.d.ts +174 -0
- package/dist/rendering/world3d/PhysicsRemote3D.js +534 -0
- package/dist/rendering/world3d/Ragdoll3D.d.ts +69 -0
- package/dist/rendering/world3d/Ragdoll3D.js +200 -0
- package/dist/rendering/world3d/Raycast3D.d.ts +37 -0
- package/dist/rendering/world3d/Raycast3D.js +246 -0
- package/dist/rendering/world3d/RenderList3D.d.ts +88 -0
- package/dist/rendering/world3d/RenderList3D.js +490 -0
- package/dist/rendering/world3d/Retarget3D.d.ts +20 -0
- package/dist/rendering/world3d/Retarget3D.js +185 -0
- package/dist/rendering/world3d/Serialize3D.d.ts +49 -0
- package/dist/rendering/world3d/Serialize3D.js +607 -0
- package/dist/rendering/world3d/StateMachine3D.d.ts +78 -0
- package/dist/rendering/world3d/StateMachine3D.js +277 -0
- package/dist/rendering/world3d/Terrain3D.d.ts +227 -0
- package/dist/rendering/world3d/Terrain3D.js +803 -0
- package/dist/rendering/world3d/Text3D.d.ts +90 -0
- package/dist/rendering/world3d/Text3D.js +558 -0
- package/dist/rendering/world3d/Texture3D.d.ts +133 -0
- package/dist/rendering/world3d/Texture3D.js +252 -0
- package/dist/rendering/world3d/Trail3D.d.ts +59 -0
- package/dist/rendering/world3d/Trail3D.js +193 -0
- package/dist/rendering/world3d/Vehicle3D.d.ts +97 -0
- package/dist/rendering/world3d/Vehicle3D.js +226 -0
- package/dist/rendering/world3d/VolumetricFog3D.d.ts +55 -0
- package/dist/rendering/world3d/VolumetricFog3D.js +229 -0
- package/dist/rendering/world3d/Water3D.d.ts +163 -0
- package/dist/rendering/world3d/Water3D.js +606 -0
- package/dist/rendering/world3d/core3D.d.ts +34 -0
- package/dist/rendering/world3d/core3D.js +99 -0
- package/dist/rendering/world3d/debug3D.d.ts +64 -0
- package/dist/rendering/world3d/debug3D.js +257 -0
- package/dist/rendering/world3d/decoders3D.d.ts +42 -0
- package/dist/rendering/world3d/decoders3D.js +133 -0
- package/dist/rendering/world3d/geometries3D.d.ts +99 -0
- package/dist/rendering/world3d/geometries3D.js +605 -0
- package/dist/rendering/world3d/helpers3D.d.ts +65 -0
- package/dist/rendering/world3d/helpers3D.js +177 -0
- package/dist/rendering/world3d/index.d.ts +91 -0
- package/dist/rendering/world3d/index.js +56 -0
- package/dist/rendering/world3d/math3D.d.ts +78 -0
- package/dist/rendering/world3d/math3D.js +640 -0
- package/dist/rendering/world3d/primitives3D.d.ts +60 -0
- package/dist/rendering/world3d/primitives3D.js +196 -0
- package/dist/resources.d.ts +8 -0
- package/dist/resources.js +6 -0
- package/dist/saveStore.d.ts +56 -0
- package/dist/saveStore.js +163 -0
- package/dist/semanticList.d.ts +122 -0
- package/dist/semanticList.js +174 -0
- package/dist/semanticTree.d.ts +10 -0
- package/dist/semanticTree.js +532 -0
- package/dist/semanticTypes.d.ts +167 -0
- package/dist/semanticTypes.js +2 -0
- package/dist/semantics.d.ts +6 -0
- package/dist/semantics.js +5 -0
- package/dist/sequencePlayback.d.ts +19 -0
- package/dist/sequencePlayback.js +391 -0
- package/dist/sequencePlaybackTypes.d.ts +21 -0
- package/dist/sequencePlaybackTypes.js +2 -0
- package/dist/sequenceTargetClaims.d.ts +10 -0
- package/dist/sequenceTargetClaims.js +31 -0
- package/dist/srgbBytes.d.ts +3 -0
- package/dist/srgbBytes.js +64 -0
- package/dist/startEngine.d.ts +5 -0
- package/dist/startEngine.js +31 -0
- package/dist/surfaceOwnership.d.ts +3 -0
- package/dist/surfaceOwnership.js +15 -0
- package/dist/text.d.ts +23 -0
- package/dist/text.js +4 -0
- package/dist/textField.d.ts +6 -0
- package/dist/textField.js +6 -0
- package/dist/tileMapDraw.d.ts +7 -0
- package/dist/tileMapDraw.js +310 -0
- package/dist/tiledImport.d.ts +9 -0
- package/dist/tiledImport.js +357 -0
- package/dist/tilemap.d.ts +5 -0
- package/dist/tilemap.js +5 -0
- package/dist/tilemapTypes.d.ts +169 -0
- package/dist/tilemapTypes.js +2 -0
- package/dist/tween.d.ts +15 -0
- package/dist/tween.js +329 -0
- package/dist/tweenTypes.d.ts +27 -0
- package/dist/tweenTypes.js +2 -0
- package/dist/ui/controlKeys.d.ts +109 -0
- package/dist/ui/controlKeys.js +249 -0
- package/dist/ui/controls.d.ts +52 -0
- package/dist/ui/controls.js +288 -0
- package/dist/ui/editing.d.ts +3 -0
- package/dist/ui/editing.js +3 -0
- package/dist/ui/index.d.ts +19 -0
- package/dist/ui/index.js +11 -0
- package/dist/ui/keyboardFocus.d.ts +32 -0
- package/dist/ui/keyboardFocus.js +146 -0
- package/dist/ui/layerTypes.d.ts +91 -0
- package/dist/ui/layerTypes.js +2 -0
- package/dist/ui/layers.d.ts +4 -0
- package/dist/ui/layers.js +586 -0
- package/dist/ui/leafContent.d.ts +21 -0
- package/dist/ui/leafContent.js +136 -0
- package/dist/ui/rangeControl.d.ts +50 -0
- package/dist/ui/rangeControl.js +167 -0
- package/dist/ui/scrollControl.d.ts +72 -0
- package/dist/ui/scrollControl.js +218 -0
- package/dist/ui/stateControls.d.ts +82 -0
- package/dist/ui/stateControls.js +328 -0
- package/dist/ui/textEditor.d.ts +53 -0
- package/dist/ui/textEditor.js +370 -0
- package/dist/ui/textEditorTypes.d.ts +78 -0
- package/dist/ui/textEditorTypes.js +2 -0
- package/dist/ui/textFieldControl.d.ts +96 -0
- package/dist/ui/textFieldControl.js +259 -0
- package/dist/ui/theme.d.ts +59 -0
- package/dist/ui/theme.js +165 -0
- package/dist/ui/types.d.ts +265 -0
- package/dist/ui/types.js +2 -0
- package/dist/ui/uiRoot.d.ts +4 -0
- package/dist/ui/uiRoot.js +1497 -0
- package/dist/ui/uiRootDisplay.d.ts +46 -0
- package/dist/ui/uiRootDisplay.js +148 -0
- package/dist/ui/uiRootModel.d.ts +112 -0
- package/dist/ui/uiRootModel.js +60 -0
- package/dist/ui/virtualList.d.ts +20 -0
- package/dist/ui/virtualList.js +105 -0
- package/dist/video.d.ts +4 -0
- package/dist/video.js +4 -0
- package/dist/videoPlayer.d.ts +4 -0
- package/dist/videoPlayer.js +215 -0
- package/dist/videoTypes.d.ts +74 -0
- package/dist/videoTypes.js +2 -0
- package/dist/web/BrowserAssetBundle.d.ts +39 -0
- package/dist/web/BrowserAssetBundle.js +136 -0
- package/dist/web/BrowserAudio.d.ts +41 -0
- package/dist/web/BrowserAudio.js +473 -0
- package/dist/web/BrowserFrameLoop.d.ts +65 -0
- package/dist/web/BrowserFrameLoop.js +125 -0
- package/dist/web/BrowserGame.d.ts +112 -0
- package/dist/web/BrowserGame.js +352 -0
- package/dist/web/BrowserGamepadInput.d.ts +35 -0
- package/dist/web/BrowserGamepadInput.js +134 -0
- package/dist/web/BrowserHoverInput.d.ts +24 -0
- package/dist/web/BrowserHoverInput.js +266 -0
- package/dist/web/BrowserImageTextures.d.ts +66 -0
- package/dist/web/BrowserImageTextures.js +169 -0
- package/dist/web/BrowserInputActions.d.ts +53 -0
- package/dist/web/BrowserInputActions.js +342 -0
- package/dist/web/BrowserKeyboardInput.d.ts +4 -0
- package/dist/web/BrowserKeyboardInput.js +223 -0
- package/dist/web/BrowserPlay.d.ts +289 -0
- package/dist/web/BrowserPlay.js +1301 -0
- package/dist/web/BrowserPointerInput.d.ts +4 -0
- package/dist/web/BrowserPointerInput.js +511 -0
- package/dist/web/BrowserSemantics.d.ts +34 -0
- package/dist/web/BrowserSemantics.js +418 -0
- package/dist/web/BrowserStatsPanel.d.ts +46 -0
- package/dist/web/BrowserStatsPanel.js +137 -0
- package/dist/web/BrowserStorage.d.ts +33 -0
- package/dist/web/BrowserStorage.js +132 -0
- package/dist/web/BrowserTextEditor.d.ts +49 -0
- package/dist/web/BrowserTextEditor.js +839 -0
- package/dist/web/BrowserTextInput.d.ts +83 -0
- package/dist/web/BrowserTextInput.js +524 -0
- package/dist/web/BrowserTextureProvider.d.ts +52 -0
- package/dist/web/BrowserTextureProvider.js +935 -0
- package/dist/web/BrowserVideo.d.ts +28 -0
- package/dist/web/BrowserVideo.js +211 -0
- package/dist/web/CanvasKitFontSetProvider.d.ts +29 -0
- package/dist/web/CanvasKitFontSetProvider.js +215 -0
- package/dist/web/CanvasKitParagraphProvider.d.ts +169 -0
- package/dist/web/CanvasKitParagraphProvider.js +691 -0
- package/dist/web/CanvasTextRasterProvider.d.ts +4 -0
- package/dist/web/CanvasTextRasterProvider.js +312 -0
- package/dist/web/ManifestByteSource.d.ts +147 -0
- package/dist/web/ManifestByteSource.js +974 -0
- package/dist/web/ManifestFontContentLoader.d.ts +12 -0
- package/dist/web/ManifestFontContentLoader.js +30 -0
- package/dist/web/MouseInput.d.ts +4 -0
- package/dist/web/MouseInput.js +218 -0
- package/dist/web/WebGL2Host.d.ts +5 -0
- package/dist/web/WebGL2Host.js +2672 -0
- package/dist/web/WebGPUHost.d.ts +87 -0
- package/dist/web/WebGPUHost.js +3349 -0
- package/dist/web/audio.d.ts +3 -0
- package/dist/web/audio.js +4 -0
- package/dist/web/canvasKitParagraphGeometry.d.ts +27 -0
- package/dist/web/canvasKitParagraphGeometry.js +83 -0
- package/dist/web/editing.d.ts +5 -0
- package/dist/web/editing.js +4 -0
- package/dist/web/editorFonts.d.ts +50 -0
- package/dist/web/editorFonts.js +297 -0
- package/dist/web/game.d.ts +5 -0
- package/dist/web/game.js +6 -0
- package/dist/web/gamepad.d.ts +3 -0
- package/dist/web/gamepad.js +4 -0
- package/dist/web/hover.d.ts +3 -0
- package/dist/web/hover.js +4 -0
- package/dist/web/image.d.ts +4 -0
- package/dist/web/image.js +4 -0
- package/dist/web/imageProjections2D.d.ts +14 -0
- package/dist/web/imageProjections2D.js +2 -0
- package/dist/web/input.d.ts +6 -0
- package/dist/web/input.js +4 -0
- package/dist/web/keyboard.d.ts +3 -0
- package/dist/web/keyboard.js +3 -0
- package/dist/web/kit.d.ts +10 -0
- package/dist/web/kit.js +7 -0
- package/dist/web/loop.d.ts +3 -0
- package/dist/web/loop.js +4 -0
- package/dist/web/paragraph.d.ts +6 -0
- package/dist/web/paragraph.js +4 -0
- package/dist/web/play.d.ts +5 -0
- package/dist/web/play.js +6 -0
- package/dist/web/playSfx.d.ts +36 -0
- package/dist/web/playSfx.js +112 -0
- package/dist/web/pointer.d.ts +3 -0
- package/dist/web/pointer.js +3 -0
- package/dist/web/prepareSharedSubmission2D.d.ts +27 -0
- package/dist/web/prepareSharedSubmission2D.js +57 -0
- package/dist/web/resources.d.ts +27 -0
- package/dist/web/resources.js +96 -0
- package/dist/web/semantics.d.ts +3 -0
- package/dist/web/semantics.js +4 -0
- package/dist/web/sharedDeviceSession.d.ts +64 -0
- package/dist/web/sharedDeviceSession.js +2 -0
- package/dist/web/sharedEffectShaders.d.ts +9 -0
- package/dist/web/sharedEffectShaders.js +165 -0
- package/dist/web/sharedFrameUpload.d.ts +25 -0
- package/dist/web/sharedFrameUpload.js +2 -0
- package/dist/web/sharedHostDeferred.d.ts +7 -0
- package/dist/web/sharedHostDeferred.js +12 -0
- package/dist/web/sharedRetentionLedger.d.ts +85 -0
- package/dist/web/sharedRetentionLedger.js +391 -0
- package/dist/web/sharedSubmissionStorage2D.d.ts +56 -0
- package/dist/web/sharedSubmissionStorage2D.js +73 -0
- package/dist/web/sharedWebGL2Arena.d.ts +40 -0
- package/dist/web/sharedWebGL2Arena.js +77 -0
- package/dist/web/sharedWebGL2Options.d.ts +30 -0
- package/dist/web/sharedWebGL2Options.js +96 -0
- package/dist/web/sharedWebGL2Shaders.d.ts +20 -0
- package/dist/web/sharedWebGL2Shaders.js +314 -0
- package/dist/web/sharedWebGPUOptions.d.ts +37 -0
- package/dist/web/sharedWebGPUOptions.js +126 -0
- package/dist/web/text.d.ts +3 -0
- package/dist/web/text.js +3 -0
- package/dist/web/textInput.d.ts +3 -0
- package/dist/web/textInput.js +3 -0
- package/dist/web/video.d.ts +3 -0
- package/dist/web/video.js +4 -0
- package/dist/web/webgl2.d.ts +7 -0
- package/dist/web/webgl2.js +4 -0
- package/dist/web/webgl2LayerState.d.ts +50 -0
- package/dist/web/webgl2LayerState.js +102 -0
- package/dist/web/webgl2Native.d.ts +70 -0
- package/dist/web/webgl2Native.js +568 -0
- package/dist/web/webgl2Types.d.ts +132 -0
- package/dist/web/webgl2Types.js +2 -0
- package/dist/web/webgpu.d.ts +6 -0
- package/dist/web/webgpu.js +2 -0
- package/dist/web/webgpuBindingCache.d.ts +26 -0
- package/dist/web/webgpuBindingCache.js +223 -0
- package/dist/web/webgpuBufferPool.d.ts +51 -0
- package/dist/web/webgpuBufferPool.js +58 -0
- package/dist/web/webgpuImageResidency.d.ts +53 -0
- package/dist/web/webgpuImageResidency.js +61 -0
- package/dist/web/webgpuLifetime.d.ts +45 -0
- package/dist/web/webgpuLifetime.js +64 -0
- package/dist/web/webgpuRetentionPool.d.ts +66 -0
- package/dist/web/webgpuRetentionPool.js +84 -0
- package/dist/web/webgpuSharedPass.d.ts +7 -0
- package/dist/web/webgpuSharedPass.js +211 -0
- package/dist/web/webgpuSharedResolvePass.d.ts +3 -0
- package/dist/web/webgpuSharedResolvePass.js +29 -0
- package/dist/web/world3d/Audio3D.d.ts +68 -0
- package/dist/web/world3d/Audio3D.js +212 -0
- package/dist/web/world3d/BrowserPlay3D.d.ts +182 -0
- package/dist/web/world3d/BrowserPlay3D.js +851 -0
- package/dist/web/world3d/FlyControls3D.d.ts +55 -0
- package/dist/web/world3d/FlyControls3D.js +160 -0
- package/dist/web/world3d/FollowControls3D.d.ts +28 -0
- package/dist/web/world3d/FollowControls3D.js +117 -0
- package/dist/web/world3d/OrbitControls3D.d.ts +55 -0
- package/dist/web/world3d/OrbitControls3D.js +187 -0
- package/dist/web/world3d/TransformControls3D.d.ts +34 -0
- package/dist/web/world3d/TransformControls3D.js +125 -0
- package/dist/web/world3d/WebGL2Renderer3D.d.ts +133 -0
- package/dist/web/world3d/WebGL2Renderer3D.js +1173 -0
- package/dist/web/world3d/WebGPURenderer3D.d.ts +110 -0
- package/dist/web/world3d/WebGPURenderer3D.js +1915 -0
- package/dist/web/world3d/World3DView.d.ts +51 -0
- package/dist/web/world3d/World3DView.js +77 -0
- package/dist/web/world3d/app3D.d.ts +136 -0
- package/dist/web/world3d/app3D.js +304 -0
- package/dist/web/world3d/assets3D.d.ts +38 -0
- package/dist/web/world3d/assets3D.js +112 -0
- package/dist/web/world3d/atmosphere3D.d.ts +47 -0
- package/dist/web/world3d/atmosphere3D.js +178 -0
- package/dist/web/world3d/frame3D.d.ts +142 -0
- package/dist/web/world3d/frame3D.js +388 -0
- package/dist/web/world3d/gpuResources3D.d.ts +98 -0
- package/dist/web/world3d/gpuResources3D.js +901 -0
- package/dist/web/world3d/host3D.d.ts +23 -0
- package/dist/web/world3d/host3D.js +61 -0
- package/dist/web/world3d/index.d.ts +38 -0
- package/dist/web/world3d/index.js +23 -0
- package/dist/web/world3d/loaders3D.d.ts +26 -0
- package/dist/web/world3d/loaders3D.js +138 -0
- package/dist/web/world3d/markers3D.d.ts +49 -0
- package/dist/web/world3d/markers3D.js +130 -0
- package/dist/web/world3d/materialWebGL23D.d.ts +34 -0
- package/dist/web/world3d/materialWebGL23D.js +218 -0
- package/dist/web/world3d/overlay3D.d.ts +28 -0
- package/dist/web/world3d/overlay3D.js +170 -0
- package/dist/web/world3d/post3D.d.ts +112 -0
- package/dist/web/world3d/post3D.js +459 -0
- package/dist/web/world3d/postWebGL23D.d.ts +24 -0
- package/dist/web/world3d/postWebGL23D.js +237 -0
- package/dist/web/world3d/postWebGPU3D.d.ts +23 -0
- package/dist/web/world3d/postWebGPU3D.js +255 -0
- package/dist/web/world3d/probe3D.d.ts +14 -0
- package/dist/web/world3d/probe3D.js +66 -0
- package/dist/web/world3d/shaders3D.d.ts +43 -0
- package/dist/web/world3d/shaders3D.js +851 -0
- package/dist/web/world3d/stats3D.d.ts +31 -0
- package/dist/web/world3d/stats3D.js +80 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.d.ts +66 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.js +185 -0
- package/dist/web/world3d/webgpu.d.ts +35 -0
- package/dist/web/world3d/webgpu.js +22 -0
- package/dist/web/world3d/webgpuPacking3D.d.ts +13 -0
- package/dist/web/world3d/webgpuPacking3D.js +85 -0
- package/dist/web/world3d/wgsl3D.d.ts +68 -0
- package/dist/web/world3d/wgsl3D.js +781 -0
- package/package.json +220 -4
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { AssetLease, DiagnosticHandler, Engine, Scope, Stage, SharedFrameOptions2D, Texture } from '@egret/engine';
|
|
2
|
+
import type { TextField } from '@egret/engine/text';
|
|
3
|
+
import type { BrowserFrameLoop } from './loop.js';
|
|
4
|
+
import type { PointerInput } from './pointer.js';
|
|
5
|
+
import type { KeyboardInput } from './keyboard.js';
|
|
6
|
+
import type { BrowserStatsPanel } from './BrowserStatsPanel.js';
|
|
7
|
+
export type BrowserGameBackend = 'webgpu' | 'webgl2';
|
|
8
|
+
/** How the canvas fills the element it is in: not at all, whole inside it, covering it, or stretched to it. */
|
|
9
|
+
export type BrowserGameFit = 'none' | 'contain' | 'cover' | 'stretch';
|
|
10
|
+
export interface BrowserGameLabelOptions {
|
|
11
|
+
readonly text?: string;
|
|
12
|
+
/** A font the page has: a family of the system, or one the page loaded. "sans-serif" unless given. */
|
|
13
|
+
readonly fontFamily?: string;
|
|
14
|
+
/** In stage units: 24 unless given. */
|
|
15
|
+
readonly fontSize?: number;
|
|
16
|
+
readonly fontWeight?: number;
|
|
17
|
+
readonly italic?: boolean;
|
|
18
|
+
/** In stage units: a quarter more than the font size unless given. */
|
|
19
|
+
readonly lineHeight?: number;
|
|
20
|
+
/** 0xffffff unless given. */
|
|
21
|
+
readonly color?: number;
|
|
22
|
+
/** The language of the text, such as "zh" or "en": "en" unless given. */
|
|
23
|
+
readonly locale?: string;
|
|
24
|
+
readonly direction?: 'ltr' | 'rtl';
|
|
25
|
+
}
|
|
26
|
+
/** A line of text on the stage whose words can be set like a value. */
|
|
27
|
+
export interface BrowserGameLabel {
|
|
28
|
+
/** The text on the stage: place it with `display.x` and `display.y`, add it where it belongs. */
|
|
29
|
+
readonly display: TextField;
|
|
30
|
+
/** Setting it draws the new words when they are ready; until then the old ones stay. */
|
|
31
|
+
text: string;
|
|
32
|
+
/** Settles when the words last set are on the stage, and rejects if they could not be drawn. */
|
|
33
|
+
readonly ready: Promise<void>;
|
|
34
|
+
/** Changes any of the options; what is left out stays. */
|
|
35
|
+
set(options: BrowserGameLabelOptions): void;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
}
|
|
38
|
+
export interface BrowserGameOptions {
|
|
39
|
+
/** The canvas the game is drawn on. The page gives it its size on the screen. */
|
|
40
|
+
readonly canvas: HTMLCanvasElement;
|
|
41
|
+
/** The size of the stage, in the game's own units, whatever the size of the canvas on the page. */
|
|
42
|
+
readonly width: number;
|
|
43
|
+
readonly height: number;
|
|
44
|
+
/** "auto", unless given: WebGPU where the browser gives an adapter, WebGL2 otherwise. */
|
|
45
|
+
readonly backend?: 'auto' | BrowserGameBackend;
|
|
46
|
+
/** Canvas pixels for each unit of the canvas's own width. The device's ratio unless given, and then never more than 2. */
|
|
47
|
+
readonly pixelRatio?: number;
|
|
48
|
+
/** What a frame is cleared to before the stage is drawn: 0x000000 and 1 unless given. */
|
|
49
|
+
readonly clearColor?: number;
|
|
50
|
+
readonly clearAlpha?: number;
|
|
51
|
+
/** One step of the game, called before each frame with the seconds since the step before. */
|
|
52
|
+
readonly update?: (deltaSeconds: number) => void;
|
|
53
|
+
/** Told once of what stopped the game's loop. Without it the failure is thrown where the console shows it. */
|
|
54
|
+
readonly onError?: (error: unknown) => void;
|
|
55
|
+
/** Touch, mouse and pen on display objects, and the keyboard. Both are made unless false is given. */
|
|
56
|
+
readonly pointer?: boolean;
|
|
57
|
+
readonly keyboard?: boolean;
|
|
58
|
+
/** A panel over the canvas with frames a second, what a frame holds and how busy the Host is. Not made unless true is given. */
|
|
59
|
+
readonly stats?: boolean;
|
|
60
|
+
/** "none" unless given. The canvas is sized inside `fitTo`, or its parent element, and again whenever that changes size. */
|
|
61
|
+
readonly fit?: BrowserGameFit;
|
|
62
|
+
readonly fitTo?: HTMLElement;
|
|
63
|
+
/** The loop starts at once unless false is given; then `game.loop.start()` starts it. */
|
|
64
|
+
readonly autoStart?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface BrowserGame {
|
|
67
|
+
readonly backend: BrowserGameBackend;
|
|
68
|
+
readonly engine: Engine;
|
|
69
|
+
/** The Host that draws: its status says what it holds and what last went wrong. It ends with the game. */
|
|
70
|
+
readonly host: {
|
|
71
|
+
getStatus(): {
|
|
72
|
+
readonly pendingFrames: number;
|
|
73
|
+
};
|
|
74
|
+
whenIdle(): Promise<void>;
|
|
75
|
+
};
|
|
76
|
+
/** The stage of the Engine: what is added to it is drawn. */
|
|
77
|
+
readonly stage: Stage;
|
|
78
|
+
/** A scope for what the game creates. It is disposed with the game. */
|
|
79
|
+
readonly scope: Scope;
|
|
80
|
+
/** The frame the loop draws: the stage's size and what it is cleared to. */
|
|
81
|
+
readonly frame: SharedFrameOptions2D;
|
|
82
|
+
readonly loop: BrowserFrameLoop;
|
|
83
|
+
readonly pointer: PointerInput | undefined;
|
|
84
|
+
readonly keyboard: KeyboardInput | undefined;
|
|
85
|
+
readonly stats: BrowserStatsPanel | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Loads a PNG image from an address and gives the lease of its texture, for `new Bitmap(lease)` or
|
|
88
|
+
* `graphics.beginBitmapFill(lease)`. The lease belongs to the game's scope. The same address loaded twice is one texture.
|
|
89
|
+
*/
|
|
90
|
+
loadTexture(url: string): Promise<AssetLease<Texture>>;
|
|
91
|
+
/** A line of text for the stage. The first call loads the page's text rasterizer. */
|
|
92
|
+
createLabel(options?: BrowserGameLabelOptions): Promise<BrowserGameLabel>;
|
|
93
|
+
/** A place in the page, as a pointer event gives it in `clientX` and `clientY`, as a place on the stage. */
|
|
94
|
+
toStage(clientX: number, clientY: number): {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
};
|
|
98
|
+
/** Stops the loop and ends the input, the scope, the Engine and its Host. */
|
|
99
|
+
dispose(): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* What a game does with the diagnostics of its Engine. An error the Engine can only report, such as a listener of
|
|
103
|
+
* pointer input that threw, which ends that input, is told as a failure of the loop is: to `onError`, or to the page,
|
|
104
|
+
* where the console shows it. Without this it was told to no one, and the game went on without its input.
|
|
105
|
+
*/
|
|
106
|
+
export declare function gameDiagnostics(onError: ((error: unknown) => void) | undefined): DiagnosticHandler;
|
|
107
|
+
/**
|
|
108
|
+
* Makes a game ready to draw: `await createBrowserGame({ canvas, width, height, update })`, then add display objects
|
|
109
|
+
* to `game.stage`. Everything it makes is what the separate entries make; a game that outgrows it takes them apart.
|
|
110
|
+
*/
|
|
111
|
+
export declare function createBrowserGame(options: BrowserGameOptions): Promise<BrowserGame>;
|
|
112
|
+
//# sourceMappingURL=BrowserGame.d.ts.map
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// A game in a page from one call: a Host chosen for the browser, an Engine, a scope, pointer and keyboard input and
|
|
3
|
+
// a frame loop, each made the way its own entry makes it, and all of them ended by one dispose.
|
|
4
|
+
import { EgretError } from '@egret/runtime';
|
|
5
|
+
import { createAssetRef, createAssetType, createEngineForProfile, isTexture, SHARED_FRAME_PROFILE_2D } from '@egret/engine';
|
|
6
|
+
import { createBrowserTextureProvider } from './image.js';
|
|
7
|
+
import { createTextField, createTextRasterCache } from '@egret/engine/text';
|
|
8
|
+
import { createBrowserFrameLoop } from './loop.js';
|
|
9
|
+
import { createBrowserPointerInput } from './pointer.js';
|
|
10
|
+
import { createBrowserKeyboardInput } from './keyboard.js';
|
|
11
|
+
import { createBrowserStatsPanel } from './BrowserStatsPanel.js';
|
|
12
|
+
const invalid = () => new EgretError('BROWSER_GAME_OPTIONS_INVALID');
|
|
13
|
+
const whole = (value) => typeof value === 'number' && Number.isSafeInteger(value) && value > 0;
|
|
14
|
+
/** WebGPU where the browser has it and gives an adapter. Asking for an adapter does not touch the canvas, which can hold one kind of context only. */
|
|
15
|
+
async function chooseBackend(asked) {
|
|
16
|
+
if (asked !== 'auto')
|
|
17
|
+
return asked;
|
|
18
|
+
const gpu = globalThis.navigator?.gpu;
|
|
19
|
+
if (gpu === undefined || gpu === null)
|
|
20
|
+
return 'webgl2';
|
|
21
|
+
try {
|
|
22
|
+
return (await gpu.requestAdapter()) ? 'webgpu' : 'webgl2';
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return 'webgl2';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What a game does with the diagnostics of its Engine. An error the Engine can only report, such as a listener of
|
|
30
|
+
* pointer input that threw, which ends that input, is told as a failure of the loop is: to `onError`, or to the page,
|
|
31
|
+
* where the console shows it. Without this it was told to no one, and the game went on without its input.
|
|
32
|
+
*/
|
|
33
|
+
export function gameDiagnostics(onError) {
|
|
34
|
+
return diagnostic => {
|
|
35
|
+
if (diagnostic.severity !== 'error')
|
|
36
|
+
return;
|
|
37
|
+
const error = diagnostic.cause ?? new EgretError(diagnostic.code);
|
|
38
|
+
if (onError !== undefined) {
|
|
39
|
+
onError(error);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const tell = globalThis.reportError;
|
|
43
|
+
if (typeof tell === 'function')
|
|
44
|
+
tell(error);
|
|
45
|
+
// A page without reportError still shows a promise that nothing handled.
|
|
46
|
+
else
|
|
47
|
+
void Promise.reject(error);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Makes a game ready to draw: `await createBrowserGame({ canvas, width, height, update })`, then add display objects
|
|
52
|
+
* to `game.stage`. Everything it makes is what the separate entries make; a game that outgrows it takes them apart.
|
|
53
|
+
*/
|
|
54
|
+
export async function createBrowserGame(options) {
|
|
55
|
+
if (options === null || typeof options !== 'object')
|
|
56
|
+
throw invalid();
|
|
57
|
+
const { canvas, width, height, update, onError } = options;
|
|
58
|
+
const asked = options.backend ?? 'auto', clearColor = options.clearColor ?? 0, clearAlpha = options.clearAlpha ?? 1;
|
|
59
|
+
const device = Number(globalThis.devicePixelRatio), pixelRatio = options.pixelRatio ?? (device > 0 ? Math.min(device, 2) : 1);
|
|
60
|
+
if (canvas === null ||
|
|
61
|
+
typeof canvas !== 'object' ||
|
|
62
|
+
typeof canvas.getBoundingClientRect !== 'function' ||
|
|
63
|
+
!whole(width) ||
|
|
64
|
+
!whole(height) ||
|
|
65
|
+
(asked !== 'auto' && asked !== 'webgpu' && asked !== 'webgl2') ||
|
|
66
|
+
typeof pixelRatio !== 'number' ||
|
|
67
|
+
!(pixelRatio > 0) ||
|
|
68
|
+
!Number.isFinite(pixelRatio) ||
|
|
69
|
+
!Number.isInteger(clearColor) ||
|
|
70
|
+
clearColor < 0 ||
|
|
71
|
+
clearColor > 0xffffff ||
|
|
72
|
+
typeof clearAlpha !== 'number' ||
|
|
73
|
+
!(clearAlpha >= 0 && clearAlpha <= 1) ||
|
|
74
|
+
(update !== undefined && typeof update !== 'function') ||
|
|
75
|
+
(onError !== undefined && typeof onError !== 'function') ||
|
|
76
|
+
[options.pointer, options.keyboard, options.autoStart, options.stats].some(flag => flag !== undefined && typeof flag !== 'boolean') ||
|
|
77
|
+
!['none', 'contain', 'cover', 'stretch'].includes(options.fit ?? 'none') ||
|
|
78
|
+
(options.fitTo !== undefined && (options.fitTo === null || typeof options.fitTo !== 'object')))
|
|
79
|
+
throw invalid();
|
|
80
|
+
const backend = await chooseBackend(asked);
|
|
81
|
+
// Only the chosen backend's module is loaded.
|
|
82
|
+
const host = backend === 'webgpu'
|
|
83
|
+
? (await import('./webgpu.js')).createSharedWebGPUHost({ canvas, pixelRatio })
|
|
84
|
+
: (await import('./webgl2.js')).createSharedWebGL2Host({ canvas, pixelRatio });
|
|
85
|
+
let engine;
|
|
86
|
+
try {
|
|
87
|
+
engine = await createEngineForProfile({ host, onDiagnostic: gameDiagnostics(onError) }, SHARED_FRAME_PROFILE_2D);
|
|
88
|
+
}
|
|
89
|
+
catch (cause) {
|
|
90
|
+
try {
|
|
91
|
+
await host.close();
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
/* The first failure is the one to tell. */
|
|
95
|
+
}
|
|
96
|
+
throw cause;
|
|
97
|
+
}
|
|
98
|
+
let loop, stats, disposal;
|
|
99
|
+
try {
|
|
100
|
+
const scope = engine.createScope(), frame = Object.freeze({ width, height, clearColor, clearAlpha });
|
|
101
|
+
const pointer = options.pointer === false ? undefined : createBrowserPointerInput({ engine, scope, width, height });
|
|
102
|
+
const keyboard = options.keyboard === false ? undefined : createBrowserKeyboardInput({ engine, scope });
|
|
103
|
+
const panel = (stats = options.stats === true ? createBrowserStatsPanel({ canvas, label: backend }) : undefined);
|
|
104
|
+
let drawn;
|
|
105
|
+
// With a panel, the loop draws through a step that keeps the frame, and each step tells the panel what the last one did.
|
|
106
|
+
const made = (loop =
|
|
107
|
+
panel === undefined
|
|
108
|
+
? createBrowserFrameLoop({
|
|
109
|
+
engine,
|
|
110
|
+
host,
|
|
111
|
+
frame,
|
|
112
|
+
...(update === undefined ? {} : { update }),
|
|
113
|
+
...(onError === undefined ? {} : { onError })
|
|
114
|
+
})
|
|
115
|
+
: createBrowserFrameLoop({
|
|
116
|
+
engine: {
|
|
117
|
+
clock: engine.clock,
|
|
118
|
+
advanceTime: (seconds) => engine.advanceTime(seconds),
|
|
119
|
+
renderSharedFrame: (given) => (drawn = engine.renderSharedFrame(given))
|
|
120
|
+
},
|
|
121
|
+
host,
|
|
122
|
+
frame,
|
|
123
|
+
...(onError === undefined ? {} : { onError }),
|
|
124
|
+
update(seconds) {
|
|
125
|
+
const now = made.snapshot();
|
|
126
|
+
panel.sample({
|
|
127
|
+
...(drawn === undefined ? {} : { frame: drawn }),
|
|
128
|
+
pendingFrames: host.getStatus().pendingFrames,
|
|
129
|
+
frames: now.frames,
|
|
130
|
+
skipped: now.skipped
|
|
131
|
+
});
|
|
132
|
+
drawn = undefined;
|
|
133
|
+
update?.(seconds);
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
// Images by address: one asset type whose key is the address, read with the page's own request and decoded as PNG.
|
|
137
|
+
const imageType = createAssetType('egret.browser-game.image', isTexture);
|
|
138
|
+
const images = createBrowserTextureProvider({
|
|
139
|
+
async readBytes(ref, context) {
|
|
140
|
+
const stop = new AbortController(), abort = () => stop.abort();
|
|
141
|
+
if (context.signal.aborted)
|
|
142
|
+
abort();
|
|
143
|
+
else
|
|
144
|
+
context.signal.addEventListener('abort', abort, { once: true });
|
|
145
|
+
try {
|
|
146
|
+
const response = await globalThis.fetch(ref.id, { signal: stop.signal });
|
|
147
|
+
if (!response.ok)
|
|
148
|
+
throw new EgretError('BROWSER_GAME_IMAGE_FAILED', { cause: new Error(response.status + ' ' + ref.id) });
|
|
149
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
context.signal.removeEventListener('abort', abort);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
engine.assets.register(imageType, images);
|
|
157
|
+
// The canvas in its element: sized now and whenever the element changes size. The stage keeps its own units.
|
|
158
|
+
const fit = options.fit ?? 'none', holder = options.fitTo ?? canvas.parentElement;
|
|
159
|
+
let watcher;
|
|
160
|
+
if (fit !== 'none' && holder !== null) {
|
|
161
|
+
const place = () => {
|
|
162
|
+
const box = holder.getBoundingClientRect(), wide = box.width / width, tall = box.height / height;
|
|
163
|
+
const scaleX = fit === 'stretch' ? wide : fit === 'contain' ? Math.min(wide, tall) : Math.max(wide, tall), scaleY = fit === 'stretch' ? tall : scaleX;
|
|
164
|
+
const style = canvas.style;
|
|
165
|
+
style.width = width * scaleX + 'px';
|
|
166
|
+
style.height = height * scaleY + 'px';
|
|
167
|
+
// Centred in its element; with "cover" what does not fit is outside it, for the element to cut off.
|
|
168
|
+
style.marginLeft = (box.width - width * scaleX) / 2 + 'px';
|
|
169
|
+
style.marginTop = (box.height - height * scaleY) / 2 + 'px';
|
|
170
|
+
};
|
|
171
|
+
place();
|
|
172
|
+
watcher = new ResizeObserver(place);
|
|
173
|
+
watcher.observe(holder);
|
|
174
|
+
}
|
|
175
|
+
// Text: one cache for the Engine, made with the page's rasterizer when the first label is asked for.
|
|
176
|
+
let textCache;
|
|
177
|
+
// The text cache takes four drawings at a time and refuses more. Labels wait their turn here instead, two at a
|
|
178
|
+
// time, so a game may make or change any number of them together.
|
|
179
|
+
const LABEL_LANES = 2;
|
|
180
|
+
let labelsDrawing = 0;
|
|
181
|
+
const labelsWaiting = [];
|
|
182
|
+
const enterLabelLane = () => {
|
|
183
|
+
if (labelsDrawing < LABEL_LANES) {
|
|
184
|
+
labelsDrawing++;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
// The lane is handed over by the label that leaves it, so no newcomer takes it first.
|
|
188
|
+
return new Promise(resolve => labelsWaiting.push(resolve));
|
|
189
|
+
};
|
|
190
|
+
const leaveLabelLane = () => {
|
|
191
|
+
const next = labelsWaiting.shift();
|
|
192
|
+
if (next)
|
|
193
|
+
next();
|
|
194
|
+
else
|
|
195
|
+
labelsDrawing--;
|
|
196
|
+
};
|
|
197
|
+
async function createLabel(given = {}) {
|
|
198
|
+
if (given === null || typeof given !== 'object')
|
|
199
|
+
throw invalid();
|
|
200
|
+
textCache ??= import('./text.js').then(text => createTextRasterCache(engine.assets, { provider: text.createCanvasTextRasterProvider() }));
|
|
201
|
+
const field = createTextField(engine, scope, await textCache);
|
|
202
|
+
let now = {
|
|
203
|
+
text: '',
|
|
204
|
+
fontFamily: 'sans-serif',
|
|
205
|
+
fontSize: 24,
|
|
206
|
+
fontWeight: 400,
|
|
207
|
+
italic: false,
|
|
208
|
+
lineHeight: 0,
|
|
209
|
+
color: 0xffffff,
|
|
210
|
+
locale: 'en',
|
|
211
|
+
direction: 'ltr'
|
|
212
|
+
};
|
|
213
|
+
let ready = Promise.resolve(), asked = 0, drawing = false, running;
|
|
214
|
+
const request = () => field.setRequest({
|
|
215
|
+
text: now.text,
|
|
216
|
+
fontFamily: now.fontFamily,
|
|
217
|
+
fontSize: now.fontSize,
|
|
218
|
+
fontWeight: now.fontWeight,
|
|
219
|
+
fontStyle: now.italic ? 'italic' : 'normal',
|
|
220
|
+
lineHeight: now.lineHeight > 0 ? now.lineHeight : now.fontSize * 1.25,
|
|
221
|
+
locale: now.locale,
|
|
222
|
+
direction: now.direction,
|
|
223
|
+
density: pixelRatio,
|
|
224
|
+
fillColor: now.color
|
|
225
|
+
});
|
|
226
|
+
// Draws the label's newest words. Words changed while it draws are asked for when that drawing is done, never
|
|
227
|
+
// over it, so a label holds one drawing of the text cache at a time however often its words change.
|
|
228
|
+
const draw = async () => {
|
|
229
|
+
try {
|
|
230
|
+
await enterLabelLane();
|
|
231
|
+
try {
|
|
232
|
+
for (let shown = -1; shown !== asked;) {
|
|
233
|
+
if (shown !== -1)
|
|
234
|
+
request();
|
|
235
|
+
shown = asked;
|
|
236
|
+
drawing = true;
|
|
237
|
+
try {
|
|
238
|
+
// The cache frees a drawing's place a few turns after the drawing is handed over. A refusal for
|
|
239
|
+
// want of a place is waited out, without a timer; one that lasts is the label's failure.
|
|
240
|
+
for (let attempt = 0;; attempt++) {
|
|
241
|
+
try {
|
|
242
|
+
await field.prepare();
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
catch (cause) {
|
|
246
|
+
if (!(cause instanceof EgretError) || cause.code !== 'TEXT_CACHE_BUDGET' || attempt >= 400)
|
|
247
|
+
throw cause;
|
|
248
|
+
await Promise.resolve();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
drawing = false;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
finally {
|
|
258
|
+
leaveLabelLane();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
running = undefined;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const apply = (next) => {
|
|
266
|
+
if (next === null || typeof next !== 'object')
|
|
267
|
+
throw invalid();
|
|
268
|
+
now = { ...now, ...next };
|
|
269
|
+
// Refused at once when nothing is being drawn; otherwise when its turn comes, through `ready`.
|
|
270
|
+
if (!drawing)
|
|
271
|
+
request();
|
|
272
|
+
asked++;
|
|
273
|
+
running ??= draw();
|
|
274
|
+
// A failure is the label's to tell through `ready`; it is not left unheard.
|
|
275
|
+
running.catch(() => { });
|
|
276
|
+
ready = running;
|
|
277
|
+
};
|
|
278
|
+
apply(given);
|
|
279
|
+
return Object.freeze({
|
|
280
|
+
display: field,
|
|
281
|
+
get text() {
|
|
282
|
+
return now.text;
|
|
283
|
+
},
|
|
284
|
+
set text(value) {
|
|
285
|
+
if (value !== now.text)
|
|
286
|
+
apply({ text: value });
|
|
287
|
+
},
|
|
288
|
+
get ready() {
|
|
289
|
+
return ready;
|
|
290
|
+
},
|
|
291
|
+
set: apply,
|
|
292
|
+
dispose() {
|
|
293
|
+
field.dispose();
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
const game = Object.freeze({
|
|
298
|
+
backend,
|
|
299
|
+
engine,
|
|
300
|
+
host,
|
|
301
|
+
stage: engine.stage,
|
|
302
|
+
scope,
|
|
303
|
+
frame,
|
|
304
|
+
loop: made,
|
|
305
|
+
pointer,
|
|
306
|
+
keyboard,
|
|
307
|
+
stats: panel,
|
|
308
|
+
createLabel,
|
|
309
|
+
async loadTexture(url) {
|
|
310
|
+
if (typeof url !== 'string' || url === '')
|
|
311
|
+
throw invalid();
|
|
312
|
+
return scope.use(await engine.assets.acquire(createAssetRef(imageType, url), { signal: scope.signal }));
|
|
313
|
+
},
|
|
314
|
+
toStage(clientX, clientY) {
|
|
315
|
+
const box = canvas.getBoundingClientRect();
|
|
316
|
+
return { x: ((clientX - box.left) * width) / box.width, y: ((clientY - box.top) * height) / box.height };
|
|
317
|
+
},
|
|
318
|
+
dispose() {
|
|
319
|
+
// The scope ends the input it was given; the Engine ends its scopes and its Host.
|
|
320
|
+
return (disposal ??= (async () => {
|
|
321
|
+
made.dispose();
|
|
322
|
+
panel?.dispose();
|
|
323
|
+
watcher?.disconnect();
|
|
324
|
+
// The scope ends the labels; then the cache they were drawn from can end, before the Engine does.
|
|
325
|
+
scope.dispose();
|
|
326
|
+
if (textCache !== undefined) {
|
|
327
|
+
const cache = await textCache.catch(() => undefined);
|
|
328
|
+
cache?.dispose();
|
|
329
|
+
await cache?.whenIdle();
|
|
330
|
+
}
|
|
331
|
+
await engine.dispose();
|
|
332
|
+
await images.close();
|
|
333
|
+
})());
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
if (options.autoStart !== false)
|
|
337
|
+
made.start();
|
|
338
|
+
return game;
|
|
339
|
+
}
|
|
340
|
+
catch (cause) {
|
|
341
|
+
loop?.dispose();
|
|
342
|
+
stats?.dispose();
|
|
343
|
+
try {
|
|
344
|
+
await engine.dispose();
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
/* The first failure is the one to tell. */
|
|
348
|
+
}
|
|
349
|
+
throw cause;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=BrowserGame.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { GamepadInput, GamepadInputOptions } from '@egret/engine/input/gamepad';
|
|
2
|
+
export interface BrowserGamepadInputOptions extends GamepadInputOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Told what failed where nothing could be returned: in a listener of the page, or when a pad
|
|
5
|
+
* was asked to shake. Without it the failure is reported to the page.
|
|
6
|
+
*/
|
|
7
|
+
readonly onError?: (cause: unknown) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface GamepadRumble {
|
|
10
|
+
/** Milliseconds, up to 5000. Defaults to 200. */
|
|
11
|
+
readonly duration?: number;
|
|
12
|
+
/** The light, fast motor, 0 to 1. Defaults to 0.5. */
|
|
13
|
+
readonly weak?: number;
|
|
14
|
+
/** The heavy, slow motor, 0 to 1. Defaults to 0.5. */
|
|
15
|
+
readonly strong?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface BrowserGamepadInput {
|
|
18
|
+
readonly input: GamepadInput;
|
|
19
|
+
/**
|
|
20
|
+
* Looks at the pads of the page once. A game calls it once a frame. The timestamp is the frame's,
|
|
21
|
+
* in milliseconds; without it the clock of the page is read. A hidden page is not looked at.
|
|
22
|
+
*/
|
|
23
|
+
poll(timestamp?: number): void;
|
|
24
|
+
/** Shakes a pad that can be shaken. Says whether the pad was asked to. */
|
|
25
|
+
rumble(pad: number, options?: GamepadRumble): boolean;
|
|
26
|
+
/** The same as disposing the input. A scope can own the pads of a game through this. */
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The pads of a page. A browser tells nothing when a button goes down: it has to be asked, so the
|
|
31
|
+
* game asks once a frame through `poll`. Buttons are let go when the page is hidden or the window
|
|
32
|
+
* loses the person, because what happens to a pad then is not told either.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createBrowserGamepadInput(options?: BrowserGamepadInputOptions): BrowserGamepadInput;
|
|
35
|
+
//# sourceMappingURL=BrowserGamepadInput.d.ts.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { EgretError } from '@egret/runtime';
|
|
3
|
+
import { createGamepadInput } from '@egret/engine/input/gamepad';
|
|
4
|
+
const within = (value, least, most) => typeof value === 'number' && value >= least && value <= most;
|
|
5
|
+
/**
|
|
6
|
+
* The pads of a page. A browser tells nothing when a button goes down: it has to be asked, so the
|
|
7
|
+
* game asks once a frame through `poll`. Buttons are let go when the page is hidden or the window
|
|
8
|
+
* loses the person, because what happens to a pad then is not told either.
|
|
9
|
+
*/
|
|
10
|
+
export function createBrowserGamepadInput(options = {}) {
|
|
11
|
+
if (options === null || typeof options !== 'object' || Array.isArray(options))
|
|
12
|
+
throw new EgretError('GAMEPAD_OPTIONS_INVALID');
|
|
13
|
+
const { onError, ...configuration } = options;
|
|
14
|
+
if (onError !== undefined && typeof onError !== 'function')
|
|
15
|
+
throw new EgretError('GAMEPAD_OPTIONS_INVALID');
|
|
16
|
+
const host = globalThis.navigator, page = globalThis.document, win = globalThis.window;
|
|
17
|
+
if (host === undefined || typeof host.getGamepads !== 'function')
|
|
18
|
+
throw new EgretError('GAMEPAD_HOST_UNAVAILABLE');
|
|
19
|
+
const input = createGamepadInput(configuration);
|
|
20
|
+
const pairs = [];
|
|
21
|
+
let closed = false, last = 0;
|
|
22
|
+
function report(cause) {
|
|
23
|
+
if (onError !== undefined)
|
|
24
|
+
onError(cause);
|
|
25
|
+
else if (typeof globalThis.reportError === 'function')
|
|
26
|
+
globalThis.reportError(cause);
|
|
27
|
+
}
|
|
28
|
+
function listen(target, type, listener) {
|
|
29
|
+
if (target === undefined)
|
|
30
|
+
return;
|
|
31
|
+
target.addEventListener(type, listener);
|
|
32
|
+
pairs.push({ target, type, listener });
|
|
33
|
+
}
|
|
34
|
+
function cleanup() {
|
|
35
|
+
if (closed)
|
|
36
|
+
return;
|
|
37
|
+
closed = true;
|
|
38
|
+
for (const pair of pairs.splice(0).reverse())
|
|
39
|
+
try {
|
|
40
|
+
pair.target.removeEventListener(pair.type, pair.listener);
|
|
41
|
+
}
|
|
42
|
+
catch (cause) {
|
|
43
|
+
report(cause);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const letGo = () => {
|
|
47
|
+
if (closed)
|
|
48
|
+
return;
|
|
49
|
+
try {
|
|
50
|
+
input.release();
|
|
51
|
+
}
|
|
52
|
+
catch (cause) {
|
|
53
|
+
report(cause);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
listen(page, 'visibilitychange', event => {
|
|
58
|
+
if (page.visibilityState === 'hidden')
|
|
59
|
+
letGo(event);
|
|
60
|
+
});
|
|
61
|
+
listen(win, 'blur', letGo);
|
|
62
|
+
listen(win, 'pagehide', letGo);
|
|
63
|
+
}
|
|
64
|
+
catch (cause) {
|
|
65
|
+
cleanup();
|
|
66
|
+
input.dispose();
|
|
67
|
+
throw cause;
|
|
68
|
+
}
|
|
69
|
+
return Object.freeze({
|
|
70
|
+
input,
|
|
71
|
+
poll(timestamp) {
|
|
72
|
+
if (timestamp !== undefined && !within(timestamp, 0, Number.MAX_VALUE))
|
|
73
|
+
throw new EgretError('GAMEPAD_SAMPLE');
|
|
74
|
+
if (closed || input.state === 'closed' || page?.visibilityState === 'hidden')
|
|
75
|
+
return;
|
|
76
|
+
const samples = [];
|
|
77
|
+
for (const pad of host.getGamepads()) {
|
|
78
|
+
// A browser keeps a place for a pad that was taken away.
|
|
79
|
+
if (pad === null || pad === undefined || pad.connected === false)
|
|
80
|
+
continue;
|
|
81
|
+
samples.push({
|
|
82
|
+
index: pad.index,
|
|
83
|
+
id: pad.id,
|
|
84
|
+
mapping: pad.mapping,
|
|
85
|
+
buttons: Array.from(pad.buttons, button => ({
|
|
86
|
+
pressed: button.pressed,
|
|
87
|
+
value: Math.min(1, Math.max(0, button.value))
|
|
88
|
+
})),
|
|
89
|
+
axes: Array.from(pad.axes, axis => (Number.isFinite(axis) ? Math.min(1, Math.max(-1, axis)) : 0))
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// A clock of the page may be coarse or handed in out of step: the input is never told that time went back.
|
|
93
|
+
last = Math.max(last, timestamp ?? globalThis.performance.now());
|
|
94
|
+
input.sample(samples, last);
|
|
95
|
+
},
|
|
96
|
+
rumble(index, rumble = {}) {
|
|
97
|
+
if (rumble === null || typeof rumble !== 'object')
|
|
98
|
+
throw new EgretError('GAMEPAD_OPTIONS_INVALID');
|
|
99
|
+
const { duration = 200, weak = 0.5, strong = 0.5 } = rumble;
|
|
100
|
+
if (!Number.isSafeInteger(index) ||
|
|
101
|
+
!within(index, 0, 31) ||
|
|
102
|
+
!within(duration, 0, 5000) ||
|
|
103
|
+
!within(weak, 0, 1) ||
|
|
104
|
+
!within(strong, 0, 1))
|
|
105
|
+
throw new EgretError('GAMEPAD_OPTIONS_INVALID');
|
|
106
|
+
if (closed || page?.visibilityState === 'hidden')
|
|
107
|
+
return false;
|
|
108
|
+
const pad = [...host.getGamepads()].find(candidate => candidate !== null && candidate !== undefined && candidate.index === index && candidate.connected !== false);
|
|
109
|
+
const actuator = pad?.vibrationActuator;
|
|
110
|
+
if (actuator === null || actuator === undefined || typeof actuator.playEffect !== 'function')
|
|
111
|
+
return false;
|
|
112
|
+
try {
|
|
113
|
+
const played = actuator.playEffect('dual-rumble', {
|
|
114
|
+
startDelay: 0,
|
|
115
|
+
duration,
|
|
116
|
+
weakMagnitude: weak,
|
|
117
|
+
strongMagnitude: strong
|
|
118
|
+
});
|
|
119
|
+
if (played !== undefined && typeof played.then === 'function')
|
|
120
|
+
played.then(undefined, report);
|
|
121
|
+
}
|
|
122
|
+
catch (cause) {
|
|
123
|
+
report(cause);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
},
|
|
128
|
+
dispose() {
|
|
129
|
+
cleanup();
|
|
130
|
+
input.dispose();
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=BrowserGamepadInput.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HoverInput, HoverInputOptions } from '@egret/engine/input/hover';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a wheel over the canvas also scrolls the page: only when nothing consumed it, never
|
|
4
|
+
* (the canvas owns the wheel), or always (the listener is passive and cannot hold the page).
|
|
5
|
+
*/
|
|
6
|
+
export type WheelPagePolicy = 'unconsumed' | 'never' | 'always';
|
|
7
|
+
export interface BrowserHoverInputOptions extends HoverInputOptions {
|
|
8
|
+
/** The canvas the Engine draws on. Its CSS rectangle is mapped to the logical width and height. */
|
|
9
|
+
readonly canvas: HTMLCanvasElement;
|
|
10
|
+
/** Defaults to 'unconsumed'. */
|
|
11
|
+
readonly wheelPage?: WheelPagePolicy;
|
|
12
|
+
/**
|
|
13
|
+
* Told when the adapter has stopped because a callback or an event failed. The input is closed
|
|
14
|
+
* by then. Without it the failure is reported to the page as an uncaught error.
|
|
15
|
+
*/
|
|
16
|
+
readonly onError?: (cause: unknown) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Hover and wheel of the page for the canvas of a started Engine, in the same connected,
|
|
20
|
+
* untransformed profile as the pointer adapter. It captures no pointer and sets no style, so it
|
|
21
|
+
* shares the canvas with that adapter.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createBrowserHoverInput(options: BrowserHoverInputOptions): HoverInput;
|
|
24
|
+
//# sourceMappingURL=BrowserHoverInput.d.ts.map
|