forked from noxious/client
Show sprite duration
This commit is contained in:
parent
b27a2e8779
commit
13e8c1b4dd
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user