Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How could I set the gif to start from beginning when I go to the card it's in?

I wanna use it for a non-looping video with a timer that changes to the next card, but right now the gif might be playing from the middle when I open the card it's in.

(+1)

If you don't mind a slightly lateral answer, this is what's inside the gif contraption:


There is a Button that contains a script that imports each frame of a gif and stores them all as image data in a hidden rich text field.
There is the Field that is storing all of the imported image data in sequence.
There is a Canvas that the images will be displayed on.
And there is a Script which takes each frame from the image data in the Field and displays them on the Canvas in a loop.

When there's a contraption that's almost what I want I often look inside to take out a specific piece that I need, and combine it with other things to get a different effect.

In your case the import button and the frame storage already should work fine but the playback script seems to need to be a little different for your project. 

From what you've said your clip should always start at the beginning when someone arrives at the card, and the player/viewer should be sent somewhere else at the same time that the playback ends, right?

If you'd be comfortable making a new thread about what you're trying to do I'm sure folks would be happy to help you get a really specific answer for your project (other people have done more things with video playback in Decker than I have!) and it would probably be a helpful discussion for the community.

(+1)

We ended up making animations by just having each frame on a separate card instead of importing a gif, but thanks a ton for the answer! I'm very new to Decker so I had a hard time trying to understand how the gif contraption works and what I'm supposed to edit in it. Your breakdown makes sense!