1
0
forked from noxious/client

Show sprite duration

This commit is contained in:
Dennis Postma 2025-02-10 16:10:36 +01:00
parent b27a2e8779
commit 13e8c1b4dd

View File

@ -34,7 +34,7 @@
</div> </div>
<div class="flex flex-col justify-center gap-8 flex-1"> <div class="flex flex-col justify-center gap-8 flex-1">
<div class="flex flex-col"> <div class="flex flex-col">
<label class="block mb-2 text-white">Frame Rate: {{ frameRate }} FPS</label> <label class="block mb-2 text-white">Frame Rate: {{ frameRate }} FPS (Duration: {{ totalDuration }}s)</label>
<input type="range" v-model.number="localFrameRate" min="0" max="60" step="1" class="w-full accent-cyan-500" @input="updateFrameRate" /> <input type="range" v-model.number="localFrameRate" min="0" max="60" step="1" class="w-full accent-cyan-500" @input="updateFrameRate" />
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
@ -76,6 +76,11 @@ const localFrameRate = ref(props.frameRate)
const zoomLevel = ref(100) const zoomLevel = ref(100)
let animationInterval: number | null = null let animationInterval: number | null = null
const totalDuration = computed(() => {
if (props.frameRate <= 0) return 0
return (props.sprites.length / props.frameRate).toFixed(2)
})
const spritesWithTempOffset = computed(() => { const spritesWithTempOffset = computed(() => {
return props.sprites.map((sprite, index) => { return props.sprites.map((sprite, index) => {
if (index === props.tempOffsetIndex && props.tempOffset) { if (index === props.tempOffsetIndex && props.tempOffset) {