From ba3ed8c09979a216e4e147d576a8d93b841db370 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Fri, 21 Mar 2025 01:57:37 +0100 Subject: [PATCH] Sprite editor changes --- .../partials/sprite/SpriteDetails.vue | 48 +++++++++++++------ .../partials/sprite/partials/SpriteEditor.vue | 12 ++++- .../sprite/partials/SpriteImagesPreview.vue | 38 --------------- src/components/utilities/Accordion.vue | 22 --------- 4 files changed, 45 insertions(+), 75 deletions(-) delete mode 100644 src/components/gameMaster/assetManager/partials/sprite/partials/SpriteImagesPreview.vue delete mode 100644 src/components/utilities/Accordion.vue diff --git a/src/components/gameMaster/assetManager/partials/sprite/SpriteDetails.vue b/src/components/gameMaster/assetManager/partials/sprite/SpriteDetails.vue index da0653a..78d986d 100644 --- a/src/components/gameMaster/assetManager/partials/sprite/SpriteDetails.vue +++ b/src/components/gameMaster/assetManager/partials/sprite/SpriteDetails.vue @@ -17,20 +17,24 @@ - - - - + { openEditors.value = new Map() }) +interface SpriteImage { + url: string + offset: { + x: number + y: number + } +} + +const imageDimensions = ref<{ [key: number]: { width: number; height: number } }>({}) + +const updateImageDimensions = (event: Event, index: number) => { + const img = event.target as HTMLImageElement + imageDimensions.value[index] = { + width: img.naturalWidth, + height: img.naturalHeight + } +} + onMounted(() => { if (!selectedSprite.value) return }) diff --git a/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteEditor.vue b/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteEditor.vue index f3324ed..eb5f15c 100644 --- a/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteEditor.vue +++ b/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteEditor.vue @@ -32,8 +32,13 @@
+
+
+ Sprite action +
+
- +
@@ -44,6 +49,11 @@
+
+
+ Sprite action image +
+
diff --git a/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteImagesPreview.vue b/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteImagesPreview.vue deleted file mode 100644 index 2cebb67..0000000 --- a/src/components/gameMaster/assetManager/partials/sprite/partials/SpriteImagesPreview.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/src/components/utilities/Accordion.vue b/src/components/utilities/Accordion.vue deleted file mode 100644 index 6417595..0000000 --- a/src/components/utilities/Accordion.vue +++ /dev/null @@ -1,22 +0,0 @@ - - -