@nice2dev/ui-graphics 1.0.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/CHANGELOG.md +84 -0
- package/LICENSE +21 -0
- package/README.md +339 -0
- package/dist/cjs/animation/AnimatedPerson.js +153 -0
- package/dist/cjs/animation/AnimatedPerson.js.map +1 -0
- package/dist/cjs/animation/AnimationEditor.js +106 -0
- package/dist/cjs/animation/AnimationEditor.js.map +1 -0
- package/dist/cjs/animation/Audience.js +59 -0
- package/dist/cjs/animation/Audience.js.map +1 -0
- package/dist/cjs/animation/BodyRenderer.js +33 -0
- package/dist/cjs/animation/BodyRenderer.js.map +1 -0
- package/dist/cjs/animation/animationHelper.js +272 -0
- package/dist/cjs/animation/animationHelper.js.map +1 -0
- package/dist/cjs/animation/characterTypes.js +75 -0
- package/dist/cjs/animation/characterTypes.js.map +1 -0
- package/dist/cjs/animation/choreoDSL.js +190 -0
- package/dist/cjs/animation/choreoDSL.js.map +1 -0
- package/dist/cjs/animation/choreography.js +41 -0
- package/dist/cjs/animation/choreography.js.map +1 -0
- package/dist/cjs/animation/karaokeIntegration.js +98 -0
- package/dist/cjs/animation/karaokeIntegration.js.map +1 -0
- package/dist/cjs/animation/lottieExport.js +128 -0
- package/dist/cjs/animation/lottieExport.js.map +1 -0
- package/dist/cjs/animation/motionPath.js +196 -0
- package/dist/cjs/animation/motionPath.js.map +1 -0
- package/dist/cjs/animation/physics.js +201 -0
- package/dist/cjs/animation/physics.js.map +1 -0
- package/dist/cjs/animation/rig/RigPlayer.js +63 -0
- package/dist/cjs/animation/rig/RigPlayer.js.map +1 -0
- package/dist/cjs/animation/rig/RiggedBody.js +30 -0
- package/dist/cjs/animation/rig/RiggedBody.js.map +1 -0
- package/dist/cjs/animation/rig/choreoRigBridge.js +63 -0
- package/dist/cjs/animation/rig/choreoRigBridge.js.map +1 -0
- package/dist/cjs/animation/rig/ik.js +22 -0
- package/dist/cjs/animation/rig/ik.js.map +1 -0
- package/dist/cjs/animation/rig/poseOps.js +49 -0
- package/dist/cjs/animation/rig/poseOps.js.map +1 -0
- package/dist/cjs/animation/rig/presets.js +60 -0
- package/dist/cjs/animation/rig/presets.js.map +1 -0
- package/dist/cjs/animation/rig/rigMath.js +41 -0
- package/dist/cjs/animation/rig/rigMath.js.map +1 -0
- package/dist/cjs/animation/rig/rigTypes.js +44 -0
- package/dist/cjs/animation/rig/rigTypes.js.map +1 -0
- package/dist/cjs/animation/shapes/arms.js +15 -0
- package/dist/cjs/animation/shapes/arms.js.map +1 -0
- package/dist/cjs/animation/shapes/eyes.js +52 -0
- package/dist/cjs/animation/shapes/eyes.js.map +1 -0
- package/dist/cjs/animation/shapes/hair.js +55 -0
- package/dist/cjs/animation/shapes/hair.js.map +1 -0
- package/dist/cjs/animation/shapes/heads.js +62 -0
- package/dist/cjs/animation/shapes/heads.js.map +1 -0
- package/dist/cjs/animation/shapes/headwear.js +44 -0
- package/dist/cjs/animation/shapes/headwear.js.map +1 -0
- package/dist/cjs/animation/shapes/legs.js +15 -0
- package/dist/cjs/animation/shapes/legs.js.map +1 -0
- package/dist/cjs/animation/shapes/mouths.js +53 -0
- package/dist/cjs/animation/shapes/mouths.js.map +1 -0
- package/dist/cjs/animation/shapes/noses.js +31 -0
- package/dist/cjs/animation/shapes/noses.js.map +1 -0
- package/dist/cjs/animation/shapes/outfits.js +43 -0
- package/dist/cjs/animation/shapes/outfits.js.map +1 -0
- package/dist/cjs/animation/shapes/torsos.js +13 -0
- package/dist/cjs/animation/shapes/torsos.js.map +1 -0
- package/dist/cjs/animation/spineExport.js +132 -0
- package/dist/cjs/animation/spineExport.js.map +1 -0
- package/dist/cjs/core/LocalUI.js +54 -0
- package/dist/cjs/core/LocalUI.js.map +1 -0
- package/dist/cjs/core/collaboration.js +259 -0
- package/dist/cjs/core/collaboration.js.map +1 -0
- package/dist/cjs/core/colorBlindness.js +97 -0
- package/dist/cjs/core/colorBlindness.js.map +1 -0
- package/dist/cjs/core/dragDrop.js +168 -0
- package/dist/cjs/core/dragDrop.js.map +1 -0
- package/dist/cjs/core/fixes.js +185 -0
- package/dist/cjs/core/fixes.js.map +1 -0
- package/dist/cjs/core/gridGuides.js +245 -0
- package/dist/cjs/core/gridGuides.js.map +1 -0
- package/dist/cjs/core/historyVisual.js +124 -0
- package/dist/cjs/core/historyVisual.js.map +1 -0
- package/dist/cjs/core/i18n.js +16 -0
- package/dist/cjs/core/i18n.js.map +1 -0
- package/dist/cjs/core/integrations.js +261 -0
- package/dist/cjs/core/integrations.js.map +1 -0
- package/dist/cjs/core/minimap.js +142 -0
- package/dist/cjs/core/minimap.js.map +1 -0
- package/dist/cjs/core/plugins.js +129 -0
- package/dist/cjs/core/plugins.js.map +1 -0
- package/dist/cjs/core/rtl.js +102 -0
- package/dist/cjs/core/rtl.js.map +1 -0
- package/dist/cjs/core/shortcuts.js +205 -0
- package/dist/cjs/core/shortcuts.js.map +1 -0
- package/dist/cjs/core/theme.js +171 -0
- package/dist/cjs/core/theme.js.map +1 -0
- package/dist/cjs/font/NiceFontEditor.js +193 -0
- package/dist/cjs/font/NiceFontEditor.js.map +1 -0
- package/dist/cjs/game/GameAsset2dEditor.js +371 -0
- package/dist/cjs/game/GameAsset2dEditor.js.map +1 -0
- package/dist/cjs/game/GameAsset2dEditor.module.css.js +6 -0
- package/dist/cjs/game/GameAsset2dEditor.module.css.js.map +1 -0
- package/dist/cjs/game/gameAssetTypes.js +20 -0
- package/dist/cjs/game/gameAssetTypes.js.map +1 -0
- package/dist/cjs/game/gameAssetUtils.js +475 -0
- package/dist/cjs/game/gameAssetUtils.js.map +1 -0
- package/dist/cjs/game/useGameAssetEditor.js +761 -0
- package/dist/cjs/game/useGameAssetEditor.js.map +1 -0
- package/dist/cjs/icon/NiceIconEditor.js +249 -0
- package/dist/cjs/icon/NiceIconEditor.js.map +1 -0
- package/dist/cjs/index.js +264 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/nice2dev-ui/dist/index.js +32070 -0
- package/dist/cjs/nice2dev-ui/dist/index.js.map +1 -0
- package/dist/cjs/nice2dev-ui-graphics.css +1 -0
- package/dist/cjs/photo/FilterThumb.js +29 -0
- package/dist/cjs/photo/FilterThumb.js.map +1 -0
- package/dist/cjs/photo/PhotoEditor.js +20 -0
- package/dist/cjs/photo/PhotoEditor.js.map +1 -0
- package/dist/cjs/photo/PhotoEditor.module.css.js +6 -0
- package/dist/cjs/photo/PhotoEditor.module.css.js.map +1 -0
- package/dist/cjs/photo/PhotoEditorCanvas.js +59 -0
- package/dist/cjs/photo/PhotoEditorCanvas.js.map +1 -0
- package/dist/cjs/photo/PhotoEditorLeftPanel.js +174 -0
- package/dist/cjs/photo/PhotoEditorLeftPanel.js.map +1 -0
- package/dist/cjs/photo/PhotoEditorToolbar.js +15 -0
- package/dist/cjs/photo/PhotoEditorToolbar.js.map +1 -0
- package/dist/cjs/photo/photoEditorActions.js +80 -0
- package/dist/cjs/photo/photoEditorActions.js.map +1 -0
- package/dist/cjs/photo/photoEditorTypes.js +40 -0
- package/dist/cjs/photo/photoEditorTypes.js.map +1 -0
- package/dist/cjs/photo/photoFilters.js +880 -0
- package/dist/cjs/photo/photoFilters.js.map +1 -0
- package/dist/cjs/photo/photoOverlays.js +651 -0
- package/dist/cjs/photo/photoOverlays.js.map +1 -0
- package/dist/cjs/photo/photoSelection.js +547 -0
- package/dist/cjs/photo/photoSelection.js.map +1 -0
- package/dist/cjs/photo/usePhotoEditor.js +640 -0
- package/dist/cjs/photo/usePhotoEditor.js.map +1 -0
- package/dist/cjs/pixel/HSVPicker.js +173 -0
- package/dist/cjs/pixel/HSVPicker.js.map +1 -0
- package/dist/cjs/pixel/PixelEditor.js +28 -0
- package/dist/cjs/pixel/PixelEditor.js.map +1 -0
- package/dist/cjs/pixel/PixelEditor.module.css.js +6 -0
- package/dist/cjs/pixel/PixelEditor.module.css.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorCanvas.js +15 -0
- package/dist/cjs/pixel/PixelEditorCanvas.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorMenuBar.js +11 -0
- package/dist/cjs/pixel/PixelEditorMenuBar.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorRightPanel.js +15 -0
- package/dist/cjs/pixel/PixelEditorRightPanel.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorStatusBar.js +15 -0
- package/dist/cjs/pixel/PixelEditorStatusBar.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorTimeline.js +11 -0
- package/dist/cjs/pixel/PixelEditorTimeline.js.map +1 -0
- package/dist/cjs/pixel/PixelEditorToolbar.js +16 -0
- package/dist/cjs/pixel/PixelEditorToolbar.js.map +1 -0
- package/dist/cjs/pixel/asepriteFormat.js +512 -0
- package/dist/cjs/pixel/asepriteFormat.js.map +1 -0
- package/dist/cjs/pixel/pixelEditorExports.js +471 -0
- package/dist/cjs/pixel/pixelEditorExports.js.map +1 -0
- package/dist/cjs/pixel/pixelEditorTypes.js +102 -0
- package/dist/cjs/pixel/pixelEditorTypes.js.map +1 -0
- package/dist/cjs/pixel/pixelEditorUtils.js +664 -0
- package/dist/cjs/pixel/pixelEditorUtils.js.map +1 -0
- package/dist/cjs/pixel/usePixelEditor.js +1112 -0
- package/dist/cjs/pixel/usePixelEditor.js.map +1 -0
- package/dist/cjs/texture/Nice3DTexturePainter.js +236 -0
- package/dist/cjs/texture/Nice3DTexturePainter.js.map +1 -0
- package/dist/cjs/ui/NiceUIDesigner.js +191 -0
- package/dist/cjs/ui/NiceUIDesigner.js.map +1 -0
- package/dist/cjs/vector/VectorEditor.js +31 -0
- package/dist/cjs/vector/VectorEditor.js.map +1 -0
- package/dist/cjs/vector/VectorEditor.module.css.js +6 -0
- package/dist/cjs/vector/VectorEditor.module.css.js.map +1 -0
- package/dist/cjs/vector/VectorEditorMenuBar.js +16 -0
- package/dist/cjs/vector/VectorEditorMenuBar.js.map +1 -0
- package/dist/cjs/vector/VectorEditorRightPanel.js +126 -0
- package/dist/cjs/vector/VectorEditorRightPanel.js.map +1 -0
- package/dist/cjs/vector/VectorEditorShapeRenderer.js +55 -0
- package/dist/cjs/vector/VectorEditorShapeRenderer.js.map +1 -0
- package/dist/cjs/vector/VectorEditorStatusBar.js +14 -0
- package/dist/cjs/vector/VectorEditorStatusBar.js.map +1 -0
- package/dist/cjs/vector/useVectorEditor.js +613 -0
- package/dist/cjs/vector/useVectorEditor.js.map +1 -0
- package/dist/cjs/vector/vectorBooleanOps.js +511 -0
- package/dist/cjs/vector/vectorBooleanOps.js.map +1 -0
- package/dist/cjs/vector/vectorEditorExport.js +159 -0
- package/dist/cjs/vector/vectorEditorExport.js.map +1 -0
- package/dist/cjs/vector/vectorEditorImport.js +150 -0
- package/dist/cjs/vector/vectorEditorImport.js.map +1 -0
- package/dist/cjs/vector/vectorEditorTypes.js +72 -0
- package/dist/cjs/vector/vectorEditorTypes.js.map +1 -0
- package/dist/cjs/vector/vectorGradients.js +201 -0
- package/dist/cjs/vector/vectorGradients.js.map +1 -0
- package/dist/esm/animation/AnimatedPerson.js +151 -0
- package/dist/esm/animation/AnimatedPerson.js.map +1 -0
- package/dist/esm/animation/AnimationEditor.js +104 -0
- package/dist/esm/animation/AnimationEditor.js.map +1 -0
- package/dist/esm/animation/Audience.js +57 -0
- package/dist/esm/animation/Audience.js.map +1 -0
- package/dist/esm/animation/BodyRenderer.js +28 -0
- package/dist/esm/animation/BodyRenderer.js.map +1 -0
- package/dist/esm/animation/animationHelper.js +268 -0
- package/dist/esm/animation/animationHelper.js.map +1 -0
- package/dist/esm/animation/characterTypes.js +70 -0
- package/dist/esm/animation/characterTypes.js.map +1 -0
- package/dist/esm/animation/choreoDSL.js +182 -0
- package/dist/esm/animation/choreoDSL.js.map +1 -0
- package/dist/esm/animation/choreography.js +36 -0
- package/dist/esm/animation/choreography.js.map +1 -0
- package/dist/esm/animation/karaokeIntegration.js +91 -0
- package/dist/esm/animation/karaokeIntegration.js.map +1 -0
- package/dist/esm/animation/lottieExport.js +123 -0
- package/dist/esm/animation/lottieExport.js.map +1 -0
- package/dist/esm/animation/motionPath.js +185 -0
- package/dist/esm/animation/motionPath.js.map +1 -0
- package/dist/esm/animation/physics.js +192 -0
- package/dist/esm/animation/physics.js.map +1 -0
- package/dist/esm/animation/rig/RigPlayer.js +61 -0
- package/dist/esm/animation/rig/RigPlayer.js.map +1 -0
- package/dist/esm/animation/rig/RiggedBody.js +28 -0
- package/dist/esm/animation/rig/RiggedBody.js.map +1 -0
- package/dist/esm/animation/rig/choreoRigBridge.js +60 -0
- package/dist/esm/animation/rig/choreoRigBridge.js.map +1 -0
- package/dist/esm/animation/rig/ik.js +20 -0
- package/dist/esm/animation/rig/ik.js.map +1 -0
- package/dist/esm/animation/rig/poseOps.js +45 -0
- package/dist/esm/animation/rig/poseOps.js.map +1 -0
- package/dist/esm/animation/rig/presets.js +53 -0
- package/dist/esm/animation/rig/presets.js.map +1 -0
- package/dist/esm/animation/rig/rigMath.js +37 -0
- package/dist/esm/animation/rig/rigMath.js.map +1 -0
- package/dist/esm/animation/rig/rigTypes.js +40 -0
- package/dist/esm/animation/rig/rigTypes.js.map +1 -0
- package/dist/esm/animation/shapes/arms.js +13 -0
- package/dist/esm/animation/shapes/arms.js.map +1 -0
- package/dist/esm/animation/shapes/eyes.js +45 -0
- package/dist/esm/animation/shapes/eyes.js.map +1 -0
- package/dist/esm/animation/shapes/hair.js +46 -0
- package/dist/esm/animation/shapes/hair.js.map +1 -0
- package/dist/esm/animation/shapes/heads.js +52 -0
- package/dist/esm/animation/shapes/heads.js.map +1 -0
- package/dist/esm/animation/shapes/headwear.js +36 -0
- package/dist/esm/animation/shapes/headwear.js.map +1 -0
- package/dist/esm/animation/shapes/legs.js +13 -0
- package/dist/esm/animation/shapes/legs.js.map +1 -0
- package/dist/esm/animation/shapes/mouths.js +45 -0
- package/dist/esm/animation/shapes/mouths.js.map +1 -0
- package/dist/esm/animation/shapes/noses.js +23 -0
- package/dist/esm/animation/shapes/noses.js.map +1 -0
- package/dist/esm/animation/shapes/outfits.js +37 -0
- package/dist/esm/animation/shapes/outfits.js.map +1 -0
- package/dist/esm/animation/shapes/torsos.js +11 -0
- package/dist/esm/animation/shapes/torsos.js.map +1 -0
- package/dist/esm/animation/spineExport.js +128 -0
- package/dist/esm/animation/spineExport.js.map +1 -0
- package/dist/esm/core/LocalUI.js +50 -0
- package/dist/esm/core/LocalUI.js.map +1 -0
- package/dist/esm/core/collaboration.js +252 -0
- package/dist/esm/core/collaboration.js.map +1 -0
- package/dist/esm/core/colorBlindness.js +90 -0
- package/dist/esm/core/colorBlindness.js.map +1 -0
- package/dist/esm/core/dragDrop.js +165 -0
- package/dist/esm/core/dragDrop.js.map +1 -0
- package/dist/esm/core/fixes.js +179 -0
- package/dist/esm/core/fixes.js.map +1 -0
- package/dist/esm/core/gridGuides.js +232 -0
- package/dist/esm/core/gridGuides.js.map +1 -0
- package/dist/esm/core/historyVisual.js +121 -0
- package/dist/esm/core/historyVisual.js.map +1 -0
- package/dist/esm/core/i18n.js +13 -0
- package/dist/esm/core/i18n.js.map +1 -0
- package/dist/esm/core/integrations.js +254 -0
- package/dist/esm/core/integrations.js.map +1 -0
- package/dist/esm/core/minimap.js +139 -0
- package/dist/esm/core/minimap.js.map +1 -0
- package/dist/esm/core/plugins.js +124 -0
- package/dist/esm/core/plugins.js.map +1 -0
- package/dist/esm/core/rtl.js +95 -0
- package/dist/esm/core/rtl.js.map +1 -0
- package/dist/esm/core/shortcuts.js +200 -0
- package/dist/esm/core/shortcuts.js.map +1 -0
- package/dist/esm/core/theme.js +162 -0
- package/dist/esm/core/theme.js.map +1 -0
- package/dist/esm/font/NiceFontEditor.js +189 -0
- package/dist/esm/font/NiceFontEditor.js.map +1 -0
- package/dist/esm/game/GameAsset2dEditor.js +369 -0
- package/dist/esm/game/GameAsset2dEditor.js.map +1 -0
- package/dist/esm/game/GameAsset2dEditor.module.css.js +4 -0
- package/dist/esm/game/GameAsset2dEditor.module.css.js.map +1 -0
- package/dist/esm/game/gameAssetTypes.js +18 -0
- package/dist/esm/game/gameAssetTypes.js.map +1 -0
- package/dist/esm/game/gameAssetUtils.js +456 -0
- package/dist/esm/game/gameAssetUtils.js.map +1 -0
- package/dist/esm/game/useGameAssetEditor.js +759 -0
- package/dist/esm/game/useGameAssetEditor.js.map +1 -0
- package/dist/esm/icon/NiceIconEditor.js +246 -0
- package/dist/esm/icon/NiceIconEditor.js.map +1 -0
- package/dist/esm/index.js +59 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/nice2dev-ui/dist/index.js +31720 -0
- package/dist/esm/nice2dev-ui/dist/index.js.map +1 -0
- package/dist/esm/nice2dev-ui-graphics.css +1 -0
- package/dist/esm/photo/FilterThumb.js +27 -0
- package/dist/esm/photo/FilterThumb.js.map +1 -0
- package/dist/esm/photo/PhotoEditor.js +18 -0
- package/dist/esm/photo/PhotoEditor.js.map +1 -0
- package/dist/esm/photo/PhotoEditor.module.css.js +4 -0
- package/dist/esm/photo/PhotoEditor.module.css.js.map +1 -0
- package/dist/esm/photo/PhotoEditorCanvas.js +57 -0
- package/dist/esm/photo/PhotoEditorCanvas.js.map +1 -0
- package/dist/esm/photo/PhotoEditorLeftPanel.js +172 -0
- package/dist/esm/photo/PhotoEditorLeftPanel.js.map +1 -0
- package/dist/esm/photo/PhotoEditorToolbar.js +13 -0
- package/dist/esm/photo/PhotoEditorToolbar.js.map +1 -0
- package/dist/esm/photo/photoEditorActions.js +75 -0
- package/dist/esm/photo/photoEditorActions.js.map +1 -0
- package/dist/esm/photo/photoEditorTypes.js +36 -0
- package/dist/esm/photo/photoEditorTypes.js.map +1 -0
- package/dist/esm/photo/photoFilters.js +871 -0
- package/dist/esm/photo/photoFilters.js.map +1 -0
- package/dist/esm/photo/photoOverlays.js +636 -0
- package/dist/esm/photo/photoOverlays.js.map +1 -0
- package/dist/esm/photo/photoSelection.js +535 -0
- package/dist/esm/photo/photoSelection.js.map +1 -0
- package/dist/esm/photo/usePhotoEditor.js +638 -0
- package/dist/esm/photo/usePhotoEditor.js.map +1 -0
- package/dist/esm/pixel/HSVPicker.js +171 -0
- package/dist/esm/pixel/HSVPicker.js.map +1 -0
- package/dist/esm/pixel/PixelEditor.js +26 -0
- package/dist/esm/pixel/PixelEditor.js.map +1 -0
- package/dist/esm/pixel/PixelEditor.module.css.js +4 -0
- package/dist/esm/pixel/PixelEditor.module.css.js.map +1 -0
- package/dist/esm/pixel/PixelEditorCanvas.js +13 -0
- package/dist/esm/pixel/PixelEditorCanvas.js.map +1 -0
- package/dist/esm/pixel/PixelEditorMenuBar.js +9 -0
- package/dist/esm/pixel/PixelEditorMenuBar.js.map +1 -0
- package/dist/esm/pixel/PixelEditorRightPanel.js +13 -0
- package/dist/esm/pixel/PixelEditorRightPanel.js.map +1 -0
- package/dist/esm/pixel/PixelEditorStatusBar.js +13 -0
- package/dist/esm/pixel/PixelEditorStatusBar.js.map +1 -0
- package/dist/esm/pixel/PixelEditorTimeline.js +9 -0
- package/dist/esm/pixel/PixelEditorTimeline.js.map +1 -0
- package/dist/esm/pixel/PixelEditorToolbar.js +14 -0
- package/dist/esm/pixel/PixelEditorToolbar.js.map +1 -0
- package/dist/esm/pixel/asepriteFormat.js +505 -0
- package/dist/esm/pixel/asepriteFormat.js.map +1 -0
- package/dist/esm/pixel/pixelEditorExports.js +461 -0
- package/dist/esm/pixel/pixelEditorExports.js.map +1 -0
- package/dist/esm/pixel/pixelEditorTypes.js +90 -0
- package/dist/esm/pixel/pixelEditorTypes.js.map +1 -0
- package/dist/esm/pixel/pixelEditorUtils.js +631 -0
- package/dist/esm/pixel/pixelEditorUtils.js.map +1 -0
- package/dist/esm/pixel/usePixelEditor.js +1110 -0
- package/dist/esm/pixel/usePixelEditor.js.map +1 -0
- package/dist/esm/texture/Nice3DTexturePainter.js +233 -0
- package/dist/esm/texture/Nice3DTexturePainter.js.map +1 -0
- package/dist/esm/ui/NiceUIDesigner.js +187 -0
- package/dist/esm/ui/NiceUIDesigner.js.map +1 -0
- package/dist/esm/vector/VectorEditor.js +29 -0
- package/dist/esm/vector/VectorEditor.js.map +1 -0
- package/dist/esm/vector/VectorEditor.module.css.js +4 -0
- package/dist/esm/vector/VectorEditor.module.css.js.map +1 -0
- package/dist/esm/vector/VectorEditorMenuBar.js +14 -0
- package/dist/esm/vector/VectorEditorMenuBar.js.map +1 -0
- package/dist/esm/vector/VectorEditorRightPanel.js +124 -0
- package/dist/esm/vector/VectorEditorRightPanel.js.map +1 -0
- package/dist/esm/vector/VectorEditorShapeRenderer.js +53 -0
- package/dist/esm/vector/VectorEditorShapeRenderer.js.map +1 -0
- package/dist/esm/vector/VectorEditorStatusBar.js +12 -0
- package/dist/esm/vector/VectorEditorStatusBar.js.map +1 -0
- package/dist/esm/vector/useVectorEditor.js +611 -0
- package/dist/esm/vector/useVectorEditor.js.map +1 -0
- package/dist/esm/vector/vectorBooleanOps.js +507 -0
- package/dist/esm/vector/vectorBooleanOps.js.map +1 -0
- package/dist/esm/vector/vectorEditorExport.js +152 -0
- package/dist/esm/vector/vectorEditorExport.js.map +1 -0
- package/dist/esm/vector/vectorEditorImport.js +148 -0
- package/dist/esm/vector/vectorEditorImport.js.map +1 -0
- package/dist/esm/vector/vectorEditorTypes.js +63 -0
- package/dist/esm/vector/vectorEditorTypes.js.map +1 -0
- package/dist/esm/vector/vectorGradients.js +193 -0
- package/dist/esm/vector/vectorGradients.js.map +1 -0
- package/dist/types/__benchmarks__/bench.d.ts +13 -0
- package/dist/types/__tests__/setup.d.ts +4 -0
- package/dist/types/animation/AnimatedPerson.d.ts +14 -0
- package/dist/types/animation/AnimationEditor.d.ts +20 -0
- package/dist/types/animation/Audience.d.ts +11 -0
- package/dist/types/animation/BodyRenderer.d.ts +12 -0
- package/dist/types/animation/animationHelper.d.ts +28 -0
- package/dist/types/animation/characterTypes.d.ts +37 -0
- package/dist/types/animation/choreoDSL.d.ts +88 -0
- package/dist/types/animation/choreography.d.ts +8 -0
- package/dist/types/animation/karaokeIntegration.d.ts +31 -0
- package/dist/types/animation/lottieExport.d.ts +77 -0
- package/dist/types/animation/motionPath.d.ts +60 -0
- package/dist/types/animation/physics.d.ts +73 -0
- package/dist/types/animation/rig/RigPlayer.d.ts +32 -0
- package/dist/types/animation/rig/RiggedBody.d.ts +19 -0
- package/dist/types/animation/rig/choreoRigBridge.d.ts +9 -0
- package/dist/types/animation/rig/ik.d.ts +8 -0
- package/dist/types/animation/rig/poseOps.d.ts +14 -0
- package/dist/types/animation/rig/presets.d.ts +13 -0
- package/dist/types/animation/rig/rigMath.d.ts +7 -0
- package/dist/types/animation/rig/rigTypes.d.ts +38 -0
- package/dist/types/animation/shapes/arms.d.ts +10 -0
- package/dist/types/animation/shapes/eyes.d.ts +17 -0
- package/dist/types/animation/shapes/hair.d.ts +17 -0
- package/dist/types/animation/shapes/heads.d.ts +18 -0
- package/dist/types/animation/shapes/headwear.d.ts +16 -0
- package/dist/types/animation/shapes/legs.d.ts +10 -0
- package/dist/types/animation/shapes/mouths.d.ts +17 -0
- package/dist/types/animation/shapes/noses.d.ts +17 -0
- package/dist/types/animation/shapes/outfits.d.ts +14 -0
- package/dist/types/animation/shapes/torsos.d.ts +9 -0
- package/dist/types/animation/spineExport.d.ts +66 -0
- package/dist/types/core/LocalUI.d.ts +21 -0
- package/dist/types/core/collaboration.d.ts +164 -0
- package/dist/types/core/colorBlindness.d.ts +24 -0
- package/dist/types/core/dragDrop.d.ts +46 -0
- package/dist/types/core/fixes.d.ts +80 -0
- package/dist/types/core/gridGuides.d.ts +70 -0
- package/dist/types/core/historyVisual.d.ts +915 -0
- package/dist/types/core/i18n.d.ts +27 -0
- package/dist/types/core/integrations.d.ts +103 -0
- package/dist/types/core/minimap.d.ts +49 -0
- package/dist/types/core/plugins.d.ts +111 -0
- package/dist/types/core/rtl.d.ts +32 -0
- package/dist/types/core/shortcuts.d.ts +150 -0
- package/dist/types/core/theme.d.ts +78 -0
- package/dist/types/core/useGamepad.d.ts +64 -0
- package/dist/types/core/usePointerPressure.d.ts +88 -0
- package/dist/types/font/NiceFontEditor.d.ts +62 -0
- package/dist/types/game/AnimationPreviewPlayer.d.ts +29 -0
- package/dist/types/game/CollisionEditor.d.ts +101 -0
- package/dist/types/game/GameAsset2dEditor.d.ts +17 -0
- package/dist/types/game/GameAssetExportPanel.d.ts +20 -0
- package/dist/types/game/IsometricEditor.d.ts +22 -0
- package/dist/types/game/IsometricTilePanel.d.ts +18 -0
- package/dist/types/game/gameAssetExport.d.ts +160 -0
- package/dist/types/game/gameAssetTypes.d.ts +238 -0
- package/dist/types/game/gameAssetUtils.d.ts +23 -0
- package/dist/types/game/index.d.ts +8 -0
- package/dist/types/game/isometricTiles.d.ts +250 -0
- package/dist/types/game/useAnimationPreview.d.ts +63 -0
- package/dist/types/game/useCollisionEditor.d.ts +96 -0
- package/dist/types/game/useGameAssetEditor.d.ts +79 -0
- package/dist/types/game/useGameAssetExport.d.ts +82 -0
- package/dist/types/icon/NiceIconEditor.d.ts +79 -0
- package/dist/types/index.d.ts +85 -0
- package/dist/types/photo/BatchProcessingPanel.d.ts +13 -0
- package/dist/types/photo/FaceDetectionPanel.d.ts +18 -0
- package/dist/types/photo/FilterThumb.d.ts +14 -0
- package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +17 -0
- package/dist/types/photo/PhotoEditor.d.ts +2 -0
- package/dist/types/photo/PhotoEditorCanvas.d.ts +14 -0
- package/dist/types/photo/PhotoEditorLeftPanel.d.ts +13 -0
- package/dist/types/photo/PhotoEditorToolbar.d.ts +13 -0
- package/dist/types/photo/RawFilePanel.d.ts +14 -0
- package/dist/types/photo/StyleTransferPanel.d.ts +15 -0
- package/dist/types/photo/aiStyleTransfer.d.ts +58 -0
- package/dist/types/photo/batchProcessing.d.ts +95 -0
- package/dist/types/photo/faceDetection.d.ts +103 -0
- package/dist/types/photo/index.d.ts +17 -0
- package/dist/types/photo/perspectiveCorrection.d.ts +134 -0
- package/dist/types/photo/photoEditorActions.d.ts +40 -0
- package/dist/types/photo/photoEditorTypes.d.ts +34 -0
- package/dist/types/photo/photoFilters.d.ts +55 -0
- package/dist/types/photo/photoOverlays.d.ts +126 -0
- package/dist/types/photo/photoSelection.d.ts +56 -0
- package/dist/types/photo/rawFileSupport.d.ts +124 -0
- package/dist/types/photo/usePhotoEditor.d.ts +123 -0
- package/dist/types/pixel/HSVPicker.d.ts +11 -0
- package/dist/types/pixel/PaletteExtractorPanel.d.ts +16 -0
- package/dist/types/pixel/PixelEditor.d.ts +17 -0
- package/dist/types/pixel/PixelEditorCanvas.d.ts +10 -0
- package/dist/types/pixel/PixelEditorMenuBar.d.ts +11 -0
- package/dist/types/pixel/PixelEditorRightPanel.d.ts +11 -0
- package/dist/types/pixel/PixelEditorStatusBar.d.ts +11 -0
- package/dist/types/pixel/PixelEditorTimeline.d.ts +11 -0
- package/dist/types/pixel/PixelEditorToolbar.d.ts +11 -0
- package/dist/types/pixel/TileMapPanel.d.ts +14 -0
- package/dist/types/pixel/asepriteFormat.d.ts +62 -0
- package/dist/types/pixel/paletteExtractor.d.ts +73 -0
- package/dist/types/pixel/pixelEditorExports.d.ts +31 -0
- package/dist/types/pixel/pixelEditorTypes.d.ts +51 -0
- package/dist/types/pixel/pixelEditorUtils.d.ts +136 -0
- package/dist/types/pixel/tileMapMode.d.ts +122 -0
- package/dist/types/pixel/usePixelEditor.d.ts +114 -0
- package/dist/types/texture/Nice3DTexturePainter.d.ts +55 -0
- package/dist/types/ui/NiceUIDesigner.d.ts +43 -0
- package/dist/types/vector/PathSimplificationPanel.d.ts +15 -0
- package/dist/types/vector/PdfExportPanel.d.ts +20 -0
- package/dist/types/vector/TextOnPathPanel.d.ts +26 -0
- package/dist/types/vector/VectorEditor.d.ts +32 -0
- package/dist/types/vector/VectorEditorMenuBar.d.ts +8 -0
- package/dist/types/vector/VectorEditorRightPanel.d.ts +7 -0
- package/dist/types/vector/VectorEditorShapeRenderer.d.ts +9 -0
- package/dist/types/vector/VectorEditorStatusBar.d.ts +9 -0
- package/dist/types/vector/VectorFilterPanel.d.ts +19 -0
- package/dist/types/vector/VectorPatternPanel.d.ts +21 -0
- package/dist/types/vector/pathSimplification.d.ts +135 -0
- package/dist/types/vector/pdfExport.d.ts +65 -0
- package/dist/types/vector/textOnPath.d.ts +145 -0
- package/dist/types/vector/useVectorEditor.d.ts +90 -0
- package/dist/types/vector/vectorBooleanOps.d.ts +22 -0
- package/dist/types/vector/vectorEditorExport.d.ts +8 -0
- package/dist/types/vector/vectorEditorImport.d.ts +7 -0
- package/dist/types/vector/vectorEditorTypes.d.ts +47 -0
- package/dist/types/vector/vectorGradients.d.ts +64 -0
- package/dist/types/vector/vectorPatternFills.d.ts +101 -0
- package/dist/types/vector/vectorSvgFilters.d.ts +134 -0
- package/package.json +93 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gameAssetTypes.ts — Types for GameAsset2dEditor
|
|
3
|
+
*
|
|
4
|
+
* Supports tile maps, sprite sheets, animations, and game asset processing.
|
|
5
|
+
*/
|
|
6
|
+
export type TileMapMode = '2d' | '2.5d-isometric' | '2.5d-oblique';
|
|
7
|
+
export interface TileDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
image: ImageData;
|
|
11
|
+
thumbnail: string;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
properties: Record<string, string | number | boolean>;
|
|
15
|
+
collision?: CollisionShape;
|
|
16
|
+
animated?: boolean;
|
|
17
|
+
frames?: string[];
|
|
18
|
+
frameDuration?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface CollisionShape {
|
|
21
|
+
type: 'none' | 'full' | 'custom';
|
|
22
|
+
polygons?: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}[][];
|
|
26
|
+
}
|
|
27
|
+
export interface TileLayer {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
visible: boolean;
|
|
31
|
+
locked: boolean;
|
|
32
|
+
opacity: number;
|
|
33
|
+
tiles: (string | null)[][];
|
|
34
|
+
parallaxX: number;
|
|
35
|
+
parallaxY: number;
|
|
36
|
+
offsetX: number;
|
|
37
|
+
offsetY: number;
|
|
38
|
+
zIndex: number;
|
|
39
|
+
}
|
|
40
|
+
export interface TileMap {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
mode: TileMapMode;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
tileWidth: number;
|
|
47
|
+
tileHeight: number;
|
|
48
|
+
layers: TileLayer[];
|
|
49
|
+
properties: Record<string, string | number | boolean>;
|
|
50
|
+
backgroundColor: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SpriteFrame {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
pivotX: number;
|
|
60
|
+
pivotY: number;
|
|
61
|
+
trimmed?: boolean;
|
|
62
|
+
trimRect?: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
w: number;
|
|
66
|
+
h: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface SpriteSheet {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
image: HTMLImageElement | null;
|
|
73
|
+
imageData: ImageData | null;
|
|
74
|
+
dataUrl: string;
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
frames: SpriteFrame[];
|
|
78
|
+
animations: SpriteAnimation[];
|
|
79
|
+
}
|
|
80
|
+
export interface SpriteAnimation {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
frameIds: string[];
|
|
84
|
+
frameDurations: number[];
|
|
85
|
+
loop: boolean;
|
|
86
|
+
pingPong: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface AnimationState {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
animationId: string;
|
|
92
|
+
speed: number;
|
|
93
|
+
loop: boolean;
|
|
94
|
+
position: {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface AnimationTransition {
|
|
100
|
+
id: string;
|
|
101
|
+
fromStateId: string;
|
|
102
|
+
toStateId: string;
|
|
103
|
+
condition: TransitionCondition;
|
|
104
|
+
duration: number;
|
|
105
|
+
priority: number;
|
|
106
|
+
}
|
|
107
|
+
export interface TransitionCondition {
|
|
108
|
+
type: 'trigger' | 'bool' | 'int' | 'float' | 'any';
|
|
109
|
+
paramName: string;
|
|
110
|
+
comparison?: '==' | '!=' | '>' | '<' | '>=' | '<=';
|
|
111
|
+
value?: string | number | boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface AnimationParameter {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
type: 'trigger' | 'bool' | 'int' | 'float';
|
|
117
|
+
defaultValue: boolean | number;
|
|
118
|
+
}
|
|
119
|
+
export interface AnimationStateMachine {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
states: AnimationState[];
|
|
123
|
+
transitions: AnimationTransition[];
|
|
124
|
+
parameters: AnimationParameter[];
|
|
125
|
+
entryStateId: string;
|
|
126
|
+
anyStateTransitions: AnimationTransition[];
|
|
127
|
+
}
|
|
128
|
+
export type EffectType = 'outline' | 'shadow' | 'glow' | 'palette-swap' | 'pixelate' | 'blur' | 'brightness' | 'contrast' | 'saturation' | 'hue-shift' | 'invert' | 'tint';
|
|
129
|
+
export interface Effect {
|
|
130
|
+
id: string;
|
|
131
|
+
type: EffectType;
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
params: Record<string, number | string>;
|
|
134
|
+
}
|
|
135
|
+
export interface EffectPreset {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
effects: Effect[];
|
|
139
|
+
}
|
|
140
|
+
export interface GameAssetProject {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
tileSets: TileDefinition[];
|
|
144
|
+
tileMaps: TileMap[];
|
|
145
|
+
spriteSheets: SpriteSheet[];
|
|
146
|
+
stateMachines: AnimationStateMachine[];
|
|
147
|
+
effectPresets: EffectPreset[];
|
|
148
|
+
settings: ProjectSettings;
|
|
149
|
+
}
|
|
150
|
+
export interface ProjectSettings {
|
|
151
|
+
defaultTileWidth: number;
|
|
152
|
+
defaultTileHeight: number;
|
|
153
|
+
pixelsPerUnit: number;
|
|
154
|
+
exportFormat: 'json' | 'yaml' | 'binary';
|
|
155
|
+
compressImages: boolean;
|
|
156
|
+
}
|
|
157
|
+
export type EditorMode = 'tilemap' | 'spritesheet' | 'animation' | 'effects';
|
|
158
|
+
export type TileMapTool = 'select' | 'brush' | 'eraser' | 'fill' | 'rectangle' | 'ellipse' | 'line' | 'eyedropper' | 'move';
|
|
159
|
+
export type SpriteSheetTool = 'select' | 'slice' | 'auto-slice' | 'merge' | 'split' | 'move' | 'resize';
|
|
160
|
+
export interface EditorState {
|
|
161
|
+
mode: EditorMode;
|
|
162
|
+
tileMapTool: TileMapTool;
|
|
163
|
+
spriteSheetTool: SpriteSheetTool;
|
|
164
|
+
selectedTileId: string | null;
|
|
165
|
+
selectedFrameIds: string[];
|
|
166
|
+
selectedStateId: string | null;
|
|
167
|
+
activeLayerId: string | null;
|
|
168
|
+
activeTileMapId: string | null;
|
|
169
|
+
activeSpriteSheetId: string | null;
|
|
170
|
+
activeStateMachineId: string | null;
|
|
171
|
+
zoom: number;
|
|
172
|
+
panX: number;
|
|
173
|
+
panY: number;
|
|
174
|
+
showGrid: boolean;
|
|
175
|
+
showCollision: boolean;
|
|
176
|
+
snapToGrid: boolean;
|
|
177
|
+
}
|
|
178
|
+
export interface ExportOptions {
|
|
179
|
+
format: 'png' | 'json' | 'tiled-json' | 'godot' | 'unity';
|
|
180
|
+
includeImages: boolean;
|
|
181
|
+
optimizeAtlas: boolean;
|
|
182
|
+
maxAtlasSize: number;
|
|
183
|
+
padding: number;
|
|
184
|
+
powerOfTwo: boolean;
|
|
185
|
+
}
|
|
186
|
+
export interface TiledExport {
|
|
187
|
+
type: 'map';
|
|
188
|
+
version: string;
|
|
189
|
+
tiledversion: string;
|
|
190
|
+
width: number;
|
|
191
|
+
height: number;
|
|
192
|
+
tilewidth: number;
|
|
193
|
+
tileheight: number;
|
|
194
|
+
layers: object[];
|
|
195
|
+
tilesets: object[];
|
|
196
|
+
}
|
|
197
|
+
export interface UnityExport {
|
|
198
|
+
sprites: {
|
|
199
|
+
name: string;
|
|
200
|
+
rect: {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
width: number;
|
|
204
|
+
height: number;
|
|
205
|
+
};
|
|
206
|
+
pivot: {
|
|
207
|
+
x: number;
|
|
208
|
+
y: number;
|
|
209
|
+
};
|
|
210
|
+
border: {
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
z: number;
|
|
214
|
+
w: number;
|
|
215
|
+
};
|
|
216
|
+
}[];
|
|
217
|
+
animations: {
|
|
218
|
+
name: string;
|
|
219
|
+
frames: {
|
|
220
|
+
sprite: string;
|
|
221
|
+
duration: number;
|
|
222
|
+
}[];
|
|
223
|
+
}[];
|
|
224
|
+
}
|
|
225
|
+
export interface HistoryEntry {
|
|
226
|
+
id: string;
|
|
227
|
+
description: string;
|
|
228
|
+
timestamp: number;
|
|
229
|
+
snapshot: Partial<GameAssetProject>;
|
|
230
|
+
}
|
|
231
|
+
export declare const TILE_MAP_TOOLS: {
|
|
232
|
+
id: TileMapTool;
|
|
233
|
+
icon: string;
|
|
234
|
+
label: string;
|
|
235
|
+
key: string;
|
|
236
|
+
}[];
|
|
237
|
+
export declare const EFFECT_DEFAULTS: Record<EffectType, Record<string, number | string>>;
|
|
238
|
+
export declare const DEFAULT_PROJECT_SETTINGS: ProjectSettings;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gameAssetUtils.ts — Utilities for GameAsset2dEditor
|
|
3
|
+
*/
|
|
4
|
+
import type { TileDefinition, TileMap, TileLayer, SpriteFrame, SpriteAnimation, Effect, GameAssetProject, TiledExport } from './gameAssetTypes';
|
|
5
|
+
export declare const generateId: (prefix?: string) => string;
|
|
6
|
+
export declare const imageDataToDataUrl: (imageData: ImageData) => string;
|
|
7
|
+
export declare const dataUrlToImageData: (dataUrl: string) => Promise<ImageData>;
|
|
8
|
+
export declare const loadImage: (src: string) => Promise<HTMLImageElement>;
|
|
9
|
+
export declare const cropImageData: (imageData: ImageData, x: number, y: number, width: number, height: number) => ImageData;
|
|
10
|
+
export declare const createTileFromImage: (imageData: ImageData, name: string) => TileDefinition;
|
|
11
|
+
export declare const createEmptyTileLayer: (name: string, mapWidth: number, mapHeight: number) => TileLayer;
|
|
12
|
+
export declare const createEmptyTileMap: (name: string, width: number, height: number, tileWidth: number, tileHeight: number, mode?: "tilemap" | "2d" | "2.5d-isometric" | "2.5d-oblique") => TileMap;
|
|
13
|
+
export declare const autoSliceSpriteSheet: (imageData: ImageData, frameWidth: number, frameHeight: number, padding?: number) => SpriteFrame[];
|
|
14
|
+
export declare const detectFrames: (imageData: ImageData) => SpriteFrame[];
|
|
15
|
+
export declare const createSpriteAnimation: (name: string, frameIds: string[], frameDelay?: number) => SpriteAnimation;
|
|
16
|
+
export declare const applyEffect: (imageData: ImageData, effect: Effect) => ImageData;
|
|
17
|
+
export declare const applyEffects: (imageData: ImageData, effects: Effect[]) => ImageData;
|
|
18
|
+
export declare const exportToTiledJson: (tileMap: TileMap, tileSets: TileDefinition[]) => TiledExport;
|
|
19
|
+
export declare const downloadJson: (data: object, filename: string) => void;
|
|
20
|
+
export declare const downloadPng: (canvas: HTMLCanvasElement, filename: string) => void;
|
|
21
|
+
export declare const createEmptyProject: (name: string) => GameAssetProject;
|
|
22
|
+
export declare const serializeProject: (project: GameAssetProject) => string;
|
|
23
|
+
export declare const deserializeProject: (json: string) => Promise<GameAssetProject>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* game/index.ts — Public exports for GameAsset2dEditor
|
|
3
|
+
*/
|
|
4
|
+
export { GameAsset2dEditor, type GameAsset2dEditorProps } from './GameAsset2dEditor';
|
|
5
|
+
export { useGameAssetEditor, type GameAssetEditorApi, type UseGameAssetEditorOptions } from './useGameAssetEditor';
|
|
6
|
+
export type { TileMapMode, TileDefinition, CollisionShape, TileLayer, TileMap, SpriteFrame, SpriteSheet, SpriteAnimation, AnimationState, AnimationTransition, TransitionCondition, AnimationParameter, AnimationStateMachine, EffectType, Effect, EffectPreset, GameAssetProject, ProjectSettings, EditorMode, TileMapTool, SpriteSheetTool, EditorState, ExportOptions, TiledExport, UnityExport, HistoryEntry, } from './gameAssetTypes';
|
|
7
|
+
export { TILE_MAP_TOOLS, EFFECT_DEFAULTS, DEFAULT_PROJECT_SETTINGS, } from './gameAssetTypes';
|
|
8
|
+
export { generateId, imageDataToDataUrl, dataUrlToImageData, loadImage, cropImageData, createTileFromImage, createEmptyTileLayer, createEmptyTileMap, autoSliceSpriteSheet, detectFrames, createSpriteAnimation, applyEffect, applyEffects, exportToTiledJson, downloadJson, downloadPng, createEmptyProject, serializeProject, deserializeProject, } from './gameAssetUtils';
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Isometric Tile System
|
|
3
|
+
* Support for 2.5D isometric/dimetric tile rendering and editing
|
|
4
|
+
*/
|
|
5
|
+
export type IsometricProjection = 'isometric' | 'dimetric' | 'trimetric' | 'military' | 'cavalier';
|
|
6
|
+
export interface IsometricConfig {
|
|
7
|
+
/** Projection type */
|
|
8
|
+
projection: IsometricProjection;
|
|
9
|
+
/** Tile width in pixels */
|
|
10
|
+
tileWidth: number;
|
|
11
|
+
/** Tile height in pixels (visible portion) */
|
|
12
|
+
tileHeight: number;
|
|
13
|
+
/** Tile depth (for 3D tiles) */
|
|
14
|
+
tileDepth: number;
|
|
15
|
+
/** Angle in degrees (for custom projections) */
|
|
16
|
+
angle: number;
|
|
17
|
+
/** Scale factor */
|
|
18
|
+
scale: number;
|
|
19
|
+
/** Origin offset */
|
|
20
|
+
origin: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
/** Grid size (columns x rows) */
|
|
25
|
+
gridSize: {
|
|
26
|
+
cols: number;
|
|
27
|
+
rows: number;
|
|
28
|
+
};
|
|
29
|
+
/** Stacking layers */
|
|
30
|
+
layers: number;
|
|
31
|
+
}
|
|
32
|
+
export interface IsometricTile {
|
|
33
|
+
/** Unique ID */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Grid position */
|
|
36
|
+
gridX: number;
|
|
37
|
+
gridY: number;
|
|
38
|
+
/** Layer (z-level) */
|
|
39
|
+
layer: number;
|
|
40
|
+
/** Tile type/sprite index */
|
|
41
|
+
tileType: number;
|
|
42
|
+
/** Rotation (0, 90, 180, 270) */
|
|
43
|
+
rotation: 0 | 90 | 180 | 270;
|
|
44
|
+
/** Flip horizontally */
|
|
45
|
+
flipX: boolean;
|
|
46
|
+
/** Flip vertically */
|
|
47
|
+
flipY: boolean;
|
|
48
|
+
/** Custom height offset */
|
|
49
|
+
heightOffset: number;
|
|
50
|
+
/** Tile metadata */
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
export interface IsometricTileset {
|
|
54
|
+
/** Tileset name */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Source image path */
|
|
57
|
+
imagePath: string;
|
|
58
|
+
/** Tile definitions */
|
|
59
|
+
tiles: IsometricTileDefinition[];
|
|
60
|
+
/** Tileset dimensions */
|
|
61
|
+
imageWidth: number;
|
|
62
|
+
imageHeight: number;
|
|
63
|
+
}
|
|
64
|
+
export interface IsometricTileDefinition {
|
|
65
|
+
/** Tile ID */
|
|
66
|
+
id: number;
|
|
67
|
+
/** Name */
|
|
68
|
+
name: string;
|
|
69
|
+
/** Region in source image */
|
|
70
|
+
region: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
};
|
|
76
|
+
/** Tile footprint (for larger tiles) */
|
|
77
|
+
footprint: {
|
|
78
|
+
cols: number;
|
|
79
|
+
rows: number;
|
|
80
|
+
};
|
|
81
|
+
/** Height in layers */
|
|
82
|
+
height: number;
|
|
83
|
+
/** Anchor point (for positioning) */
|
|
84
|
+
anchor: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
};
|
|
88
|
+
/** Collision type */
|
|
89
|
+
collision: 'none' | 'solid' | 'half' | 'ramp-n' | 'ramp-s' | 'ramp-e' | 'ramp-w';
|
|
90
|
+
/** Tags for filtering */
|
|
91
|
+
tags: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface IsometricMap {
|
|
94
|
+
/** Map name */
|
|
95
|
+
name: string;
|
|
96
|
+
/** Grid dimensions */
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
/** Number of layers */
|
|
100
|
+
layers: number;
|
|
101
|
+
/** Tile data */
|
|
102
|
+
tiles: IsometricTile[];
|
|
103
|
+
/** Tileset references */
|
|
104
|
+
tilesets: string[];
|
|
105
|
+
/** Map properties */
|
|
106
|
+
properties: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
export interface ScreenPosition {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
}
|
|
112
|
+
export interface GridPosition {
|
|
113
|
+
col: number;
|
|
114
|
+
row: number;
|
|
115
|
+
layer: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get projection angles for different isometric types
|
|
119
|
+
*/
|
|
120
|
+
export declare function getProjectionAngles(projection: IsometricProjection): {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Convert grid coordinates to screen coordinates
|
|
126
|
+
*/
|
|
127
|
+
export declare function gridToScreen(gridX: number, gridY: number, layer: number, config: IsometricConfig): ScreenPosition;
|
|
128
|
+
/**
|
|
129
|
+
* Convert screen coordinates to grid coordinates
|
|
130
|
+
*/
|
|
131
|
+
export declare function screenToGrid(screenX: number, screenY: number, layer: number, config: IsometricConfig): GridPosition;
|
|
132
|
+
/**
|
|
133
|
+
* Get tile corners in screen space
|
|
134
|
+
*/
|
|
135
|
+
export declare function getTileCorners(gridX: number, gridY: number, layer: number, config: IsometricConfig): ScreenPosition[];
|
|
136
|
+
/**
|
|
137
|
+
* Get 3D tile vertices (for cubes/blocks)
|
|
138
|
+
*/
|
|
139
|
+
export declare function getTile3DVertices(gridX: number, gridY: number, layer: number, height: number, config: IsometricConfig): {
|
|
140
|
+
top: ScreenPosition[];
|
|
141
|
+
left: ScreenPosition[];
|
|
142
|
+
right: ScreenPosition[];
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Sort tiles for correct rendering order (painter's algorithm)
|
|
146
|
+
*/
|
|
147
|
+
export declare function sortTilesForRendering(tiles: IsometricTile[]): IsometricTile[];
|
|
148
|
+
/**
|
|
149
|
+
* Get visible tiles within viewport
|
|
150
|
+
*/
|
|
151
|
+
export declare function getVisibleTiles(tiles: IsometricTile[], viewport: {
|
|
152
|
+
x: number;
|
|
153
|
+
y: number;
|
|
154
|
+
width: number;
|
|
155
|
+
height: number;
|
|
156
|
+
}, config: IsometricConfig): IsometricTile[];
|
|
157
|
+
/**
|
|
158
|
+
* Render isometric grid to canvas
|
|
159
|
+
*/
|
|
160
|
+
export declare function renderIsometricGrid(ctx: CanvasRenderingContext2D, config: IsometricConfig, options?: {
|
|
161
|
+
gridColor?: string;
|
|
162
|
+
gridOpacity?: number;
|
|
163
|
+
showCoordinates?: boolean;
|
|
164
|
+
}): void;
|
|
165
|
+
/**
|
|
166
|
+
* Render a single isometric tile
|
|
167
|
+
*/
|
|
168
|
+
export declare function renderIsometricTile(ctx: CanvasRenderingContext2D, tile: IsometricTile, tileset: IsometricTileset, tileImage: HTMLImageElement, config: IsometricConfig): void;
|
|
169
|
+
/**
|
|
170
|
+
* Render 3D block (cube) at position
|
|
171
|
+
*/
|
|
172
|
+
export declare function renderIsometricBlock(ctx: CanvasRenderingContext2D, gridX: number, gridY: number, layer: number, height: number, colors: {
|
|
173
|
+
top: string;
|
|
174
|
+
left: string;
|
|
175
|
+
right: string;
|
|
176
|
+
}, config: IsometricConfig): void;
|
|
177
|
+
/**
|
|
178
|
+
* Create a new isometric map
|
|
179
|
+
*/
|
|
180
|
+
export declare function createIsometricMap(name: string, width: number, height: number, layers?: number): IsometricMap;
|
|
181
|
+
/**
|
|
182
|
+
* Add a tile to the map
|
|
183
|
+
*/
|
|
184
|
+
export declare function addTile(map: IsometricMap, tile: Omit<IsometricTile, 'id'>): IsometricMap;
|
|
185
|
+
/**
|
|
186
|
+
* Remove a tile from the map
|
|
187
|
+
*/
|
|
188
|
+
export declare function removeTile(map: IsometricMap, tileId: string): IsometricMap;
|
|
189
|
+
/**
|
|
190
|
+
* Get tile at position
|
|
191
|
+
*/
|
|
192
|
+
export declare function getTileAt(map: IsometricMap, gridX: number, gridY: number, layer: number): IsometricTile | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Get all tiles at position (all layers)
|
|
195
|
+
*/
|
|
196
|
+
export declare function getTilesAt(map: IsometricMap, gridX: number, gridY: number): IsometricTile[];
|
|
197
|
+
/**
|
|
198
|
+
* Fill a region with tiles
|
|
199
|
+
*/
|
|
200
|
+
export declare function fillRegion(map: IsometricMap, startX: number, startY: number, endX: number, endY: number, layer: number, tileType: number): IsometricMap;
|
|
201
|
+
/**
|
|
202
|
+
* Export to Tiled TMX format (isometric)
|
|
203
|
+
*/
|
|
204
|
+
export declare function exportToTiledIsometric(map: IsometricMap, configOrTileset?: IsometricConfig | IsometricTileset, configArg?: IsometricConfig): string;
|
|
205
|
+
/**
|
|
206
|
+
* Export to Godot isometric tilemap
|
|
207
|
+
*/
|
|
208
|
+
export declare function exportToGodotIsometric(map: IsometricMap, configOrTileset?: IsometricConfig | IsometricTileset, configArg?: IsometricConfig): string;
|
|
209
|
+
export interface UseIsometricEditorOptions {
|
|
210
|
+
/** Initial configuration */
|
|
211
|
+
config?: Partial<IsometricConfig>;
|
|
212
|
+
/** Initial map */
|
|
213
|
+
initialMap?: IsometricMap;
|
|
214
|
+
}
|
|
215
|
+
export interface UseIsometricEditorReturn {
|
|
216
|
+
/** Current configuration */
|
|
217
|
+
config: IsometricConfig;
|
|
218
|
+
/** Current map */
|
|
219
|
+
map: IsometricMap;
|
|
220
|
+
/** Update configuration */
|
|
221
|
+
setConfig: (config: Partial<IsometricConfig>) => void;
|
|
222
|
+
/** Set selected tile type */
|
|
223
|
+
setSelectedTile: (tileType: number) => void;
|
|
224
|
+
/** Selected tile type */
|
|
225
|
+
selectedTile: number;
|
|
226
|
+
/** Current layer */
|
|
227
|
+
currentLayer: number;
|
|
228
|
+
/** Set current layer */
|
|
229
|
+
setCurrentLayer: (layer: number) => void;
|
|
230
|
+
/** Place tile at grid position */
|
|
231
|
+
placeTile: (gridX: number, gridY: number) => void;
|
|
232
|
+
/** Remove tile at grid position */
|
|
233
|
+
eraseTile: (gridX: number, gridY: number) => void;
|
|
234
|
+
/** Fill region */
|
|
235
|
+
fill: (startX: number, startY: number, endX: number, endY: number) => void;
|
|
236
|
+
/** Convert screen to grid */
|
|
237
|
+
screenToGrid: (screenX: number, screenY: number) => GridPosition;
|
|
238
|
+
/** Undo last action */
|
|
239
|
+
undo: () => void;
|
|
240
|
+
/** Redo last undone action */
|
|
241
|
+
redo: () => void;
|
|
242
|
+
/** Can undo */
|
|
243
|
+
canUndo: boolean;
|
|
244
|
+
/** Can redo */
|
|
245
|
+
canRedo: boolean;
|
|
246
|
+
/** Clear map */
|
|
247
|
+
clear: () => void;
|
|
248
|
+
}
|
|
249
|
+
export declare function useIsometricEditor(options?: UseIsometricEditorOptions): UseIsometricEditorReturn;
|
|
250
|
+
export default useIsometricEditor;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAnimationPreview — Hook for animation playback in GameAsset2dEditor
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Real-time frame playback with configurable speed
|
|
6
|
+
* - State machine simulation with parameter control
|
|
7
|
+
* - Transition blending preview
|
|
8
|
+
* - Play/pause/stop/step controls
|
|
9
|
+
* - Loop and ping-pong modes
|
|
10
|
+
* - Timeline scrubbing
|
|
11
|
+
*/
|
|
12
|
+
import type { SpriteFrame, SpriteSheet, AnimationStateMachine } from './gameAssetTypes';
|
|
13
|
+
export interface AnimationPreviewState {
|
|
14
|
+
isPlaying: boolean;
|
|
15
|
+
currentFrameIndex: number;
|
|
16
|
+
elapsedTime: number;
|
|
17
|
+
playbackSpeed: number;
|
|
18
|
+
currentAnimationId: string | null;
|
|
19
|
+
animationType: 'single' | 'stateMachine';
|
|
20
|
+
currentStateId: string | null;
|
|
21
|
+
targetStateId: string | null;
|
|
22
|
+
transitionProgress: number;
|
|
23
|
+
isTransitioning: boolean;
|
|
24
|
+
parameterValues: Map<string, boolean | number>;
|
|
25
|
+
currentFrame: SpriteFrame | null;
|
|
26
|
+
frameImageData: ImageData | null;
|
|
27
|
+
onionSkinEnabled: boolean;
|
|
28
|
+
onionSkinFrames: number;
|
|
29
|
+
onionSkinOpacity: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AnimationPreviewOptions {
|
|
32
|
+
spriteSheets: SpriteSheet[];
|
|
33
|
+
stateMachines: AnimationStateMachine[];
|
|
34
|
+
onFrameChange?: (frameIndex: number) => void;
|
|
35
|
+
onStateChange?: (stateId: string) => void;
|
|
36
|
+
onTransitionStart?: (fromId: string, toId: string) => void;
|
|
37
|
+
onTransitionEnd?: (toId: string) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface AnimationPreviewApi {
|
|
40
|
+
state: AnimationPreviewState;
|
|
41
|
+
play: () => void;
|
|
42
|
+
pause: () => void;
|
|
43
|
+
stop: () => void;
|
|
44
|
+
stepForward: () => void;
|
|
45
|
+
stepBackward: () => void;
|
|
46
|
+
setPlaybackSpeed: (speed: number) => void;
|
|
47
|
+
toggleLoop: () => void;
|
|
48
|
+
seekToFrame: (frameIndex: number) => void;
|
|
49
|
+
seekToTime: (timeMs: number) => void;
|
|
50
|
+
playAnimation: (animationId: string) => void;
|
|
51
|
+
playStateMachine: (stateMachineId: string) => void;
|
|
52
|
+
setParameter: (name: string, value: boolean | number) => void;
|
|
53
|
+
triggerParameter: (name: string) => void;
|
|
54
|
+
forceState: (stateId: string) => void;
|
|
55
|
+
resetStateMachine: () => void;
|
|
56
|
+
toggleOnionSkin: () => void;
|
|
57
|
+
setOnionSkinFrames: (count: number) => void;
|
|
58
|
+
setOnionSkinOpacity: (opacity: number) => void;
|
|
59
|
+
getAnimationDuration: (animationId: string) => number;
|
|
60
|
+
getFrameAt: (animationId: string, timeMs: number) => SpriteFrame | null;
|
|
61
|
+
getCurrentFrameImage: () => HTMLCanvasElement | null;
|
|
62
|
+
}
|
|
63
|
+
export declare function useAnimationPreview(options: AnimationPreviewOptions): AnimationPreviewApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useCollisionEditor — Hook for collision editing state management
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Collision body management (CRUD)
|
|
6
|
+
* - Undo/redo history
|
|
7
|
+
* - Collision shape operations
|
|
8
|
+
* - Per-frame collision support
|
|
9
|
+
* - Collision testing/preview
|
|
10
|
+
* - Export to physics engine formats
|
|
11
|
+
*/
|
|
12
|
+
import type { CollisionBody, CollisionShape, CollisionShapeType } from './CollisionEditor';
|
|
13
|
+
export interface FrameCollision {
|
|
14
|
+
frameIndex: number;
|
|
15
|
+
body: CollisionBody;
|
|
16
|
+
}
|
|
17
|
+
export interface CollisionEditorState {
|
|
18
|
+
/** Current body being edited */
|
|
19
|
+
currentBody: CollisionBody | null;
|
|
20
|
+
/** Per-frame collision data */
|
|
21
|
+
frameCollisions: FrameCollision[];
|
|
22
|
+
/** Currently selected frame index (for animations) */
|
|
23
|
+
currentFrameIndex: number;
|
|
24
|
+
/** Whether to use per-frame collisions */
|
|
25
|
+
usePerFrameCollisions: boolean;
|
|
26
|
+
/** Undo history */
|
|
27
|
+
undoStack: CollisionBody[];
|
|
28
|
+
/** Redo history */
|
|
29
|
+
redoStack: CollisionBody[];
|
|
30
|
+
/** Selected shape ID */
|
|
31
|
+
selectedShapeId: string | null;
|
|
32
|
+
/** Preview mode enabled */
|
|
33
|
+
previewMode: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface UseCollisionEditorOptions {
|
|
36
|
+
/** Initial body */
|
|
37
|
+
initialBody?: CollisionBody | null;
|
|
38
|
+
/** Initial frame collisions */
|
|
39
|
+
initialFrameCollisions?: FrameCollision[];
|
|
40
|
+
/** Max undo history size */
|
|
41
|
+
maxHistory?: number;
|
|
42
|
+
/** Called when body changes */
|
|
43
|
+
onChange?: (body: CollisionBody | null, frameCollisions: FrameCollision[]) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface UseCollisionEditorReturn {
|
|
46
|
+
/** Current state */
|
|
47
|
+
state: CollisionEditorState;
|
|
48
|
+
/** Current body (auto-switches based on frame) */
|
|
49
|
+
currentBody: CollisionBody | null;
|
|
50
|
+
/** Update the current body */
|
|
51
|
+
setBody: (body: CollisionBody) => void;
|
|
52
|
+
/** Create a new body */
|
|
53
|
+
createBody: () => void;
|
|
54
|
+
/** Delete the current body */
|
|
55
|
+
deleteBody: () => void;
|
|
56
|
+
/** Clone the current body */
|
|
57
|
+
cloneBody: () => void;
|
|
58
|
+
/** Add a shape to current body */
|
|
59
|
+
addShape: (type: CollisionShapeType) => void;
|
|
60
|
+
/** Update a shape */
|
|
61
|
+
updateShape: (shape: CollisionShape) => void;
|
|
62
|
+
/** Delete a shape */
|
|
63
|
+
deleteShape: (shapeId: string) => void;
|
|
64
|
+
/** Duplicate a shape */
|
|
65
|
+
duplicateShape: (shapeId: string) => void;
|
|
66
|
+
/** Select a shape */
|
|
67
|
+
selectShape: (shapeId: string | null) => void;
|
|
68
|
+
/** Move shape in layer order */
|
|
69
|
+
moveShape: (shapeId: string, direction: 'up' | 'down') => void;
|
|
70
|
+
/** Undo last action */
|
|
71
|
+
undo: () => void;
|
|
72
|
+
/** Redo last undone action */
|
|
73
|
+
redo: () => void;
|
|
74
|
+
/** Can undo */
|
|
75
|
+
canUndo: boolean;
|
|
76
|
+
/** Can redo */
|
|
77
|
+
canRedo: boolean;
|
|
78
|
+
/** Toggle per-frame collisions */
|
|
79
|
+
setUsePerFrameCollisions: (use: boolean) => void;
|
|
80
|
+
/** Set current frame */
|
|
81
|
+
setCurrentFrame: (frameIndex: number) => void;
|
|
82
|
+
/** Copy collision to frame */
|
|
83
|
+
copyToFrame: (targetFrameIndex: number) => void;
|
|
84
|
+
/** Copy collision to all frames */
|
|
85
|
+
copyToAllFrames: () => void;
|
|
86
|
+
/** Toggle preview mode */
|
|
87
|
+
setPreviewMode: (enabled: boolean) => void;
|
|
88
|
+
/** Export to physics engine format */
|
|
89
|
+
exportToFormat: (format: 'box2d' | 'matter' | 'rapier' | 'json') => string;
|
|
90
|
+
/** Import from JSON */
|
|
91
|
+
importFromJson: (json: string) => void;
|
|
92
|
+
/** Reset to defaults */
|
|
93
|
+
reset: () => void;
|
|
94
|
+
}
|
|
95
|
+
export declare function useCollisionEditor(options?: UseCollisionEditorOptions): UseCollisionEditorReturn;
|
|
96
|
+
export default useCollisionEditor;
|